com.apama.services.scenario
Interface IScenarioInstance


public interface IScenarioInstance

IScenarioInstance is the public interface for a class that represents a Scenario instance.

This API provides a mechanism to access the values of individual parameters, and to delete the instance. It is also possible to determine the timestamp of the last received Update event.


Method Summary
 void addListener(java.beans.PropertyChangeListener listener)
          Add a listener to the list of those interested in changes to any object property, or any scenario instance (input and/or output) parameter.
 void addListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Add a listener to the list of those interested in changes to the object property with given name, or the scenario instance (input and/or output) parameter with the given name.
 boolean delete()
          Delete this instance.
 java.lang.Long getId()
          Get the ID of the instance.
 long getLastUpdateTime()
          Get the timestamp (milliseconds) of the last known update event for this instance.
 java.lang.String getOwner()
          Get the owner (username) of the instance.
 IScenarioDefinition getScenarioDefinition()
          Get the Scenario Definition.
 InstanceStateEnum getState()
          Get the current state of the instance.
 java.lang.Object getValue(java.lang.String parameterName)
          Get the value of a single specific (input or output) parameter of this instance.
 void removeListener(java.beans.PropertyChangeListener listener)
          Remove a listener from the list of those interested in changes to any object property, or scenario instance parameter.
 void removeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Remove a listener from the list of those interested in changes to the object property with given name, or the scenario instance parameter with the given name.
 boolean setValue(java.lang.String parameterName, java.lang.Object value)
          Set the value of a single specific (input) parameter of this instance.
 boolean setValues(java.util.Map<java.lang.String,java.lang.Object> valuesMap)
          Set several (input) parameter values of this instance.
 

Method Detail

getId

java.lang.Long getId()
Get the ID of the instance.

Returns:
The ID.

getOwner

java.lang.String getOwner()
Get the owner (username) of the instance.

Returns:
The owner.

getScenarioDefinition

IScenarioDefinition getScenarioDefinition()
Get the Scenario Definition.

Returns:
The Scenario Definition.

delete

boolean delete()
               throws IllegalCallingThreadException
Delete this instance.

Returns:
true if the instance deleted, false otherwise.
Throws:
IllegalCallingThreadException - if called from the data processing thread (i.e. from a PropertyChangeListener listening to an instance or definition).

setValues

boolean setValues(java.util.Map<java.lang.String,java.lang.Object> valuesMap)
                  throws InvalidInputParameterException,
                         IllegalCallingThreadException
Set several (input) parameter values of this instance.

Parameters:
valuesMap - a Map (key String parameterName : value Object) of the values to be set in this instance.
Returns:
true if edit was successful, false otherwise.
Throws:
InvalidInputParameterException - when any value in the valuesMap 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).

setValue

boolean setValue(java.lang.String parameterName,
                 java.lang.Object value)
                 throws InvalidInputParameterException,
                        IllegalCallingThreadException
Set the value of a single specific (input) parameter of this instance.

Parameters:
parameterName - The name of the parameter to be set.
value - The new value.
Returns:
true if edit was successful, false otherwise.
Throws:
InvalidInputParameterException - when value 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).

getValue

java.lang.Object getValue(java.lang.String parameterName)
Get the value of a single specific (input or output) parameter of this instance.

Parameters:
parameterName - The name of the parameter to be retrieved.
Returns:
The current value of the specified parameter.

getState

InstanceStateEnum getState()
Get the current state of the instance.

Returns:
The current state of the instance
See Also:
for list of states

getLastUpdateTime

long getLastUpdateTime()
Get the timestamp (milliseconds) of the last known update event for this instance. The folloing events will set an update time - Created, Edited, Update.

Returns:
the timestamp from the last seen update event, as millis since the epoch.

addListener

void addListener(java.beans.PropertyChangeListener listener)
Add a listener to the list of those interested in changes to any object property, or any scenario instance (input and/or output) parameter.

Parameters:
listener - property change listener to invoke when a property or parameter changes value.

addListener

void addListener(java.lang.String propertyName,
                 java.beans.PropertyChangeListener listener)
Add a listener to the list of those interested in changes to the object property with given name, or the scenario instance (input and/or output) parameter with the given name.

Parameters:
propertyName - name of the property or parameter to register interest in.
listener - property change listener to invoke when a property or parameter changes value.

removeListener

void removeListener(java.beans.PropertyChangeListener listener)
Remove a listener from the list of those interested in changes to any object property, or scenario instance parameter.

Parameters:
listener - property change listener to remove from the interest list.

removeListener

void removeListener(java.lang.String propertyName,
                    java.beans.PropertyChangeListener listener)
Remove a listener from the list of those interested in changes to the object property with given name, or the scenario instance parameter with the given name.

Parameters:
propertyName - name of the property or parameter to remove interest in.
listener - property change listener to remove from the interest list.


Submit a bug or feature
Copyright (c) 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG