public class BesNodeCache
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NODE_CACHE_ELEMENT_NAME |
Modifier and Type | Method and Description |
---|---|
static void |
destroy()
Drops all references from the cache.
|
static void |
getNode(BesApi besApi,
java.lang.String key,
org.jdom.Document response)
The primary public method used to retrieve BES showNode command responses.
|
static void |
init(org.jdom.Element config)
Initialize the BesNodeCache using an XML Element.
|
static void |
init(int maxEntries,
long updateIntervalSeconds)
The _actual_ init method that sets up the cache.
|
static boolean |
isInitialized() |
static void |
main(java.lang.String[] args)
Simple test code to verify that the BesNodeCache works as expected.
|
public static final java.lang.String NODE_CACHE_ELEMENT_NAME
public static void init(org.jdom.Element config) throws BadConfigurationException
config
- The NODE_CACHE_ELEMENT_NAME configuration elementBadConfigurationException
- When the configuration is broken.public static void init(int maxEntries, long updateIntervalSeconds)
maxEntries
- The maximum number of entries in the cacheupdateIntervalSeconds
- The time any object may reside in the cache
before it is removed.public static void getNode(BesApi besApi, java.lang.String key, org.jdom.Document response) throws org.jdom.JDOMException, BadConfigurationException, PPTException, java.io.IOException, BESError
besApi
- THe instance of BesApi to use when accessing the BES.key
- The name of the BES node to retrieve.response
- The Document into which the BES showNode response will
be placed.org.jdom.JDOMException
- When the response cannot be parsed.BadConfigurationException
- When this method is called and the
init(...) method has not been called.PPTException
- When there is a communication problem with the BES.java.io.IOException
- When there is a low-level communication (socket etc)
issue communicating with the BES, or when the passed value of "key" is
null.BESError
- When the BES response to the showNode command is a
BESError object.public static boolean isInitialized()
public static void destroy()
public static void main(java.lang.String[] args)
args
- Are ignored.