Action<ConfEvent>
, Subscriber<ConfEvent>
DefaultConfCache
public interface IConfCache extends Subscriber<ConfEvent>
Modifier and Type | Method | Description |
---|---|---|
void |
add(ICfgObject obj) |
Adds a new configuration object to the cache.
|
java.util.concurrent.Future<IConfCache> |
beginRefresh(AsyncInvoker asyncInvoker,
Action<java.util.concurrent.Future<IConfCache>> finishCallback) |
Asynchronously updates all configuration objects in the cache.
|
void |
clear() |
Removes all cache contents.
|
boolean |
contains(ICfgObject obj) |
Determines whether the cache contains the specified object.
|
void |
deserialize(javax.xml.transform.Source source) |
Deserializes the cache from the specified source.
|
void |
endRefresh(java.util.concurrent.Future<IConfCache> asyncResult) |
To be called when the asynchronous refresh operation is complete.
|
IConfCachePolicy |
getPolicy() |
Returns the current policy associated with this cache.
|
void |
refresh() |
Synchronously updates all configuration objects which are currently in the cache.
|
void |
remove(ICfgObject obj) |
Removes the specified configuration object from the cache.
|
void |
remove(CfgObjectType type,
int dbid) |
Removes the configuration object with the specified type and dbid
from the cache.
|
<T extends ICfgObject> |
retrieve(java.lang.Class<T> cls,
ICfgQuery query) |
Retrieves a configuration object from the cache.
|
<T extends ICfgObject> |
retrieve(java.lang.Class<T> cls,
CfgObjectType type,
int dbid) |
Retrieves a configuration object from the cache.
|
<T extends ICfgObject> |
retrieveMultiple(java.lang.Class<T> cls) |
Retrieves an enumerable list of objects from the cache.
|
<T extends ICfgObject> |
retrieveMultiple(java.lang.Class<T> cls,
ICfgQuery query) |
Retrieves an enumerable list of objects from the cache.
|
void |
serialize(javax.xml.transform.Result result) |
Serializes the cache to the specified result.
|
void |
update(ICfgObject obj) |
Overwrites a configuration object which already exists in the cache
with a new copy.
|
getFilter
void add(ICfgObject obj)
obj
- A configuration objectvoid update(ICfgObject obj)
obj
- A configuration objectvoid remove(ICfgObject obj)
obj
- A configuration objectvoid remove(CfgObjectType type, int dbid)
type
- The type of configuration objectdbid
- The dbid of the configuration objectvoid clear()
<T extends ICfgObject> T retrieve(java.lang.Class<T> cls, CfgObjectType type, int dbid)
T
- The type of configuration object that should be returnedcls
- class of object to be retrievedtype
- The type of configuration objectdbid
- The dbid of the configuration object<T extends ICfgObject> T retrieve(java.lang.Class<T> cls, ICfgQuery query)
T
- The type of configuration object that should be returnedcls
- class of object to be retrievedquery
- A query based on which the result is obtained<T extends ICfgObject> java.lang.Iterable<T> retrieveMultiple(java.lang.Class<T> cls, ICfgQuery query)
T
- The types of configuration objects to be included in the list.cls
- class of objects to be retrievedquery
- A query based on which the result is obtained<T extends ICfgObject> java.lang.Iterable<T> retrieveMultiple(java.lang.Class<T> cls)
T
- The types of configuration objects to be included in the list.cls
- class of objects to be retrievedboolean contains(ICfgObject obj)
obj
- The configuration object to look forvoid serialize(javax.xml.transform.Result result)
result
- The result into which the cache is to be writtenStreamResult
,
DOMResult
void deserialize(javax.xml.transform.Source source)
source
- The source from which the cache is to be readStreamSource
,
DOMSource
void refresh() throws ConfigException, java.lang.InterruptedException
ConfigException
- is thrown in case of object(s) reload exceptionjava.lang.InterruptedException
- is thrown in case of working thread interruptedjava.util.concurrent.Future<IConfCache> beginRefresh(AsyncInvoker asyncInvoker, Action<java.util.concurrent.Future<IConfCache>> finishCallback)
AsyncInvoker invoker =
new SingleThreadInvoker("CacheAsyncRefresh");
Future asyncRefresh =
cache.beginRefresh(invoker, null);
// DO SOMETHING...
// To check that refresh is done:
if (asyncRefresh.isDone()) {
// ...
}
// To wait for refresh is done:
asyncRefresh.get();
// After refresh is done and invoker is not needed:
invoker.dispose();
asyncInvoker
- invoker for refresh task executionfinishCallback
- The callback method to be invoked when the operation completesvoid endRefresh(java.util.concurrent.Future<IConfCache> asyncResult)
asyncResult
- The async result associated with the current operationIConfCachePolicy getPolicy()
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.