Class: Infinispan::RemoteCache
- Inherits:
-
Object
- Object
- Infinispan::RemoteCache
- Includes:
- Constants
- Defined in:
- lib/infinispan-ruby-client/remotecache.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#name ⇒ Object
Returns the value of attribute name.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
- #clear ⇒ Object
- #contains_key?(key) ⇒ Boolean (also: #contains_key)
- #get(key) ⇒ Object
- #get_bulk(count = 0) ⇒ Object
- #get_versioned(key) ⇒ Object
-
#initialize(host = "localhost", port = 11222, name = "") ⇒ RemoteCache
constructor
A new instance of RemoteCache.
- #ping ⇒ Object
- #put(key, value) ⇒ Object
- #put_if_absent(key, value) ⇒ Object
- #remove(key) ⇒ Object
- #remove_if_unmodified(key, version) ⇒ Object
- #replace(key, value) ⇒ Object
- #replace_if_unmodified(key, version, value) ⇒ Object
Constructor Details
#initialize(host = "localhost", port = 11222, name = "") ⇒ RemoteCache
Returns a new instance of RemoteCache.
25 26 27 28 29 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 25 def initialize( host="localhost", port=11222, name="" ) @host = host @port = port @name = name end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
23 24 25 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 23 def host @host end |
#name ⇒ Object
Returns the value of attribute name.
23 24 25 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 23 def name @name end |
#port ⇒ Object
Returns the value of attribute port.
23 24 25 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 23 def port @port end |
Instance Method Details
#clear ⇒ Object
35 36 37 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 35 def clear do_op( :operation => CLEAR[0] ) end |
#contains_key?(key) ⇒ Boolean Also known as: contains_key
59 60 61 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 59 def contains_key?( key ) do_op( :operation => CONTAINS[0], :key => key ) end |
#get(key) ⇒ Object
39 40 41 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 39 def get( key ) do_op( :operation => GET[0], :key => key ) end |
#get_bulk(count = 0) ⇒ Object
43 44 45 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 43 def get_bulk( count = 0 ) do_op( :operation => BULK_GET[0], :count => count ) end |
#get_versioned(key) ⇒ Object
55 56 57 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 55 def get_versioned( key ) do_op( :operation => GET_WITH_VERSION[0], :key => key ) end |
#ping ⇒ Object
31 32 33 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 31 def ping do_op( :operation => PING[0] ) end |
#put(key, value) ⇒ Object
47 48 49 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 47 def put( key, value ) do_op( :operation => PUT[0], :key => key, :value => value ) end |
#put_if_absent(key, value) ⇒ Object
51 52 53 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 51 def put_if_absent( key, value ) do_op( :operation => PUT_IF_ABSENT[0], :key => key, :value => value ) end |
#remove(key) ⇒ Object
65 66 67 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 65 def remove( key ) do_op( :operation => REMOVE[0], :key => key ) end |
#remove_if_unmodified(key, version) ⇒ Object
69 70 71 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 69 def remove_if_unmodified( key, version ) do_op( :operation => REMOVE_IF[0], :key => key, :version => version ) end |
#replace(key, value) ⇒ Object
73 74 75 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 73 def replace( key, value ) do_op( :operation => REPLACE[0], :key => key, :value => value ) end |
#replace_if_unmodified(key, version, value) ⇒ Object
77 78 79 |
# File 'lib/infinispan-ruby-client/remotecache.rb', line 77 def replace_if_unmodified( key, version, value ) do_op( :operation => REPLACE_IF[0], :key => key, :value => value, :version => version ) end |