com.apama.config
Event ConfigurationStoreInterface


Abstract interface to a configuration store.

The store is a collection of tables, accessed through an in-memory cache and optionally persisted to a configurable back-end such as the Apama Memory Store or a relation database accessed through the Apama ADBC adapter.

An instance of the store interface is obtained by calling an action, typically getInterface(), on a concrete configuration service object such as a #MemoryStoreConfigurationStore. Once the interface has been created, access to the store uses the same API regardless of the back-end.

Some actions on the store interface (#init(), #createTable()) are asynchronous and signal their success or failure through callback actions. All such actions take an integer request id as their first parameter. This id will be passed back as the first argument to the callback, to allow the callback to distinguish between multiple overlapping requests. Request ids must be unique across all possible invocations of the callback, in the current context. Ids returned by the integer.getUnique() method will always be sufficiently unique, although it may be possible to use a less unique id that is cheaper to generate, depending on the application.

Default callback implementations are provided for applications that do not need to implement custom success/failure handling or that prefer to listen for success/failure notifications rather than using callbacks directly. The default callbacks simply route an event containing the parameters that were passed to the callback.

Calling any action except #init() on a store interface that has not been successfully initialised will lead to undefined behaviour. Likewise, the result of calling #init() more than once on the same store interface is
Member summary
 action<integer, action<integer>, action<integer, string>>init

Initialise the configuration store back-end and load all persistent tables into the in-memory cache.
 action<integer, action<integer>, action<integer, string>>initInMemoryStore

Initialise the configuration store back-end.
 action<string> returns booleanhasTable

Check whether the store contains the given table.
 action<string> returns com.apama.config.SchemagetSchema

Get the schema used by the given table. The result is undefined if the table does not exist.
 action<string> returns com.apama.config.ConfigurationTableInterfacegetTable

Get an interface to the given table. The result is undefined if the table does not exist.
 action<integer, com.apama.config.Schema, action<integer, com.apama.config.ConfigurationTableInterface>, action<integer, string>>createTable

Create a new table in the store. The result of calling this action if the requested table already exists is undefined.
 action<integer>initSuccess

Default onSuccess callback for the #init() action, if the application does not want to provide a custom callback.
 action<integer, com.apama.config.ConfigurationTableInterface>createTableSuccess

Default onSuccess callback for the #createTable() action, if the application does not want to provide a custom callback.
 action<integer, string>defaultError

Default onError callback for all asynchronous actions provided by the #ConfigurationStoreInterface, if the application does not want to provide a custom callback.
 
Member detail

createTable

            action<integer, com.apama.config.Schema, action<integer, com.apama.config.ConfigurationTableInterface>, action<integer, string>> createTable
        
Create a new table in the store. The result of calling this action if the requested table already exists is undefined.

createTableSuccess

            action<integer, com.apama.config.ConfigurationTableInterfacecreateTableSuccess
        
Default onSuccess callback for the #createTable() action, if the application does not want to provide a custom callback.

The default callback simply routes a #StoreCreateTableSuccess event. To use the default callback, pass storeInterface.createTableSuccess as the onSuccess parameter to the #createTable() action.

Note that the #ConfigurationTableInterface event returned by a successful call to #createTable() is not routeable as it contains a chunk variable. Therefore users of this default callback will need to call #getTable() to get an interface to the newly created table.
See Also:
com.apama.config.ConfigurationStoreInterface#createTable - 

defaultError

            action<integer, string> defaultError
        
Default onError callback for all asynchronous actions provided by the #ConfigurationStoreInterface, if the application does not want to provide a custom callback.

The default callback simply routes a #StoreRequestFailure event. To use the default callback, pass storeInterface.defaultError as the onError parameter to the request.
See Also:
com.apama.config.ConfigurationStoreInterface#init - 
com.apama.config.ConfigurationStoreInterface#createTable - 

getSchema

            action<string> returns com.apama.config.Schema getSchema
        
Get the schema used by the given table. The result is undefined if the table does not exist.

getTable

            action<string> returns com.apama.config.ConfigurationTableInterface getTable
        
Get an interface to the given table. The result is undefined if the table does not exist.

hasTable

            action<string> returns boolean hasTable
        
Check whether the store contains the given table.

init

            action<integer, action<integer>, action<integer, string>> init
        
Initialise the configuration store back-end and load all persistent tables into the in-memory cache.

initInMemoryStore

            action<integer, action<integer>, action<integer, string>> initInMemoryStore
        
Initialise the configuration store back-end.

initSuccess

            action<integer> initSuccess
        
Default onSuccess callback for the #init() action, if the application does not want to provide a custom callback.

The default action simply routes a #StoreInitSuccess event. To use the default callback, pass storeInterface.initSuccess as the onSuccess parameter to the #init() action.
See Also:
com.apama.config.ConfigurationStoreInterface#init -