public interface IScenarioDefinition
This interface provides an API for obtaining meta-information about a scenario (parameter names, types, constraints, etc), and for creating new instances of the scenario.
Each input parameter has an associated set of optional validation constraints, expressed as an XML string. The current implementation of the Scenario Service does not enforce these constraints, but provides access to them such that a client may enforce them outside of the service. The XML is useful to drive 3rd-party validation libraries, such as the Jakarta Commons Validator.
When a client listener receives a PropertyChangeEvent from this interface,
the following describes the type of the [old/new] value that is passed with
the event:
Modifier and Type | Interface and Description |
---|---|
static class |
IScenarioDefinition.ScenarioType
Scenario type enum used to distinguish between Scenarios that are either DataViews, Apama Queries or neither.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXTRA_PARAMS_METADATA_PREFIX
Prefix for identifying metadata entries in the extra parameters map returned by
getExtraParams() . |
static java.lang.String |
PROPERTY_INSTANCE_ADDED
Property name for events fired that signal a new ScenarioInstance has been added.
|
static java.lang.String |
PROPERTY_INSTANCE_DIED
Property name for events fired that signal a ScenarioInstance has died unexpectedly.
|
static java.lang.String |
PROPERTY_INSTANCE_DISCOVERY_STATUS
Property name for events fired that signal the status of the internal
mechanism for discovering scenario instances in the Correlator.
|
static java.lang.String |
PROPERTY_INSTANCE_EDITED
Property name for events fired that signal a ScenarioInstance has been edited.
|
static java.lang.String |
PROPERTY_INSTANCE_REMOVED
Property name for events fired that signal an existing ScenarioInstance has been removed.
|
static java.lang.String |
PROPERTY_INSTANCE_STATE_CHANGE
Property name for events fired that signal an existing ScenarioInstance has changed state.
|
static java.lang.String |
PROPERTY_INSTANCE_UPDATED
Property name for events fired that signal a ScenarioInstance has been updated.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener that will be notified of changes to any
bound property of this object.
|
void |
addListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener that will be notified of changes to a
specific named bound property of this object.
|
IScenarioInstance |
createInstance(java.lang.String owner)
Create a new instance of this scenario, using default values for all input parameters.
|
IScenarioInstance |
createInstance(java.lang.String owner,
java.util.Map<java.lang.String,java.lang.Object> inputParameters)
Create a new instance of this scenario, with the supplied values for input parameters.
|
IScenarioInstance |
createInstance(java.lang.String owner,
java.util.Map<java.lang.String,java.lang.Object> inputParameters,
java.beans.PropertyChangeListener listener)
Create a new instance of this Scenario, with the supplied values for input parameters, and atomically add a listener.
|
IScenarioInstance |
createInstance(java.lang.String owner,
java.util.Map<java.lang.String,java.lang.Object> inputParameters,
java.lang.String property,
java.beans.PropertyChangeListener listener)
Create a new instance of this Scenario, with the supplied values for input parameters, and atomically add a listener.
|
java.lang.String |
getDescription()
Get the description of the scenario.
|
DiscoveryStatusEnum |
getDiscoveryStatus()
Get the status of the internal scenario instance discovery process.
|
java.lang.String |
getDisplayName()
Get the display name of the scenario.
|
java.util.Map<java.lang.String,java.lang.String> |
getExtraParams()
Return the read-only map of extra parameters.
|
java.lang.String |
getId()
Get the ID of the scenario.
|
java.util.List<java.lang.String> |
getInputParameterConstraints()
Get the constraints of all input parameters for the scenario.
|
java.util.List<java.lang.Object> |
getInputParameterDefaults()
Get the default values of all input parameters for the scenario.
|
java.util.Set<java.lang.String> |
getInputParameterNames()
Get the names of all input parameters for the scenario.
|
java.util.List<ParameterTypeEnum> |
getInputParameterTypes()
Get the types of all input parameters for the scenario.
|
IScenarioInstance |
getInstance(long instanceId)
Get a single specific instance of this scenario, by instance ID.
|
java.util.List<IScenarioInstance> |
getInstances()
Get all instances of this scenario.
|
java.util.List<IScenarioInstance> |
getInstancesForOwner(java.lang.String owner)
Get all instances of this scenario for a specific owner.
|
java.util.Set<java.lang.String> |
getOutputParameterNames()
Get the names of all output parameters for the scenario.
|
java.util.List<ParameterTypeEnum> |
getOutputParameterTypes()
Get the types of all output parameters for the scenario.
|
IScenarioDefinition.ScenarioType |
getType()
Return the type of Scenario (i.e.
|
boolean |
isInputParameter(java.lang.String parameterName)
Test if a specific named parameter is an input parameter.
|
boolean |
isOutputParameter(java.lang.String parameterName)
Test if a specific named parameter is an output parameter.
|
boolean |
isReadOnly()
Return if the Scenario is read only or can have instances created, edited and deleted.
|
void |
removeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener that was to be notified of changes to any
bound property of this object.
|
void |
removeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener that was to be notified of changes to a
specific named bound property of this object.
|
void |
requestInstances()
Initiate requesting instances.
|
static final java.lang.String PROPERTY_INSTANCE_ADDED
static final java.lang.String PROPERTY_INSTANCE_DIED
static final java.lang.String PROPERTY_INSTANCE_EDITED
static final java.lang.String PROPERTY_INSTANCE_UPDATED
static final java.lang.String PROPERTY_INSTANCE_REMOVED
static final java.lang.String PROPERTY_INSTANCE_STATE_CHANGE
InstanceStateEnum
,
Constant Field Valuesstatic final java.lang.String PROPERTY_INSTANCE_DISCOVERY_STATUS
DiscoveryStatusEnum
,
Constant Field Valuesstatic final java.lang.String EXTRA_PARAMS_METADATA_PREFIX
getExtraParams()
.
Entries with key names prefixed by the EXTRA_PARAMS_METADATA_PREFIX string are considered metadata entries.getExtraParams()
,
Constant Field ValuesDiscoveryStatusEnum getDiscoveryStatus()
void requestInstances()
java.lang.String getId()
This is the ID of the scenario, not of an instance. This ID is unique within the Correlator.
Typically, the scenarioID will be a string derived from the scenario name
that was used when the user saved the scenario from Scenario Manager. This
ID is also the same as the namespace/package used for auto-generated
MonitorScript for the scenario.
e.g. If the user saved the scenario with the name "limit-order", the
ID would be "Scenario_limit$002dorder".
java.lang.String getDisplayName()
java.lang.String getDescription()
java.util.List<IScenarioInstance> getInstances()
The returned List is a shallow copy (new List) of the instances.
IScenarioInstance getInstance(long instanceId)
instanceId
- The ID of the required instance.java.util.List<IScenarioInstance> getInstancesForOwner(java.lang.String owner)
The returned List is a shallow copy (new List) of only the relevant instances.
owner
- The owner for which instances are required.java.util.Set<java.lang.String> getInputParameterNames()
java.util.Set<java.lang.String> getOutputParameterNames()
java.util.List<ParameterTypeEnum> getInputParameterTypes()
ParameterTypeEnum
java.util.List<ParameterTypeEnum> getOutputParameterTypes()
ParameterTypeEnum
boolean isReadOnly()
java.util.Map<java.lang.String,java.lang.String> getExtraParams()
EXTRA_PARAMS_METADATA_PREFIX
IScenarioDefinition.ScenarioType getType()
IScenarioDefinition.ScenarioType
java.util.List<java.lang.String> getInputParameterConstraints()
java.util.List<java.lang.Object> getInputParameterDefaults()
ParameterTypeEnum
boolean isInputParameter(java.lang.String parameterName)
parameterName
- The name of a parameter to be tested.boolean isOutputParameter(java.lang.String parameterName)
parameterName
- The name of a parameter to be tested.IScenarioInstance createInstance(java.lang.String owner) throws InvalidInputParameterException, IllegalCallingThreadException
owner
- id of the owner of this Scenario.InvalidInputParameterException
- when any of the inputParameters is invalid.
Note that future versions of this API may also throw this exception
to indicate constraint violations.IllegalCallingThreadException
- if called from the data processing thread
(i.e. from a PropertyChangeListener listening to an instance or definition).IScenarioInstance createInstance(java.lang.String owner, java.util.Map<java.lang.String,java.lang.Object> inputParameters) throws InvalidInputParameterException, IllegalCallingThreadException
owner
- id of the owner of this Scenario.inputParameters
- contains mappings from input parameter name to initial values.InvalidInputParameterException
- when any of the inputParameters is invalid.
Note that future versions of this API may also throw this exception
to indicate constraint violations.IllegalCallingThreadException
- if called from the data processing thread
(i.e. from a PropertyChangeListener listening to an instance or definition).IScenarioInstance createInstance(java.lang.String owner, java.util.Map<java.lang.String,java.lang.Object> inputParameters, java.beans.PropertyChangeListener listener) throws InvalidInputParameterException, IllegalCallingThreadException
owner
- id of the owner of this Scenario.inputParameters
- contains mappings from input parameter name to initial values.listener
- a listener (all properties) to register atomically to the instance.InvalidInputParameterException
- when any of the inputParameters is invalid.
Note that future versions of this API may also throw this exception
to indicate constraint violations.IllegalCallingThreadException
- if called from the data processing thread
(i.e. from a PropertyChangeListener listening to an instance or definition).IScenarioInstance createInstance(java.lang.String owner, java.util.Map<java.lang.String,java.lang.Object> inputParameters, java.lang.String property, java.beans.PropertyChangeListener listener) throws InvalidInputParameterException, IllegalCallingThreadException
owner
- id of the owner of this Scenario.inputParameters
- contains mappings from input parameter name to initial values.property
- the property the listener listens to.listener
- a listener to register atomically to the instance.InvalidInputParameterException
- when any of the inputParameters is invalid.
Note that future versions of this API may also throw this exception
to indicate constraint violations.IllegalCallingThreadException
- if called from the data processing thread
(i.e. from a PropertyChangeListener listening to an instance or definition).void addListener(java.beans.PropertyChangeListener listener)
listener
- The listener to be notified.PROPERTY_INSTANCE_DISCOVERY_STATUS
,
PROPERTY_INSTANCE_ADDED
,
PROPERTY_INSTANCE_REMOVED
,
PROPERTY_INSTANCE_EDITED
,
PROPERTY_INSTANCE_UPDATED
,
PROPERTY_INSTANCE_DIED
,
PROPERTY_INSTANCE_STATE_CHANGE
void addListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
propertyName
- The name of a specific property.listener
- The listener to be notified.PROPERTY_INSTANCE_DISCOVERY_STATUS
,
PROPERTY_INSTANCE_ADDED
,
PROPERTY_INSTANCE_REMOVED
,
PROPERTY_INSTANCE_EDITED
,
PROPERTY_INSTANCE_UPDATED
,
PROPERTY_INSTANCE_DIED
,
PROPERTY_INSTANCE_STATE_CHANGE
void removeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to be removed.PROPERTY_INSTANCE_DISCOVERY_STATUS
,
PROPERTY_INSTANCE_ADDED
,
PROPERTY_INSTANCE_REMOVED
,
PROPERTY_INSTANCE_EDITED
,
PROPERTY_INSTANCE_UPDATED
,
PROPERTY_INSTANCE_DIED
,
PROPERTY_INSTANCE_STATE_CHANGE
void removeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
propertyName
- The name of a specific property.listener
- The listener to be removed.PROPERTY_INSTANCE_DISCOVERY_STATUS
,
PROPERTY_INSTANCE_ADDED
,
PROPERTY_INSTANCE_REMOVED
,
PROPERTY_INSTANCE_EDITED
,
PROPERTY_INSTANCE_UPDATED
,
PROPERTY_INSTANCE_DIED
,
PROPERTY_INSTANCE_STATE_CHANGE
Submit a bug or feature
Copyright (c) 2013-2016 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.