com.oakgrovesystems.reactor.processMediation
Class ProcessHasStatusCondition

java.lang.Object
  |
  +--com.oakgrovesystems.reactor.processMediation.AbstractProcessCondition
        |
        +--com.oakgrovesystems.reactor.processMediation.ProcessHasStatusCondition
All Implemented Interfaces:
java.lang.Cloneable, Condition, ProcessCondition, java.io.Serializable

public class ProcessHasStatusCondition
extends AbstractProcessCondition
implements java.lang.Cloneable, java.io.Serializable

A Condition that is true if a particular Process has a certain Status in its list of current statuses and false otherwise.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.oakgrovesystems.reactor.processMediation.AbstractProcessCondition
objectMap
 
Constructor Summary
ProcessHasStatusCondition(com.oakgrovesystems.reactor.ReactorObjectId processId, com.oakgrovesystems.reactor.ReactorObjectId statusId)
          Creates a new ProcessHasStatusCondition that checks the Process specified for the Status specified.
ProcessHasStatusCondition(com.oakgrovesystems.reactor.ReactorObjectId processId, com.oakgrovesystems.reactor.ReactorObjectId statusId, java.util.Map objectMap)
          Creates a new ProcessHasStatusCondition that checks the Process specified for the Status specified using the Map specified to dereference the id.
ProcessHasStatusCondition(java.lang.String processId, java.lang.String statusId)
          Creates a new ProcessHasStatusCondition that checks the Process specified for the Status specified.
ProcessHasStatusCondition(java.lang.String processId, java.lang.String statusId, java.util.Map objectMap)
          Creates a new ProcessHasStatusCondition that checks the Process specified for the Status specified using the Map specified to dereference the id.
 
Method Summary
 java.lang.Object clone()
          Clones this ProcessHasStatusCondition.
 com.oakgrovesystems.reactor.processMediation.ProcessCondition copy()
          Clones this ProcessHasStatusCondition.
 com.oakgrovesystems.reactor.ReactorObjectId getProcessId()
          returns the id of the Process that must have a particular Status for this Condition to be true.
 com.oakgrovesystems.reactor.ReactorObjectId getStatusId()
          returns the id of the Status that a particular Process must have for this Condition to be true.
 boolean isMadeFalseBy(com.oakgrovesystems.mediation.Change c, java.lang.Object changee)
          returns true if the Change specifies that the correct Process loses the correct Status
 boolean isMadeTrueBy(com.oakgrovesystems.mediation.Change c, java.lang.Object changee)
          returns true if the Change specifies that the correct Process aquires the correct Status
 boolean isTrue()
          Evaluated on the process returned from a call to either ReactorObjectId.dereference(Process.class) or ReactorObjectId.dereference(Process.class,Map,true) depending on whether or not the objectMap is equal to null.
 boolean sameAs(java.lang.Object o)
          tests this ProcessHasStatusCondition for content equality with another object.
 void setProcessId(com.oakgrovesystems.reactor.ReactorObjectId processId)
          sets the id of the Process that must have a particular Status for this Condition to be true.
 void setStatusId(com.oakgrovesystems.reactor.ReactorObjectId statusId)
          sets the id of the Status that a particular Process must have for this Condition to be true.
 java.lang.String toString()
           
 
Methods inherited from class com.oakgrovesystems.reactor.processMediation.AbstractProcessCondition
getObjectMap, setObjectMap
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProcessHasStatusCondition

public ProcessHasStatusCondition(java.lang.String processId,
                                 java.lang.String statusId)
Creates a new ProcessHasStatusCondition that checks the Process specified for the Status specified.

Parameters:
processId - the id of the Process to check the current statuses of.
statusId - the Status the Process must have for the Condition to be true

ProcessHasStatusCondition

public ProcessHasStatusCondition(com.oakgrovesystems.reactor.ReactorObjectId processId,
                                 com.oakgrovesystems.reactor.ReactorObjectId statusId)
Creates a new ProcessHasStatusCondition that checks the Process specified for the Status specified.

Parameters:
processId - the id of the Process to check the current statuses of.
statusId - the Status the Process must have for the Condition to be true

ProcessHasStatusCondition

public ProcessHasStatusCondition(java.lang.String processId,
                                 java.lang.String statusId,
                                 java.util.Map objectMap)
