Interface IScenarioInstance


  • public interface IScenarioInstance
    IScenarioInstance supports getting the owner, last update time and current input/output parameter values of a scenario instance, listening for changes in individual instance parameters, and performing delete and edit operations on the instance.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addListener​(java.beans.PropertyChangeListener listener)
      Add a listener to that will receive a notification each time an input or output parameter value changes.
      void addListener​(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
      Add a listener to that will receive a notification each time a specified input or output parameter value changes.
      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.
      • 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 that will receive a notification each time an input or output parameter value changes.
        Parameters:
        listener - property change listener to invoke.
      • addListener

        void addListener​(java.lang.String propertyName,
                         java.beans.PropertyChangeListener listener)
        Add a listener to that will receive a notification each time a specified input or output parameter value changes.
        Parameters:
        propertyName - name of the instance parameter to monitor.
        listener - property change listener to invoke.
      • 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 parameter to remove interest in.
        listener - property change listener to remove from the interest list.