public class RSEPRCache
extends java.lang.Object
Constructor and Description |
---|
RSEPRCache(GCUBESecurityManager sman,
GCUBEScope sc)
Default constructor of RSEPRCache that should be used by gCube components that are not exposed as services.
|
RSEPRCache(GCUBEServiceContext sctx)
Default constructor of RSEPRCache that should be used by gCube services.
|
RSEPRCache(GCUBEServiceContext sctx,
long ttl,
long tti,
int maxElementsInMemory)
Constructor of RSEPRCache that takes configuration parameters and creates a new cache with
this configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object query,
java.lang.String rsEpr)
Adds a pair of query-RS EPR to the given cache
|
java.lang.String |
get(java.lang.Object query)
Retrieves a ResultSet EPR given the query that produced the ResultSet
|
int |
size()
Size of the cache used
|
public RSEPRCache(GCUBESecurityManager sman, GCUBEScope sc) throws java.lang.Exception
sman
- a security manager that will be used to register to the notifications topicsc
- the infrastructure scope of this scope will be used for subscribing to the topicjava.lang.Exception
public RSEPRCache(GCUBEServiceContext sctx) throws java.lang.Exception
sctx
- the context of the service that will be used to register to the notifications topicjava.lang.Exception
public RSEPRCache(GCUBEServiceContext sctx, long ttl, long tti, int maxElementsInMemory) throws java.lang.Exception
sctx
- the context of the service that will be used to register to the notifications topicttl
- the default amount of time to live for an element from its creation datetti
- the default amount of time to live for an element from its last accessed datemaxElementsInMemory
- the maximum number of elements in memory, before they are evictedjava.lang.Exception
public void add(java.lang.Object query, java.lang.String rsEpr) throws java.lang.Exception
query
- the key used to identify the added object in the cache. Equality is examined using the equals() method that is defined in the class of the query objectrsEpr
- the corresponding RS EPR for the results produced by the queryjava.lang.Exception
public java.lang.String get(java.lang.Object query)
query
- the query that produced the ResultSet. Equality is examined using the equals() method that is defined in the class of the query objectpublic int size()