public class XmlaOlap4jNamedMemoryCache extends Object implements XmlaOlap4jCache
Implementation of the XMLA SOAP cache that places its cache entries in memory for later use. It is thread safe and at static class level.
It supports cache sharing through the Name property.
All parameters are optional.
XmlaOlap4jNamedMemoryCache.Property
Modifier and Type | Class and Description |
---|---|
static class |
XmlaOlap4jNamedMemoryCache.Mode
Defines the supported eviction modes.
|
static class |
XmlaOlap4jNamedMemoryCache.Property
Properties which will be considered for configuration.
|
Constructor and Description |
---|
XmlaOlap4jNamedMemoryCache()
Default constructor which instantiates the concurrent hash map.
|
Modifier and Type | Method and Description |
---|---|
void |
flushCache()
Tells the cache to flush all cached entries.
|
byte[] |
get(String id,
URL url,
byte[] request)
Fetches a SOAP response from the cache.
|
void |
put(String id,
URL url,
byte[] request,
byte[] response)
Adds a SOAP response to the cache.
|
String |
setParameters(Map<String,String> config,
Map<String,String> props)
Convenience method to receive custom properties.
|
public XmlaOlap4jNamedMemoryCache()
public String setParameters(Map<String,String> config, Map<String,String> props)
XmlaOlap4jCache
The XMLA driver takes cache properties as
"Cache.[property name]=[value]
" in its JDBC url. All those
properties should be striped of their "Cache.
" prefix and
sent to this method as the props parameter.
Also, the complete map of the current connection should be passed as the config parameter.
setParameters
in interface XmlaOlap4jCache
config
- The complete configuration parameters which were used to
create the current connection.props
- The properties received from the JDBC url.public byte[] get(String id, URL url, byte[] request) throws XmlaOlap4jInvalidStateException
XmlaOlap4jCache
get
in interface XmlaOlap4jCache
id
- The connection unique name which called this cache.url
- The URL where the SOAP message was sent.request
- The SOAP complete message.XmlaOlap4jInvalidStateException
public void put(String id, URL url, byte[] request, byte[] response) throws XmlaOlap4jInvalidStateException
XmlaOlap4jCache
put
in interface XmlaOlap4jCache
id
- The connection unique name which called this cache.url
- The URL of the SOAP endpoint.request
- The full SOAP message from which we want to cache its
response.response
- The response to cache.XmlaOlap4jInvalidStateException
public void flushCache()
XmlaOlap4jCache
flushCache
in interface XmlaOlap4jCache