JBoss Data Grid HotRod C# Client  7.2.0
Public Member Functions | List of all members
Infinispan.HotRod.IRemoteCache< K, V > Interface Template Reference

Provides remote reference to a Hot Rod server/cluster. More...

Public Member Functions

string GetName ()
 Retrieves the name of the cache. More...
 
string GetVersion ()
 Retrieves the Infinispan version. More...
 
string GetProtocolVersion ()
 Returns the HotRod protocol version supported by this RemoteCache implementation. More...
 
ulong Size ()
 Retrieves the number of records of the cache. More...
 
bool IsEmpty ()
 Used to check whether the cache is empty or not. More...
 
ServerStatistics Stats ()
 Used to retreive statistical information about the remote cache. More...
 
Put (K key, V val, ulong lifespan, TimeUnit lifespanUnit)
 Insert a new entry into the cache with the specified lifetime. More...
 
Put (K key, V val, ulong lifespan, TimeUnit lifespanUnit, ulong maxIdleTime, TimeUnit maxIdleUnit)
 Insert a new entry into the cache with the specified lifetime and max idle time. More...
 
Put (K key, V val)
 Insert a new entry into the cache. More...
 
PutIfAbsent (K key, V val, ulong lifespan, TimeUnit lifespanUnit, ulong maxIdleTime, TimeUnit maxIdleUnit)
 If the specified key is absent inserts a new entry into the cache with the specified lifetime and max idle time. More...
 
PutIfAbsent (K key, V val, ulong lifespan, TimeUnit lifespanUnit)
 If the specified key is absent inserts a new entry into the cache with the specified lifetime. More...
 
PutIfAbsent (K key, V val)
 If the specified key is absent inserts a new entry into the cache. More...
 
void PutAll (IDictionary< K, V > map, ulong lifespan, TimeUnit lifespanUnit, ulong maxIdleTime, TimeUnit maxIdleUnit)
 Puts all the entries in the given map in the cache and for each entry sets lifespan and maxidle to the values provided. More...
 
void PutAll (IDictionary< K, V > map, ulong lifespan, TimeUnit lifespanUnit)
 Puts all the entries in the given map in the cache and for each entry sets lifespan to the value provided. More...
 
void PutAll (IDictionary< K, V > map)
 Puts all the entries in the given map in the cache. More...
 
Replace (K key, V val, ulong lifespan, TimeUnit lifespanUnit, ulong maxIdleTime, TimeUnit maxIdleUnit)
 Replaces an existing value with a new one with the specified lifetime and max idle time. More...
 
Replace (K key, V val, ulong lifespan, TimeUnit lifespanUnit)
 Replaces an existing value with a new one with the specified lifetime. More...
 
Replace (K key, V val)
 Replaces an existing value with a new value. More...
 
bool ContainsKey (K key)
 Checks whether the passes key exists in the cache. More...
 
bool ContainsValue (V val)
 Checks whether the passes value exists in the cache. More...
 
Get (K key)
 Retrieve from the cache the value associated with the given key. More...
 
IDictionary< K, V > GetAll (ISet< K > keySet)
 Retrieve from the cache the values associated with the given key set. More...
 
IDictionary< K, V > GetBulk (int size)
 Bulk get operations, returns the entries within the remote cache limiting the returned set of values to the specified size. No ordering is guaranteed, and there is no guarantee that "size" elements are returned (e.g. if the number of elements in the back-end server is smaller that "size") More...
 
IDictionary< K, V > GetBulk ()
 Bulk get operations, returns all the entries within the remote cache. More...
 
Remove (K key)
 Removes from the cache the value associated with the given key. More...
 
void Clear ()
 Clears the cache. More...
 
IVersionedValue< V > GetVersioned (K key)
 Returns the VersionedValue associated to the supplied key param, or null if it doesn't exist. More...
 
IMetadataValue< V > GetWithMetadata (K key)
 Returns the MetadataValue associated to the supplied key param, or null if it doesn't exist. More...
 
bool RemoveWithVersion (K key, ulong version)
 Removes the given value only if its version matches the supplied version. More...
 
bool ReplaceWithVersion (K key, V val, ulong version, ulong lifespan, ulong maxIdleTime)
 Replaces the given value only if its version matches the supplied version. More...
 
