|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IScenarioDefinition
IScenarioDefinition is the public interface for a class that represents a Scenario (not an instance).
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:
Field Summary | |
---|---|
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. |
Method Summary | |
---|---|
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 paramters. |
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 paramters. |
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 paramters, 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 paramters, 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.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. |
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. |
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. |
Field Detail |
---|
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 ValuesMethod Detail |
---|
DiscoveryStatusEnum 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 populated with the result of a Map.values() method call, but is not backed by the original Map.
IScenarioInstance getInstance(long instanceId)
instanceId
- The ID of the required instance.
java.util.List<IScenarioInstance> getInstancesForOwner(java.lang.String owner)
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
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 paramter to be tested.
boolean isOutputParameter(java.lang.String parameterName)
parameterName
- The name of a paramter 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |