Class DemandMatcher

java.lang.Object
csw.command.api.DemandMatcher
All Implemented Interfaces:
StateMatcher, Serializable, scala.Equals, scala.Product

public class DemandMatcher extends Object implements StateMatcher, scala.Product, Serializable
The DemandMatcher checks the CurrentStatus for equality with the items in the DemandState. This version tests for equality so it may not work the best with floating point values. Note: If the withUnits flag is set, the equality check with also compare units. False is the default so normally units are ignored for this purpose.

param: demand a DemandState that will provide the items for determining completion with the CurrentState param: withUnits when True, units are compared. When false, units are not compared. Default is false. param: timeout a timeout for which the matching should be executed. Once the timeout occurs, complete the match with MatchFailed response and appropriate failure exception.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    DemandMatcher(DemandState demand, boolean withUnits, akka.util.Timeout timeout)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract static R
    apply(T1 v1, T2 v2, T3 v3)
     
    boolean
    A predicate to match the current state
     
    The prefix of the destination component for which the current state is being matched
    The name of the state to match for
    akka.util.Timeout
    The maximum duration for which the matching is executed if not completed either successfully or unsuccessfully
    static String
     
    boolean
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface scala.Equals

    canEqual, equals

    Methods inherited from interface scala.Product

    productArity, productElement, productElementName, productElementNames, productIterator, productPrefix
  • Constructor Details

    • DemandMatcher

      public DemandMatcher(DemandState demand, boolean withUnits, akka.util.Timeout timeout)
  • Method Details

    • apply

      public abstract static R apply(T1 v1, T2 v2, T3 v3)
    • toString

      public static String toString()
    • demand

      public DemandState demand()
    • withUnits

      public boolean withUnits()
    • timeout

      public akka.util.Timeout timeout()
      Description copied from interface: StateMatcher
      The maximum duration for which the matching is executed if not completed either successfully or unsuccessfully
      Specified by:
      timeout in interface StateMatcher
      Returns:
      (undocumented)
    • prefix

      public Prefix prefix()
      The prefix of the destination component for which the current state is being matched

      Specified by:
      prefix in interface StateMatcher
      Returns:
      the prefix of destination component
    • stateName

      public StateName stateName()
      The name of the state to match for

      Specified by:
      stateName in interface StateMatcher
      Returns:
      the name of the state
    • check

      public boolean check(CurrentState current)
      A predicate to match the current state

      Specified by:
      check in interface StateMatcher
      Parameters:
      current - current state to be matched as represented by CurrentState
      Returns:
      true if match is successful, false otherwise