bool ReplaceWithVersion (K key, V val, ulong version, ulong lifespan)
 Replaces the given value only if its version matches the supplied version. More...
 
bool ReplaceWithVersion (K key, V val, ulong version)
 Replaces the given value only if its version matches the supplied version. More...
 
ISet< KeyValuePair< K, V > > EntrySet ()
 Returns the set of entries present in the cache. More...
 
ISet< K > KeySet ()
 Returns the set of keys present in the cache. More...
 
IList< V > Values ()
 Returns the set of values present in the cache. More...
 
IRemoteCache< K, V > WithFlags (Flags flags)
 Applies one or more flags to the scope of a single invocation. More...
 
QueryResponse Query (QueryRequest query)
 Query the cache More...
 
object Execute (String scriptName, IDictionary< String, Object > dict=null)
 Execute a script on the server More...
 
Task< V > GetAsync (K key)
 Async version of the Get method More...
 
Task< V > PutAsync (K key, V val, ulong lifespan=0, TimeUnit lifespanUnit=TimeUnit.MILLISECONDS, ulong maxIdleTime=0, TimeUnit maxIdleUnit=TimeUnit.MILLISECONDS)
 Async version of the Put method More...
 
Task PutAllAsync (IDictionary< K, V > map, ulong lifespan=0, TimeUnit lifespanUnit=TimeUnit.MILLISECONDS, ulong maxIdleTime=0, TimeUnit maxIdleUnit=TimeUnit.MILLISECONDS)
 Async version of the PutAll method More...
 
Task< V > PutIfAbsentAsync (K key, V val, ulong lifespan=0, TimeUnit lifespanUnit=TimeUnit.MILLISECONDS, ulong maxIdleTime=0, TimeUnit maxIdleUnit=TimeUnit.MILLISECONDS)
 Async version of the PutIfAbsent method More...
 
Task< V > ReplaceAsync (K key, V val, ulong lifespan=0, TimeUnit lifespanUnit=TimeUnit.MILLISECONDS, ulong maxIdleTime=0, TimeUnit maxIdleUnit=TimeUnit.MILLISECONDS)
 Async version of the Replace method More...
 
Task< V > RemoveAsync (K key)
 Async version of the Replace method More...
 
Task ClearAsync ()
 Async version of the Clear method More...
 
Task< bool > ReplaceWithVersionAsync (K key, V val, ulong version, ulong lifespan=0, ulong maxIdleTime=0)
 Async version of the ReplaceWithVersion method More...
 
Task< bool > RemoveWithVersionAsync (K key, ulong version)
 Async version of the RemoveWithVersion method More...
 
void AddClientListener (Event.ClientListener< K, V > cl, string[] filterFactoryParams, string[] converterFactoryParams, Action recoveryCallback)
 
void AddContinuousQueryListener< CQK, CQV > (Event.ContinuousQueryListener< CQK, CQV > cql)
 Register a continuous query listener on the server More...
 
void RemoveClientListener (Event.ClientListener< K, V > cl)
 
void RemoveContinuousQueryListener< CQK, CQV > (Event.ContinuousQueryListener< CQK, CQV > cql)
 Unregister a continuous query listener from the server More...
 

Detailed Description

Provides remote reference to a Hot Rod server/cluster.

Concurrency: implementors of this interface will support multi-threaded access.

Return values: previously existing values for certain operations are not returned, null is returned instead.

Synthetic operations: aggregate operations are being implemented based on other Hot Rod operations. E.g. GetBulk is implemented through multiple individual gets. This means that the these operations are not atomic and that they are costly since the number of network round-trips is not one.

changing default behavior through Flags: it is possible to change the default cache behaviour by using flags.

IRemoteCache cache = getRemoteCache(true); //passing true will enable Force Return Values
Object oldValue = cache.Put(aKey, aValue);

In the previous example, using ForceRetunValue will make the client to also return previously existing value associated with "aKey". If this flag would not be present, Infinispan would return (by default) null. This is in order to avoid fetching a possibly large object from the remote server, which might not be needed.

Eviction and expiration: Unlike local cache, which allows specifying time values with any granularity, HotRod only supports seconds as time units. When using .NET Hotrod Client library, you can use milliseconds also but it will result in loss of precision for values specified as nanos or milliseconds. Another fundamental difference is in the case of lifespan (naturally does NOT apply for max idle): If number of seconds is bigger than 30 days, this number of seconds is treated as UNIX time and so, represents the number of seconds since 1/1/1970. Passing 0 as maxIdle and lifeSpan (which are also default values) these values are set to infinity.

