public class EventDefinitionRegistry extends Object
EventDefinitions and provide utility methods to retrieve them.
This class provides methods to retrieve specific EventDefinitions, filter IntentDefinitions, and
retrieve an existing Context stored in a registered EventDefinition.
| Constructor and Description |
|---|
EventDefinitionRegistry()
Constructs a new instance of the registry and initializes its
eventDefinitionMap. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearEventDefinitions()
Unregisters all the
EventDefinitions from this registry. |
Collection<com.xatkit.intent.EventDefinition> |
getAllEventDefinitions()
Returns an unmodifiable
Collection containing all the registered EventDefinitions. |
Collection<com.xatkit.intent.IntentDefinition> |
getAllIntentDefinitions()
Returns an unmodifiable
Collection containing all the registered IntentDefinitions. |
com.xatkit.intent.EventDefinition |
getEventDefinition(String name)
Returns the
EventDefinition matching the provided name. |
com.xatkit.intent.Context |
getEventDefinitionOutContext(String contextName)
Retrieve the
Context matching the provided contextName from the registered
EventDefinitions. |
com.xatkit.intent.IntentDefinition |
getIntentDefinition(String name)
Returns the
IntentDefinition matching the provided name. |
void |
registerEventDefinition(com.xatkit.intent.EventDefinition eventDefinition)
Registers the provided
eventDefinition. |
void |
unregisterEventDefinition(com.xatkit.intent.EventDefinition eventDefinition)
Unregisters the provided
eventDefinition. |
public EventDefinitionRegistry()
eventDefinitionMap.public void registerEventDefinition(com.xatkit.intent.EventDefinition eventDefinition)
eventDefinition.eventDefinition - the EventDefinition to registerpublic void unregisterEventDefinition(com.xatkit.intent.EventDefinition eventDefinition)
eventDefinition.eventDefinition - the EventDefinition to unregisterpublic com.xatkit.intent.EventDefinition getEventDefinition(String name)
EventDefinition matching the provided name.name - the name of the EventDefinition to retrieveEventDefinition matching the provided namegetAllEventDefinitions()public com.xatkit.intent.IntentDefinition getIntentDefinition(String name)
IntentDefinition matching the provided name.name - the name of the IntentDefinition to retrieveIntentDefinition matching the provided namegetAllIntentDefinitions()public Collection<com.xatkit.intent.EventDefinition> getAllEventDefinitions()
Collection containing all the registered EventDefinitions.
To retrieve a single EventDefinition from its name see getEventDefinition(String).
Collection containing all the registered EventDefinitionspublic Collection<com.xatkit.intent.IntentDefinition> getAllIntentDefinitions()
Collection containing all the registered IntentDefinitions.
This method returns a subset of the Collection returned by getAllEventDefinitions() that
contains only IntentDefinition instances.
To retrieve a single IntentDefinition from its name see getIntentDefinition(String).
Collection containing all the registered IntentDefinitionspublic com.xatkit.intent.Context getEventDefinitionOutContext(String contextName)
Context matching the provided contextName from the registered
EventDefinitions.
This method performs a lookup on the registered EventDefinition and searches for an output
Context matching the provided contextName. Note that name comparison is not case
sensitive.
If there are multiple output Context that match the provided contextName the first one is
returned.
contextName - the name of the output Context to retrieveContext matching the provided contextNamepublic void clearEventDefinitions()
EventDefinitions from this registry.Copyright © 2020 SOM Research Lab. All rights reserved.