Class: Gemfire::DiskStore

Inherits:
Shared::Resource show all
Defined in:
lib/vas/gemfire/disk_stores.rb

Instance Attribute Summary collapse

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Constructor Details

#initialize(location, client) ⇒ DiskStore

Returns a new instance of DiskStore.



42
43
44
45
46
47
48
49
50
# File 'lib/vas/gemfire/disk_stores.rb', line 42

def initialize(location, client)
  super(location, client)

  @last_modified = details['last-modified']
  @name = details['name']
  @size = details['size']
  @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 ⇒ Object (readonly)

The disk store's cache server node instance



40
41
42
# File 'lib/vas/gemfire/disk_stores.rb', line 40

def instance
  @instance
end

#last_modified ⇒ Object (readonly)

The last modified time of the disk store



31
32
33
# File 'lib/vas/gemfire/disk_stores.rb', line 31

def last_modified
  @last_modified
end

#name ⇒ Object (readonly)

The name of the disk store



34
35
36
# File 'lib/vas/gemfire/disk_stores.rb', line 34

def name
  @name
end

#size ⇒ Object (readonly)

The size of the disk store



37
38
39
# File 'lib/vas/gemfire/disk_stores.rb', line 37

def size
  @size
end

Instance Method Details

#content(&block) ⇒ Object

Retrieves the disk store's content and passes it to the block



53
54
55
# File 'lib/vas/gemfire/disk_stores.rb', line 53

def content(&block)
  client.get_stream(@content_location, &block)
end

#to_s ⇒ Object



57
58
59
# File 'lib/vas/gemfire/disk_stores.rb', line 57

def to_s
  "#<#{self.class} name='#@name'>"
end