Member Function Documentation

void Infinispan.HotRod.IRemoteCache< K, V >.AddClientListener ( Event.ClientListener< K, V >  cl,
string[]  filterFactoryParams,
string[]  converterFactoryParams,
Action  recoveryCallback 
)

Parameters
cl
filterFactoryParams
converterFactoryParams
recoveryCallback
void Infinispan.HotRod.IRemoteCache< K, V >.AddContinuousQueryListener< CQK, CQV > ( Event.ContinuousQueryListener< CQK, CQV >  cql)

Register a continuous query listener on the server

Parameters
cqlThe listener to be installed
void Infinispan.HotRod.IRemoteCache< K, V >.Clear ( )

Clears the cache.

Task Infinispan.HotRod.IRemoteCache< K, V >.ClearAsync ( )

Async version of the Clear method

Clear()

bool Infinispan.HotRod.IRemoteCache< K, V >.ContainsKey ( key)

Checks whether the passes key exists in the cache.

Parameters
keykey
Returns
true if the passed key exists and false if it doesn't.
bool Infinispan.HotRod.IRemoteCache< K, V >.ContainsValue ( val)

Checks whether the passes value exists in the cache.

Parameters
valvalue
Returns
true if the passed value exists and false if it doesn't.
ISet<KeyValuePair<K, V> > Infinispan.HotRod.IRemoteCache< K, V >.EntrySet ( )

Returns the set of entries present in the cache.

Returns
a set with the key/value pairs present in the cache
object Infinispan.HotRod.IRemoteCache< K, V >.Execute ( String  scriptName,
IDictionary< String, Object >  dict = null 
)

Execute a script on the server

Parameters
scriptNamescript name
dictmap of the arguments
Returns
a stream of byte containing the result
V Infinispan.HotRod.IRemoteCache< K, V >.Get ( key)

Retrieve from the cache the value associated with the given key.

Parameters
keykey
Returns
the value associated with the key or null
IDictionary<K,V> Infinispan.HotRod.IRemoteCache< K, V >.GetAll ( ISet< K >  keySet)

Retrieve from the cache the values associated with the given key set.

Parameters
keySetthe key set
Returns
the value associated with the key set
Task<V> Infinispan.HotRod.IRemoteCache< K, V >.GetAsync ( key)

Async version of the Get method

Parameters
keykey
Returns
An instance of Task<V> that will contains the result of the Get

Get(K)

IDictionary<K, V> Infinispan.HotRod.IRemoteCache< K, V >.GetBulk ( int  size)

Bulk get operations, returns the entries within the remote cache limiting the returned set of values to the specified size. No ordering is guaranteed, and there is no guarantee that "size" elements are returned (e.g. if the number of elements in the back-end server is smaller that "size")

Parameters
sizelimit on the number of elements to be returned
Returns
dictionary with retrieved data
IDictionary<K, V> Infinispan.HotRod.IRemoteCache< K, V >.GetBulk ( )

Bulk get operations, returns all the entries within the remote cache.

Returns
dictionary with retrieved data
string Infinispan.HotRod.IRemoteCache< K, V >.GetName ( )

Retrieves the name of the cache.

Returns
the name of the cache
string Infinispan.HotRod.IRemoteCache< K, V >.GetProtocolVersion ( )

Returns the HotRod protocol version supported by this RemoteCache implementation.

Returns
a protocol version string
string Infinispan.HotRod.IRemoteCache< K, V >.GetVersion ( )

Retrieves the Infinispan version.

Returns
a version string
IVersionedValue<V> Infinispan.HotRod.IRemoteCache< K, V >.GetVersioned ( key)

Returns the VersionedValue associated to the supplied key param, or null if it doesn't exist.

Parameters
key
Returns
IVersionedValue associated to the supplied key param, or null if it doesn't exist.
IMetadataValue<V> Infinispan.HotRod.IRemoteCache< K, V >.GetWithMetadata ( key)

Returns the MetadataValue associated to the supplied key param, or null if it doesn't exist.

