Class OperationExecutionContext

java.lang.Object
com.highdeal.pnr.hci.OperationExecutionContext

public class OperationExecutionContext extends Object
The Java class is the context of the execution of an operation, represented as a list of properties.
  • Field Details

    • EMPTY_OPERATION_EXECUTION_CONTEXT

      public static final OperationExecutionContext EMPTY_OPERATION_EXECUTION_CONTEXT
      The empty operation execution context. This context is not mutable and no property can be added to it.
  • Constructor Details

    • OperationExecutionContext

      public OperationExecutionContext()
      Initializes an operation execution context.
    • OperationExecutionContext

      public OperationExecutionContext(PropertyList properties)
      Initializes an operation execution context with a property list.
      Parameters:
      properties - The property list which contains the property of this context. If null, then a new list is created.
  • Method Details

    • getPropertyCount

      public int getPropertyCount()
      Returns the count of the properties of this context.
      Returns:
      The number of properties of this context; 0 if this context has no property.
    • getProperties

      public PropertyList getProperties()
      Returns the properties of this context.

      Notice that it is the nested property list that is returned and so all the update done on the list are done one this context properties.

      Returns:
      The PropertyList that contains all the properties of this context
    • add

      public void add(Property prop) throws IllegalArgumentException
      Adds a property to this context.

      Only valid property can be added to this context. A valid property has a not empty name and a known type.

      Parameters:
      prop - The property to be added. Can be null but the context is not updated.
      Throws:
      IllegalArgumentException - if the property is not a value
    • merge

      public void merge(OperationExecutionContext context, boolean updateKnownProperties)
      Merges the properties of the specified context with this properties.

      Here is an example of context merging with the specified context 'c2' has two properties 'p1' and 'p2=value2' and this context 'c1' has 'p2=value1' and 'p3'.

      Then if 'updateKnownProperties' is 'true' then the context 'c1' will have the following properties: 'p1', 'p2=value2', 'p3'

      Then if 'updateKnownProperties' is 'false' then the context 'c1': 'p1', 'p2=value1', 'p3'

      Parameters:
      context - The context which must be merged with this context. Null 'context' supported.
      updateKnownProperties - true if the properties which already exists in this context must be updated or not
    • duplicate

      public OperationExecutionContext duplicate()
      Returns a copy of this context, containing a copy of each of its properties.
      Returns:
      A copy of this context