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.
|
void |
addEventType(String eventTypeName,
RecordType dataType)
Registers an event type as a record.
|
<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.
|
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.
|
RecordType |
getEventType(String eventTypeName)
Returns an event type.
|
Map<String,RecordType> |
getEventTypes()
Returns all registered event types.
|
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.
|
<T extends Plugin> |
getPlugin(Class<T> cls,
String name)
Returns the plugin that has the specified name and type.
|
<T extends Plugin> |
getPlugin(String name)
Returns the plugin that has the specified name.
|
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.
|
boolean |
hasAction(String name)
Returns
true if an action named name is registered. |
boolean |
hasCategory(String categoryName)
Returns
true if the category is registered. |
boolean |
hasCorrelator(String name)
Returns
true if a correlator named name is registered. |
boolean |
hasEventType(String eventTypeName)
Returns
true if the event type is registered. |
boolean |
hasFilter(String name)
Returns
true if a filter named name is registered. |
<T extends Plugin> |
hasPlugin(Class<T> cls)
Returns
true if the plugin is registered. |
<T extends Plugin> |
hasPlugin(Class<T> cls,
String name)
Returns
true if the plugin is registered. |
boolean |
hasPlugin(String name)
Returns
true if the plugin is registered. |
boolean |
hasProperty(String name)
Returns
true if the property is defined. |
boolean |
hasRule(String name)
Returns
true if a rule named name is registered. |
boolean |
hasTrigger(String name)
Returns
true if a trigger named name is registered. |
boolean |
hasType(String registeredTypeName)
Returns
true if the type is registered. |
boolean |
hasVariable(String name)
Returns
true if the engine scope variable named name is defined. |
ProcessDefinition |
process(ProcessConfiguration processConfiguration)
Create a new process definition.
|
ProcessDefinition |
process(ProcessConfigurationBuilder processConfigurationBuilder)
Create a new process definition.
|
Map<String,ProvidedValue<?>> |
provideActionArgs(String actionName,
List<String> provide)
Provides action arguments.
|
Map<String,ProvidedValue<?>> |
provideActionArgs(String actionName,
List<String> provide,
List<String> submit,
Map<String,Object> current)
Provides action arguments.
|
Map<String,ProvidedValue<?>> |
provideActionArgs(String actionName,
List<String> provide,
List<String> submit,
Map<String,Object> current,
Map<String,Map<String,Object>> features)
Provides action arguments.
|
Map<String,ProvidedValue<?>> |
provideActionArgs(String actionName,
List<String> provide,
Map<String,Object> current)
Provides action arguments.
|
void |
reload()
Reloads script-based knowledge bases.
|
CategoryMeta |
removeCategory(String categoryName)
Removes a category.
|
boolean |
removeEvent(EventSchedulerEntry entry)
Removes scheduled event.
|
boolean |
removeEventType(String eventTypeName)
Removes the registered event type.
|
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 |
submitActionArgs(String actionName,
List<String> submit,
Map<String,Object> current)
Submits action arguments.
|
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> provide, List<String> submit, Map<String,Object> current, Map<String,Map<String,Object>> features)
actionName - the action name.provide - the list of argument names to provide.submit - the list of submitted argument names.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 provide and submit depend on and all arguments specified
by submit.features - the features for arguments.Map<String,ProvidedValue<?>> provideActionArgs(String actionName, List<String> provide, List<String> submit, Map<String,Object> current)
actionName - the action name.provide - the list of argument names to provide.submit - the list of submitted argument names.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 provide and submit depend on and all arguments specified
by submit.Map<String,ProvidedValue<?>> provideActionArgs(String actionName, List<String> provide, Map<String,Object> current)
actionName - the action name.provide - the list of argument names to provide.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 provide and submit depend on.Map<String,ProvidedValue<?>> provideActionArgs(String actionName, List<String> provide)
actionName - the action name.provide - the list of argument names.void submitActionArgs(String actionName, List<String> submit, Map<String,Object> current)
provideActionArgs.actionName - the action name.submit - the list of argument names to submit.current - the map of argument names and their current values passed from a client code. The map is required to contain values of
submit and those arguments that the arguments specified in the submit depend on.void shutdown()
void requestShutdown()
void reload()
void requestReload()
boolean removeEvent(EventSchedulerEntry entry)
entry - scheduled event entry.<T extends Plugin> T getPlugin(String name)
T - plugin type.name - plugin name.<T extends Plugin> T getPlugin(Class<T> cls, String name)
T - plugin type.cls - plugin class.name - plugin name.<T extends Plugin> T getPlugin(Class<T> cls)
T - plugin type.cls - plugin class.boolean hasPlugin(String name)
true if the plugin is registered.name - the plugin name.true if the plugin is registered.<T extends Plugin> boolean hasPlugin(Class<T> cls, String name)
true if the plugin is registered.T - plugin type.cls - the plugin class.name - the plugin name.true if the plugin is registered.<T extends Plugin> boolean hasPlugin(Class<T> cls)
true if the plugin is registered.T - plugin type.cls - the plugin class.true if the plugin is registered.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 hasAction(String name)
true if an action named name is registered.name - action name.true if an action named name is registered.boolean hasFilter(String name)
true if a filter named name is registered.name - filter name.true if a filter named name is registered.boolean hasTrigger(String name)
true if a trigger named name is registered.name - trigger name.true if a trigger named name is registered.boolean hasRule(String name)
true if a rule named name is registered.name - rule name.true if a rule named name is registered.boolean hasCorrelator(String name)
true if a correlator named name is registered.name - correlator name.true if a correlator named name is registered.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 hasVariable(String name)
true if the engine scope variable named name is defined.name - variable name.true if the engine scope variable named name is defined.<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 valueboolean hasProperty(String name)
true if the property is defined.name - the property name.true if the property is defined.String 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.boolean hasCategory(String categoryName)
true if the category is registered.categoryName - the category name.true if the category is registered.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 hasType(String registeredTypeName)
true if the type is registered.registeredTypeName - the type name.true if the type is registered.boolean removeType(String registeredTypeName)
registeredTypeName - the registered type name.true if the data type was registered.void addEventType(String eventTypeName, RecordType dataType)
eventTypeName - the registered event type name.dataType - the event data type.RecordType getEventType(String eventTypeName)
eventTypeName - the registered event type name.boolean hasEventType(String eventTypeName)
true if the event type is registered.eventTypeName - the event type name.true if the event type is registered.Map<String,RecordType> getEventTypes()
boolean removeEventType(String eventTypeName)
eventTypeName - the registered event type name.true if the event type was registered.Copyright © 2016–2019 Softelnet. All rights reserved.