Parameters
keykey
Returns
IMetadataValue associated to the supplied key param, or null if it doesn't exist.
bool Infinispan.HotRod.IRemoteCache< K, V >.IsEmpty ( )

Used to check whether the cache is empty or not.

Returns
true if number of entries of the cache is zero
ISet<K> Infinispan.HotRod.IRemoteCache< K, V >.KeySet ( )

Returns the set of keys present in the cache.

Returns
a set with the keys present in the cache
V Infinispan.HotRod.IRemoteCache< K, V >.Put ( key,
val,
ulong  lifespan,
TimeUnit  lifespanUnit 
)

Insert a new entry into the cache with the specified lifetime.

Parameters
keykey
valvalue
lifespanlifespan in the specified time unit
lifespanUnitthe unit of time for lifespan
Returns
the value being replaced, or null if nothing is being replaced
V Infinispan.HotRod.IRemoteCache< K, V >.Put ( key,
val,
ulong  lifespan,
TimeUnit  lifespanUnit,
ulong  maxIdleTime,
TimeUnit  maxIdleUnit 
)

Insert a new entry into the cache with the specified lifetime and max idle time.

Parameters
keykey
valvalue
lifespanlifespan in the specified time unit
lifespanUnitthe unit of time for lifespan
maxIdleTimemaximum idle time in in the specified time unit
maxIdleUnitthe unit of time for maximum idle time
Returns
the value being replaced, or null if nothing is being replaced
V Infinispan.HotRod.IRemoteCache< K, V >.Put ( key,
val 
)

Insert a new entry into the cache.

Parameters
keykey
valvalue
Returns
the value being replaced, or null if nothing is being replaced
void Infinispan.HotRod.IRemoteCache< K, V >.PutAll ( IDictionary< K, V >  map,
ulong  lifespan,
TimeUnit  lifespanUnit,
ulong  maxIdleTime,
TimeUnit  maxIdleUnit 
)

Puts all the entries in the given map in the cache and for each entry sets lifespan and maxidle to the values provided.

Parameters
mapthe entries to add
lifespanlifespan in the specified time unit
lifespanUnitthe unit of time for lifespan
maxIdleTimemaximum idle time in in the specified time unit
maxIdleUnitthe unit of time for maximum idle time
void Infinispan.HotRod.IRemoteCache< K, V >.PutAll ( IDictionary< K, V >  map,
ulong  lifespan,
TimeUnit  lifespanUnit 
)

Puts all the entries in the given map in the cache and for each entry sets lifespan to the value provided.

Parameters
mapthe entries to add
lifespanlifespan in the specified time unit
lifespanUnitthe unit of time for lifespan
void Infinispan.HotRod.IRemoteCache< K, V >.PutAll ( IDictionary< K, V >  map)

Puts all the entries in the given map in the cache.

Parameters
mapthe entries to add
Task Infinispan.HotRod.IRemoteCache< K, V >.PutAllAsync ( IDictionary< K, V >  map,
ulong  lifespan = 0,
TimeUnit  lifespanUnit = TimeUnit.MILLISECONDS,
ulong  maxIdleTime = 0,
TimeUnit  maxIdleUnit = TimeUnit.MILLISECONDS 
)

Async version of the PutAll method

Parameters
mapthe entries to add
lifespanlifespan in the specified time unit
lifespanUnitthe unit of time for lifespan
maxIdleTimemaximum idle time in in the specified time unit
maxIdleUnitthe unit of time for maximum idle time
Returns
An instance of Task related to the PutAll operation

PutAll(IDictionary<K, V>, ulong, TimeUnit, ulong, TimeUnit)

Task<V> Infinispan.HotRod.IRemoteCache< K, V >.PutAsync ( key,
val,
ulong  lifespan = 0,
TimeUnit  lifespanUnit = TimeUnit.MILLISECONDS,
ulong  maxIdleTime = 0,
TimeUnit  maxIdleUnit = TimeUnit.MILLISECONDS 
)

Async version of the Put method

Parameters
keykey
valvalue
lifespanlifespan in the specified time unit
lifespanUnitthe unit of time for lifespan
maxIdleTimemaximum idle time in in the specified time unit
maxIdleUnitthe unit of time for maximum idle time
Returns
An instance of Task<V> that will contains the result of the Put

Put(K, V, ulong, TimeUnit, ulong, TimeUnit)

