Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
|
There is a single event engine instance reachable by a well known reference. More...
Classes | |
struct | Action |
An action is a tuple of 'id' (unique within the scope of this event engine), 'name' which is unique as well and used by the GUI as user readable identificator, 'isSystem' which denotes the action as system action, 'type' which defines what it is, and an argument vector that vary depending on type and which is passed to the action. More... | |
struct | Condition |
Condition is a logical combination of multiple events. More... | |
struct | EventDesc |
An event descriptor. More... | |
struct | Rule |
A Rule binds an action to a condition. More... | |
Public Member Functions | |
int | listEventDescs (in vector< string > eventIdPrefix, out vector< EventDesc > eventDescs) |
Query existing event descriptors. More... | |
vector< string > | listActionTypes () |
List all available action types. More... | |
int | addAction (in Action action, out string actionId) |
Add a new action. More... | |
int | modifyAction (in Action action) |
Modify an action. More... | |
int | deleteAction (in string actionId) |
Remove an action. More... | |
vector< Action > | listActions () |
List all actions currently know to this event engine. | |
int | triggerAction (in string actionId, out string errMsg, in vector< KeyValue > context) |
Trigger an action. More... | |
int | testAction (in Action action, out string errMsg, in vector< KeyValue > context) |
Test an action. More... | |
int | addRule (in Rule rule, out string ruleId) |
Add a new rule. More... | |
int | modifyRule (in Rule rule) |
Modify a rule. More... | |
int | enableRule (in string ruleId) |
Enable a rule. More... | |
int | disableRule (in string ruleId) |
Disable a rule. More... | |
int | deleteRule (in string ruleId) |
Delete a rule. More... | |
vector< Rule > | listRules () |
List all rules. More... | |
int | deliverEvent (in Event event) |
Deliver an event. More... | |
int | rearmRule (in string ruleId) |
Rearm an event rule that is active. More... | |
There is a single event engine instance reachable by a well known reference.
Definition at line 53 of file EventEngine.idl.
int event::Engine::addAction | ( | in Action | action, |
out string | actionId | ||
) |
Add a new action.
The id and isSystem fields are ignored. The actions's id field is allocated automatically and returned in the actionId parameter.
int event::Engine::addRule | ( | in Rule | rule, |
out string | ruleId | ||
) |
Add a new rule.
The id, hasMatched and isSystem fields are ignored. The rule's id field is allocated automatically and returned in the the ruleId parameter.
int event::Engine::deleteAction | ( | in string | actionId | ) |
Remove an action.
int event::Engine::deleteRule | ( | in string | ruleId | ) |
Delete a rule.
int event::Engine::deliverEvent | ( | in Event | event | ) |
Deliver an event.
int event::Engine::disableRule | ( | in string | ruleId | ) |
Disable a rule.
A disabled rule will be ignored when processing events.
int event::Engine::enableRule | ( | in string | ruleId | ) |
Enable a rule.
An enabled rule will be evaluated when processing events.
vector< string > event::Engine::listActionTypes | ( | ) |
List all available action types.
The action type is intentionally defined generically so that implementation can be extensible without changing interface.
int event::Engine::listEventDescs | ( | in vector< string > | eventIdPrefix, |
out vector< EventDesc > | eventDescs | ||
) |
Query existing event descriptors.
vector< Rule > event::Engine::listRules | ( | ) |
List all rules.
Question: will number of rules be small enough to list them all in a single operation. A single Rule may be quite large... See below for alternative interface using iterator.
int event::Engine::modifyAction | ( | in Action | action | ) |
Modify an action.
int event::Engine::modifyRule | ( | in Rule | rule | ) |
Modify a rule.
The hasMatched and isSystem fields are ignored.
int event::Engine::rearmRule | ( | in string | ruleId | ) |
Rearm an event rule that is active.
Once a Rule triggers its actions it is done once. If the condition of the rules becomes false and back again true, no action will be performed unless the rule is rearmed. Rules may be auto-rearmed what means whenever the rule's conditions changes from false to true actions are triggered over and again.
int event::Engine::testAction | ( | in Action | action, |
out string | errMsg, | ||
in vector< KeyValue > | context | ||
) |
Test an action.
This is similar to triggerAction
, except that an action that is not yet saved can be passed in. Therefore this method can be used for testing actions to be newly created. The operation will block until the action has been performed or an error occurred. In the latter case errMsg will contain an error message. The context is passed to the actions.
NOTE: Currently this function doesn't block!
int event::Engine::triggerAction | ( | in string | actionId, |
out string | errMsg, | ||
in vector< KeyValue > | context | ||
) |
Trigger an action.
This is mainly used for test and debugging. The operation will block until the action has been performed or an error occurred. In the latter case errMsg will contain an error message. The context is passed to the actions.
NOTE: Currently this function doesn't block!