public interface EngineOperations
| Modifier and Type | Method and Description |
|---|---|
<T> T |
call(Class<T> resultClass,
String actionName)
Calls the registered action with no arguments.
|
<T> T |
call(Class<T> resultClass,
String actionName,
List<Object> args)
Calls the registered action with arguments.
|
Object |
call(String actionName)
Calls the registered action with no arguments.
|
Object |
call(String actionName,
List<Object> args)
Calls the registered action with arguments.
|
<T> ValueHolder<T> |
callIfExists(Class<T> resultClass,
String actionName)
Calls the action if it exists.
|
<T> ValueHolder<T> |
callIfExists(Class<T> resultClass,
String actionName,
List<Object> args)
Calls the action if it exists.
|
ValueHolder<Object> |
callIfExists(String actionName)
Calls the action if it exists.
|
ValueHolder<Object> |
callIfExists(String actionName,
List<Object> args)
Calls the action if it exists.
|
EventDefinition |
event(Event event)
Creates a new event definition.
|
EventDefinition |
event(String name)
Creates a new event definition.
|
EventDefinition |
event(String name,
EventClonePolicy policy)
Creates a new event definition.
|
boolean |
existsAction(String name)
Returns
true if an action named name exists. |
boolean |
existsCorrelator(String name)
Returns
true if a correlator named name exists. |
boolean |
existsFilter(String name)
Returns
true if a filter named name exists. |
boolean |
existsRule(String name)
Returns
true if a rule named name exists. |
boolean |
existsTrigger(String name)
Returns
true if a trigger named name exists. |
boolean |
existsVariable(String name)
Returns
true if the engine scope variable named name exists. |
SpongeEngine |
getEngine()
Returns the engine.
|
String |
getHome()
Returns the home directory for the engine.
|
String |
getInfo()
Returns the engine info.
|
<T extends Plugin> |
getPlugin(Class<T> cls)
Returns the plugin that has the specified type or
null if there is no such plugin. |
<T extends Plugin> |
getPlugin(Class<T> cls,
String name)
Returns the plugin that has the specified name and type or
null if there is no such plugin. |
<T extends Plugin> |
getPlugin(String name)
Returns the plugin that has the specified name or
null if there is no such plugin. |
String |
getProperty(String name)
Returns the configuration property value.
|
String |
getProperty(String name,
String defaultValue)
Returns the configuration property value or
defaultValue if not found. |
String |
getStatisticsSummary()
Returns the engine statistics summary.
|
<T> T |
getVariable(Class<T> cls,
String name)
Returns the value of the engine scope variable.
|
<T> T |
getVariable(Class<T> cls,
String name,
T defaultValue)
Returns the value of the engine scope variable or
defaultValue if not found. |
<T> T |
getVariable(String name)
Returns the value of the engine scope variable.
|
<T> T |
getVariable(String name,
T defaultValue)
Returns the value of the engine scope variable or
defaultValue if not found. |
String |
getVersion()
Returns the engine version.
|
ProcessDefinition |
process(ProcessConfiguration processConfiguration)
Create a new process definition.
|
ProcessDefinition |
process(ProcessConfigurationBuilder processConfigurationBuilder)
Create a new process definition.
|
Map<String,ArgProvidedValue<?>> |
provideActionArgs(String actionName)
Returns the provided values along with value sets of the action arguments.
|
Map<String,ArgProvidedValue<?>> |
provideActionArgs(String actionName,
List<String> argNames)
Returns the provided values along with value sets of the action arguments.
|
Map<String,ArgProvidedValue<?>> |
provideActionArgs(String actionName,
List<String> argNames,
Map<String,Object> current)
Returns the provided values along with value sets of the action arguments.
|
void |
reload()
Reloads script-based knowledge bases.
|
boolean |
removeEvent(EventSchedulerEntry entry)
Removes scheduled event.
|
void |
removeVariable(String name)
Removes the engine scope variable.
|
void |
requestReload()
Reloads script-based knowledge bases using another thread.
|
void |
requestShutdown()
Shuts down the engine using another thread.
|
void |
setVariable(String name,
Object value)
Sets the engine scope variable.
|
<T> void |
setVariableIfNone(String name,
Supplier<T> supplier)
Sets the engine scope variable if not set already.
|
void |
shutdown()
Shuts down the engine using the current thread.
|
void |
updateVariable(String name)
Updates the engine scope variable.
|
SpongeEngine getEngine()
Object call(String actionName, List<Object> args)
ProcessorNotFoundException when such action is not registered.actionName - actionName the action name.args - arguments to pass to action.<T> T call(Class<T> resultClass, String actionName, List<Object> args)
ProcessorNotFoundException when such action is not registered.T - result type.resultClass - result class.actionName - actionName the action name.args - arguments to pass to action.Object call(String actionName)
ProcessorNotFoundException when such action is not registered.actionName - actionName the action name.<T> T call(Class<T> resultClass, String actionName)
ProcessorNotFoundException when such action is not registered.T - result type.resultClass - result class.actionName - actionName the action name.ValueHolder<Object> callIfExists(String actionName, List<Object> args)
actionName - actionName the action name.args - arguments to pass to action.null if the action is not registered.<T> ValueHolder<T> callIfExists(Class<T> resultClass, String actionName, List<Object> args)
T - result type.resultClass - result class.actionName - actionName the action name.args - arguments to pass to action.null if the action is not registered.ValueHolder<Object> callIfExists(String actionName)
actionName - actionName the action name.null if the action is not registered.<T> ValueHolder<T> callIfExists(Class<T> resultClass, String actionName)
T - result type.resultClass - result class.actionName - actionName the action name.null if the action is not registered.Map<String,ArgProvidedValue<?>> provideActionArgs(String actionName, List<String> argNames, Map<String,Object> current)
actionName - the action name.argNames - the list of argument names that are to be provided.current - the map of argument names and their current values passed from a client code. The map is required to contain values of
those arguments that the arguments specified in the names depend on.Map<String,ArgProvidedValue<?>> provideActionArgs(String actionName, List<String> argNames)
actionName - the action name.argNames - the list of argument names.Map<String,ArgProvidedValue<?>> provideActionArgs(String actionName)
actionName - the action name.void shutdown()
void requestShutdown()
void reload()
void requestReload()
boolean removeEvent(EventSchedulerEntry entry)
entry - scheduled event entry.<T extends Plugin> T getPlugin(String name)
null if there is no such plugin.T - Plugin type.name - plugin name.<T extends Plugin> T getPlugin(Class<T> cls, String name)
null if there is no such plugin.T - Plugin type.cls - plugin class.name - plugin name.<T extends Plugin> T getPlugin(Class<T> cls)
null if there is no such plugin.T - Plugin type.cls - plugin class.String getVersion()
String getInfo()
String getStatisticsSummary()
EventDefinition event(String name)
name - event name.EventDefinition event(String name, EventClonePolicy policy)
name - event name.policy - event clone policy.EventDefinition event(Event event)
event - an event.boolean existsAction(String name)
true if an action named name exists.name - action name.true if an action named name exists.boolean existsFilter(String name)
true if a filter named name exists.name - filter name.true if a filter named name exists.boolean existsTrigger(String name)
true if a trigger named name exists.name - trigger name.true if a trigger named name exists.boolean existsRule(String name)
true if a rule named name exists.name - rule name.true if a rule named name exists.boolean existsCorrelator(String name)
true if a correlator named name exists.name - correlator name.true if a correlator named name exists.void setVariable(String name, Object value)
name - variable name.value - variable value.<T> T getVariable(String name)
T - variable.name - variable name.<T> T getVariable(Class<T> cls, String name)
T - variable.cls - variable class.name - variable name.<T> T getVariable(String name, T defaultValue)
defaultValue if not found.T - variable.name - variable name.defaultValue - default value.<T> T getVariable(Class<T> cls, String name, T defaultValue)
defaultValue if not found.T - variable.cls - variable class.name - variable name.defaultValue - default value.void removeVariable(String name)
name - variable name.boolean existsVariable(String name)
true if the engine scope variable named name exists.name - variable name.true if the engine scope variable named name exists.<T> void setVariableIfNone(String name, Supplier<T> supplier)
T - variable.name - variable name.supplier - variable value supplier.void updateVariable(String name)
name - variable name.String getProperty(String name)
name - the configuration property name.String getProperty(String name, String defaultValue)
defaultValue if not found.name - the configuration property name.defaultValue - the default valueString getHome()
ProcessDefinition process(ProcessConfiguration processConfiguration)
processConfiguration - the process configuration.ProcessDefinition process(ProcessConfigurationBuilder processConfigurationBuilder)
processConfigurationBuilder - the process configuration builder.Copyright © 2016–2019 Softelnet. All rights reserved.