V Infinispan.HotRod.IRemoteCache< K, V >.PutIfAbsent ( key,
val,
ulong  lifespan,
TimeUnit  lifespanUnit,
ulong  maxIdleTime,
TimeUnit  maxIdleUnit 
)

If the specified key is absent inserts a new entry into the cache with the specified lifetime and max idle time.

Parameters
keykey
valvalue
lifespanlifespan in the specified time unit
lifespanUnitthe unit of time for lifespan
maxIdleTimemaximum idle time in in the specified time unit
maxIdleUnitthe unit of time for maximum idle time
Returns
the value being replaced, or null if nothing is being replaced
V Infinispan.HotRod.IRemoteCache< K, V >.PutIfAbsent ( key,
val,
ulong  lifespan,
TimeUnit  lifespanUnit 
)

If the specified key is absent inserts a new entry into the cache with the specified lifetime.

Parameters
keykey
valvalue
lifespanlifespan in the specified time unit
lifespanUnitthe unit of time for lifespan
Returns
the value being replaced, or null if nothing is being replaced
V Infinispan.HotRod.IRemoteCache< K, V >.PutIfAbsent ( key,
val 
)

If the specified key is absent inserts a new entry into the cache.

Parameters
keykey
valvalue
Returns
the value being replaced, or null if nothing is being replaced
Task<V> Infinispan.HotRod.IRemoteCache< K, V >.PutIfAbsentAsync ( key,
val,
ulong  lifespan = 0,
TimeUnit  lifespanUnit = TimeUnit.MILLISECONDS,
ulong  maxIdleTime = 0,
TimeUnit  maxIdleUnit = TimeUnit.MILLISECONDS 
)

Async version of the PutIfAbsent method

Parameters
keykey
valvalue
lifespanlifespan in the specified time unit
lifespanUnitthe unit of time for lifespan
maxIdleTimemaximum idle time in in the specified time unit
maxIdleUnitthe unit of time for maximum idle time
Returns
An instance of Task<V> that will contains the result of the PutIfAbsent

PutIfAbsentAsync(K, V, ulong, TimeUnit, ulong, TimeUnit)

QueryResponse Infinispan.HotRod.IRemoteCache< K, V >.Query ( QueryRequest  query)

Query the cache

Parameters
querythe query sring
Returns
A query response containing the result set

QueryRequest qReq = new QueryResponse(); qReq.QueryString="from sample_bank_account.User"; QueryResponse qRes= remoteCache.query(qReq);

V Infinispan.HotRod.IRemoteCache< K, V >.Remove ( key)

Removes from the cache the value associated with the given key.

Parameters
keyKey
Returns
the removed value or null
Task<V> Infinispan.HotRod.IRemoteCache< K, V >.RemoveAsync ( key)

Async version of the Replace method

Parameters
keykey
Returns
An instance of Task<V> that will contains the result of the Remove

Remove(K)

void Infinispan.HotRod.IRemoteCache< K, V >.RemoveClientListener ( Event.ClientListener< K, V >  cl)

Parameters
clClientListener to be removed
void Infinispan.HotRod.IRemoteCache< K, V >.RemoveContinuousQueryListener< CQK, CQV > ( Event.ContinuousQueryListener< CQK, CQV >  cql)

Unregister a continuous query listener from the server

Parameters
cqlContinuousQueryListener to be removed
bool Infinispan.HotRod.IRemoteCache< K, V >.RemoveWithVersion ( key,
ulong  version 
)

Removes the given value only if its version matches the supplied version.

Parameters
keykey
versionversion numeric version that should match the one in the server for the operation to succeed
Returns
true if the entry was removed and false otherwise
Task<bool> Infinispan.HotRod.IRemoteCache< K, V >.RemoveWithVersionAsync ( key,
ulong  version 
)

Async version of the RemoveWithVersion method

Parameters
keykey
versionversion numeric version that should match the one in the server for the operation to succeed
Returns
An instance of Task<bool> that will contains the result of the Remove

RemoveWithVersion(K, ulong)

V Infinispan.HotRod.IRemoteCache< K, V >.Replace ( key,
val,
ulong  lifespan,
TimeUnit  lifespanUnit,
ulong  maxIdleTime,
TimeUnit  maxIdleUnit 
)