Creates a new ProcessHasStatusCondition that checks the Process specified for the Status specified using the Map specified to dereference the id.

Parameters:
processId - the id of the Process to check the current statuses of.
statusId - the Status the Process must have for the Condition to be true
objectMap - the map to use to look up the Process

ProcessHasStatusCondition

public ProcessHasStatusCondition(com.oakgrovesystems.reactor.ReactorObjectId processId,
                                 com.oakgrovesystems.reactor.ReactorObjectId statusId,
                                 java.util.Map objectMap)
Creates a new ProcessHasStatusCondition that checks the Process specified for the Status specified using the Map specified to dereference the id.

Parameters:
processId - the id of the Process to check the current statuses of.
statusId - the Status the Process must have for the Condition to be true
objectMap - the map to use to look up the Process
Method Detail

isTrue

public boolean isTrue()
               throws CanNotEvaluateConditionException
Evaluated on the process returned from a call to either ReactorObjectId.dereference(Process.class) or ReactorObjectId.dereference(Process.class,Map,true) depending on whether or not the objectMap is equal to null.

Specified by:
isTrue in interface Condition
Returns:
true if the Status appears in the Process's Set of current statuses and false otherwise.
Throws:
CanNotEvaluateConditionException - if the call to dereference fails or either ReactorObjectId is null.

isMadeTrueBy

public boolean isMadeTrueBy(com.oakgrovesystems.mediation.Change c,
                            java.lang.Object changee)
                     throws CanNotEvaluateConditionException
returns true if the Change specifies that the correct Process aquires the correct Status

Specified by:
isMadeTrueBy in interface Condition
Parameters:
c - the change that may make this Condition true
changee - the Process to which the change is to be applied
Returns:
boolean indicating whether or not application of the Change specified to the Process specified would make this Condition true.
Throws:
CanNotEvaluateConditionException

isMadeFalseBy

public boolean isMadeFalseBy(com.oakgrovesystems.mediation.Change c,
                             java.lang.Object changee)
                      throws CanNotEvaluateConditionException
returns true if the Change specifies that the correct Process loses the correct Status

Specified by:
isMadeFalseBy in interface Condition
Parameters:
c - the change that may make this Condition false
changee - the Process to which the change is to be applied
Returns:
boolean indicating whether or not application of the Change specified to the Process specified would make this Condition false.
Throws:
CanNotEvaluateConditionException

setProcessId

public void setProcessId(com.oakgrovesystems.reactor.ReactorObjectId processId)
sets the id of the Process that must have a particular Status for this Condition to be true.

Parameters:
processId - the id of the Process that must have a particular Status for this Condition to be true.

getProcessId

public com.oakgrovesystems.reactor.ReactorObjectId getProcessId()
returns the id of the Process that must have a particular Status for this Condition to be true.

Returns:
the id of the Process that must have a particular Status for this Condition to be true.

setStatusId

public void setStatusId(com.oakgrovesystems.reactor.ReactorObjectId statusId)
sets the id of the Status that a particular Process must have for this Condition to be true.

Parameters:
statusId - the id of the Status that a particular Process must have for this Condition to be true.

getStatusId

public com.oakgrovesystems.reactor.ReactorObjectId getStatusId()
returns the id of the Status that a particular Process must have for this Condition to be true.

Returns:
the id of the Status that a particular Process must have for this Condition to be true.

sameAs

public boolean sameAs(java.lang.Object o)
tests this ProcessHasStatusCondition for content equality with another object. Instances of different classes return false

Specified by:
sameAs in interface ProcessCondition
Specified by:
sameAs in class AbstractProcessCondition
Parameters:
o - the object to compare with this ProcessHasStatusCondition
Returns:
a boolean indicating whether or not the objects are equal

copy

public com.oakgrovesystems.reactor.processMediation.ProcessCondition copy()
Clones this ProcessHasStatusCondition. This method is identical to clone().

Specified by:
copy in interface ProcessCondition
Specified by:
copy in class AbstractProcessCondition
Returns:
the clone

clone

public java.lang.Object clone()
Clones this ProcessHasStatusCondition. This method is identical to copy()

Overrides:
clone in class java.lang.Object
Returns:
the clone

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright (c) 1999-2004 Oak Grove Systems. All Rights Reserved.