com.apama.config
Event ConfigurationRowHelper
Helper object intended to be used by "wrapper" events mapped to rows in a configuration service table.
The helper manages all of the interactions with the underlying configuration store and calls back into the application to update the wrapper object's view of the row values or to commit new row values from the wrapper object back to the configuration store.
getKey
string getKey()
Get the Memory Store key for the row.
-
Returns:
- The key.
getRow
com.apama.memorystore.Row getRow()
Get the underlying row. This action can be used to allow the application to delete the row, for example.
-
Returns:
- The underlying Memory Store row.
initialiseFromRow
boolean initialiseFromRow(com.apama.config.ConfigurationTableInterface itable, com.apama.memorystore.Row row, com.apama.config.ConfigurationRowHelperCallbacks callbacks)
Initialise the helper from a pre-existing row.
This initialisation method is typically used when constructing wrapper objects for each row after a table has been loaded. The application-supplied #getData() action will be called to update the wrapper object's view of the row values.
-
Parameters:
-
itable - The configuration table.
-
row - The table row.
-
callbacks - Callback actions for this helper instance.
-
Returns:
- True if the helper was successfully initialised.
initialiseFromValues
integer initialiseFromValues(com.apama.config.ConfigurationTableInterface itable, sequence<string > indices, com.apama.config.ConfigurationRowHelperCallbacks callbacks)
Initialise the helper from a known set of values supplied by the application.
This assumes that the row does not already exist in the configuration table. The application-supplied #setData() action will be called to update the row values. Updating the table is an asynchronous operation, so this actions returns a request id that will be passed to the application-supplied success or failure callback depending on the outcome of the operation.
-
Parameters:
-
itable - The configuration table.
-
indices - Index field values used to generate the row key.
-
callbacks - Callback actions for this helper instance.
-
Returns:
- Request id that will be passed to the #ConfigurationRowHelperCallbacks.onUpdateSuccess() #ConfigurationRowHelperCallbacks.onError() callback action.
updateRow
boolean updateRow(integer id)
Update the row in the configuration table. The application-supplied #setData() action will be called to update the row values.
Updating the underlying table is an asynchronous operation so the application should expect one of the #onUpdateSuccess() or #onError() actions to be called to indicate the success or failure of the update.
-
Parameters:
-
id - Request id to be passed back to the success or failure callback action.
-
Returns:
- True if the table update was attempted and a callback should be expected, false if the operation failed before attempting to update the underlying table, in which case there will be no callback.