Replaces an existing value with a new one with the specified lifetime and max idle time.

Parameters
keykey
valvalue
lifespanlifespan in the specified time unit
lifespanUnitthe unit of time for lifespan
maxIdleTimemaximum idle time in in the specified time unit
maxIdleUnitthe unit of time for maximum idle time
Returns
the value being replaced, or null if nothing is being replaced
V Infinispan.HotRod.IRemoteCache< K, V >.Replace ( key,
val,
ulong  lifespan,
TimeUnit  lifespanUnit 
)

Replaces an existing value with a new one with the specified lifetime.

Parameters
keykey
valvalue
lifespanlifespan in the specified time unit
lifespanUnitthe unit of time for lifespan
Returns
the value being replaced, or null if nothing is being replaced
V Infinispan.HotRod.IRemoteCache< K, V >.Replace ( key,
val 
)

Replaces an existing value with a new value.

Parameters
keykey
valvalue
Returns
the value being replaced, or null if nothing is being replaced
Task<V> Infinispan.HotRod.IRemoteCache< K, V >.ReplaceAsync ( key,
val,
ulong  lifespan = 0,
TimeUnit  lifespanUnit = TimeUnit.MILLISECONDS,
ulong  maxIdleTime = 0,
TimeUnit  maxIdleUnit = TimeUnit.MILLISECONDS 
)

Async version of the Replace method

Parameters
keykey
valvalue
lifespanlifespan in the specified time unit
lifespanUnitthe unit of time for lifespan
maxIdleTimemaximum idle time in in the specified time unit
maxIdleUnitthe unit of time for maximum idle time
Returns
An instance of Task<V> that will contains the result of the Replace

Replace(K, V, ulong, TimeUnit, ulong, TimeUnit)

bool Infinispan.HotRod.IRemoteCache< K, V >.ReplaceWithVersion ( key,
val,
ulong  version,
ulong  lifespan,
ulong  maxIdleTime 
)

Replaces the given value only if its version matches the supplied version.

Parameters
keykey
valvalue
versionversion numeric version that should match the one in the server for the operation to succeed
lifespanthe lifespan of the new entry
maxIdleTimethe max idle time of the new entry
Returns
true if the value has been replaced and false otherwise
bool Infinispan.HotRod.IRemoteCache< K, V >.ReplaceWithVersion ( key,
val,
ulong  version,
ulong  lifespan 
)

Replaces the given value only if its version matches the supplied version.

Parameters
keykey
valvalue
versionversion numeric version that should match the one in the server for the operation to succeed
lifespanthe lifespan of the new entry
Returns
true if the value has been replaced and false otherwise
bool Infinispan.HotRod.IRemoteCache< K, V >.ReplaceWithVersion ( key,
val,
ulong  version 
)

Replaces the given value only if its version matches the supplied version.

Parameters
keykey
valvalue
versionversion numeric version that should match the one in the server for the operation to succeed
Returns
true if the value has been replaced and false otherwise
Task<bool> Infinispan.HotRod.IRemoteCache< K, V >.ReplaceWithVersionAsync ( key,
val,
ulong  version,
ulong  lifespan = 0,
ulong  maxIdleTime = 0 
)

Async version of the ReplaceWithVersion method

Parameters
keykey
valvalue
versionversion numeric version that should match the one in the server for the operation to succeed
lifespanthe lifespan of the new entry
maxIdleTimethe max idle time of the new entry
Returns
An instance of Task<bool> that will contains the result of the Remove

ReplaceWithVersion(K, V, ulong, ulong, ulong)

ulong Infinispan.HotRod.IRemoteCache< K, V >.Size ( )

Retrieves the number of records of the cache.

Used to retreive statistical information about the remote cache.

Returns
the server statistics
IList<V> Infinispan.HotRod.IRemoteCache< K, V >.Values ( )

Returns the set of values present in the cache.

Returns
a set with the values present in the cache
IRemoteCache<K, V> Infinispan.HotRod.IRemoteCache< K, V >.WithFlags ( Flags  flags)

Applies one or more flags to the scope of a single invocation.

Returns
the current IRemoteCache instance to continue running operations on

remoteCache.WithFlags(Flags.FORCE_RETURN_VALUE | Flags.DEFAULT_LIFETIME).put("hello", "world");


The documentation for this interface was generated from the following file: