Package org.olap4j.driver.xmla.cache
Interface XmlaOlap4jCache
- All Known Implementing Classes:
XmlaOlap4jNamedMemoryCache
public interface XmlaOlap4jCache
XMLA driver cache. Implementations will have to declare those methods.
The XMLA driver will call the cache before each SOAP request to see if it wasn't sent previously and if a SOAP response doesn't already exist in it.
Any implementations have to declare a constructor which takes a String as a parameter. This string value is the unique name of the connection which triggered the request.
- Author:
- Luc Boudreau
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Tells the cache to flush all cached entries.byte[]
Fetches a SOAP response from the cache.void
Adds a SOAP response to the cache.Convenience method to receive custom properties.
-
Method Details
-
get
Fetches a SOAP response from the cache. Returns null if there are no cached response corresponding to the SOAP message and the URL.- Parameters:
id
- The connection unique name which called this cache.url
- The URL where the SOAP message was sent.request
- The SOAP complete message.- Returns:
- The SOAP response, null if there are no corresponding response in the cache.
- Throws:
OlapException
- when operations to the cache are performed but it hasn't been initialized. Make sure you call the setParameters(Map, Map) method.
-
put
Adds a SOAP response to the cache. It has to be relative to the URL of the SOAP service.- Parameters:
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.- Throws:
OlapException
- when operations to the cache are performed but it hasn't been initialized. Make sure you call the setParameters(Map, Map) method.
-
flushCache
void flushCache()Tells the cache to flush all cached entries. -
setParameters
Convenience method to receive custom properties.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.
- Parameters:
config
- The complete configuration parameters which were used to create the current connection.props
- The properties received from the JDBC url.- Returns:
- Returns a string object which gives a reference id to the caller for future use. This id has to be passed along with any future get and put requests.
-