public interface EngineOperations
| Modifier and Type | Method and Description |
|---|---|
void |
addCategories(CategoryMeta... categoryMeta)
Adds or updates categories.
|
void |
addCategory(CategoryMeta categoryMeta)
Adds or updates a category.
|
<T extends DataType<?>> |
addType(String registeredTypeName,
DataTypeSupplier<T> typeSupplier)
Registers a data type.
|
<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. |
ActionMeta |
getActionMeta(String actionName)
Returns the action metadata.
|
List<CategoryMeta> |
getCategories()
Returns all categories.
|
CategoryMeta |
getCategory(String categoryName)
Returns a category.
|
CorrelatorMeta |
getCorrelatorMeta(String correlatorName)
Returns the correlator metadata.
|
SpongeEngine |
getEngine()
Returns the engine.
|
FilterMeta |
getFilterMeta(String filterName)
Returns the filter metadata.
|
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. |
RuleMeta |
getRuleMeta(String ruleName)
Returns the rule metadata.
|
String |
getStatisticsSummary()
Returns the engine statistics summary.
|
TriggerMeta |
getTriggerMeta(String triggerName)
Returns the trigger metadata.
|
<T extends DataType<?>> |
getType(String registeredTypeName)
Returns a new instance of the registered data type.
|
<T extends DataType<?>> |
getType(String registeredTypeName,
String locationName)
Returns a new instance of the registered data type.
|
Map<String,DataType> |
getTypes()
Returns the unmodifiable map of registered data types.
|
<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,ProvidedValue<?>> |
provideActionArgs(String actionName)
Returns the provided values along with value sets of the action arguments.
|
Map<String,ProvidedValue<?>> |
provideActionArgs(String actionName,
List<String> argNames)
Returns the provided values along with value sets of the action arguments.
|
Map<String,ProvidedValue<?>> |
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.
|
CategoryMeta |
removeCategory(String categoryName)
Removes a category.
|
boolean |
removeEvent(EventSchedulerEntry entry)
Removes scheduled event.
|
boolean |
removeType(String registeredTypeName)
Removes the registered data type.
|
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 |
selectCategory(String categoryName,
ProcessorPredicate predicate)
Dynamically selects processors of all types that are to assigned to the category.
|
void |
selectCategory(String categoryName,
ProcessorType processorType,
ProcessorPredicate predicate)
Dynamically selects processors that are to assigned to the category.
|
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,ProvidedValue<?>> 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,ProvidedValue<?>> provideActionArgs(String actionName, List<String> argNames)
actionName - the action name.argNames - the list of argument names.Map<String,ProvidedValue<?>> 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.void addCategory(CategoryMeta categoryMeta)
categoryMeta - the category metadata.void addCategories(CategoryMeta... categoryMeta)
categoryMeta - the category metadata array.CategoryMeta getCategory(String categoryName)
categoryName - the category name.null.CategoryMeta removeCategory(String categoryName)
categoryName - the category name.null.List<CategoryMeta> getCategories()
void selectCategory(String categoryName, ProcessorType processorType, ProcessorPredicate predicate)
categoryName - the category name.processorType - the processor type. If null, all processor types will be considered.predicate - the processor predicate.void selectCategory(String categoryName, ProcessorPredicate predicate)
categoryName - the category name.predicate - the processor predicate.ActionMeta getActionMeta(String actionName)
actionName - the action name.FilterMeta getFilterMeta(String filterName)
filterName - the filter name.TriggerMeta getTriggerMeta(String triggerName)
triggerName - the trigger name.CorrelatorMeta getCorrelatorMeta(String correlatorName)
correlatorName - the correlator name.RuleMeta getRuleMeta(String ruleName)
ruleName - the rule name.<T extends DataType<?>> void addType(String registeredTypeName, DataTypeSupplier<T> typeSupplier)
T - a data type.registeredTypeName - the registered type name.typeSupplier - the type supplier.<T extends DataType<?>> T getType(String registeredTypeName)
T - a data type.registeredTypeName - the registered type name.<T extends DataType<?>> T getType(String registeredTypeName, String locationName)
T - a data type.registeredTypeName - the registered type name.locationName - the returned type location name (corresponds to the withName type method).Map<String,DataType> getTypes()
boolean removeType(String registeredTypeName)
registeredTypeName - the registered type name.true if the data type was registered.Copyright © 2016–2019 Softelnet. All rights reserved.