Class: Gemfire::DiskStore
- Inherits:
-
Shared::Resource
- Object
- Shared::Resource
- Gemfire::DiskStore
- Defined in:
- lib/vas/gemfire/disk_stores.rb
Overview
A disk store in a cache server node instance
Instance Attribute Summary collapse
-
#instance ⇒ CacheServerNodeInstance
readonly
The disk store’s cache server node instance.
-
#name ⇒ String
readonly
The name of the disk store.
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#content {|chunk| ... } ⇒ void
Retrieves the disk store’s content.
-
#initialize(location, client) ⇒ DiskStore
constructor
A new instance of DiskStore.
-
#last_modified ⇒ Integer
The last modified stamp of the disk store.
-
#size ⇒ Integer
The size of the disk store.
-
#to_s ⇒ String
A string representation of the disk store.
Constructor Details
#initialize(location, client) ⇒ DiskStore
Returns a new instance of DiskStore.
39 40 41 42 43 44 45 |
# File 'lib/vas/gemfire/disk_stores.rb', line 39 def initialize(location, client) super(location, client) @name = details['name'] @instance = CacheServerNodeInstance.new(Util::LinkUtils.get_link_href(details, 'cache-server-node-instance'), client) @content_location = Util::LinkUtils.get_link_href(details, 'content') end |
Instance Attribute Details
#instance ⇒ CacheServerNodeInstance (readonly)
Returns the disk store’s cache server node instance.
36 37 38 |
# File 'lib/vas/gemfire/disk_stores.rb', line 36 def instance @instance end |
#name ⇒ String (readonly)
Returns the name of the disk store.
33 34 35 |
# File 'lib/vas/gemfire/disk_stores.rb', line 33 def name @name end |
Instance Method Details
#content {|chunk| ... } ⇒ void
This method returns an undefined value.
Retrieves the disk store’s content
52 53 54 |
# File 'lib/vas/gemfire/disk_stores.rb', line 52 def content(&block) client.get_stream(@content_location, &block) end |
#last_modified ⇒ Integer
Returns the last modified stamp of the disk store.
62 63 64 |
# File 'lib/vas/gemfire/disk_stores.rb', line 62 def last_modified client.get(location)['last-modified'] end |
#size ⇒ Integer
Returns the size of the disk store.
57 58 59 |
# File 'lib/vas/gemfire/disk_stores.rb', line 57 def size client.get(location)['size'] end |
#to_s ⇒ String
Returns a string representation of the disk store.
67 68 69 |
# File 'lib/vas/gemfire/disk_stores.rb', line 67 def to_s "#<#{self.class} name='#@name'>" end |