Class: Gemfire::DiskStore
- Inherits:
-
Shared::Resource
- Object
- Shared::Resource
- Gemfire::DiskStore
- Includes:
- Shared::Deletable
- Defined in:
- lib/vas/gemfire/disk_stores.rb
Overview
A disk store in a cache server node instance
Instance Attribute Summary collapse
-
#last_modified ⇒ Integer
readonly
The last modified stamp of the disk store.
-
#name ⇒ String
readonly
The name of the disk store.
-
#size ⇒ Integer
readonly
The size of the disk store.
Attributes included from Shared::Deletable
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.
-
#instance ⇒ CacheServerNodeInstance
The disk store’s cache server node instance.
-
#reload ⇒ Object
Reloads the disk store’s details from the server.
-
#to_s ⇒ String
A string representation of the disk store.
Methods included from Shared::Deletable
Constructor Details
#initialize(location, client) ⇒ DiskStore
Returns a new instance of DiskStore.
44 45 46 47 48 49 50 51 |
# File 'lib/vas/gemfire/disk_stores.rb', line 44 def initialize(location, client) super(location, client) @name = details['name'] @instance_location = Util::LinkUtils.get_link_href(details, 'cache-server-node-instance') @content_location = Util::LinkUtils.get_link_href(details, 'content') end |
Instance Attribute Details
#last_modified ⇒ Integer (readonly)
Returns the last modified stamp of the disk store.
41 42 43 |
# File 'lib/vas/gemfire/disk_stores.rb', line 41 def last_modified @last_modified end |
#name ⇒ String (readonly)
Returns the name of the disk store.
35 36 37 |
# File 'lib/vas/gemfire/disk_stores.rb', line 35 def name @name end |
#size ⇒ Integer (readonly)
Returns the size of the disk store.
38 39 40 |
# File 'lib/vas/gemfire/disk_stores.rb', line 38 def size @size end |
Instance Method Details
#content {|chunk| ... } ⇒ void
This method returns an undefined value.
Retrieves the disk store’s content
58 59 60 |
# File 'lib/vas/gemfire/disk_stores.rb', line 58 def content(&block) client.get_stream(@content_location, &block) end |
#instance ⇒ CacheServerNodeInstance
Returns the disk store’s cache server node instance.
63 64 65 |
# File 'lib/vas/gemfire/disk_stores.rb', line 63 def instance @instance ||= CacheServerNodeInstance.new(@instance_location, client) end |
#reload ⇒ Object
Reloads the disk store’s details from the server
68 69 70 71 72 |
# File 'lib/vas/gemfire/disk_stores.rb', line 68 def reload super @size = details['size'] @last_modified = details['last-modified'] end |
#to_s ⇒ String
Returns a string representation of the disk store.
75 76 77 |
# File 'lib/vas/gemfire/disk_stores.rb', line 75 def to_s "#<#{self.class} name='#@name' size='#@size' last_modified='#@last_modified'>" end |