at.ac.tuwien.infosys.sm4all.copal.api.event
Class CurrentAction

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.event.CurrentAction
All Implemented Interfaces:
ContextEventAction

public class CurrentAction
extends java.lang.Object
implements ContextEventAction

Class which defines a action that is currently being executed on an event. This class has one-to-one association with the BaseEvent.

Author:
sanjin

Constructor Summary
CurrentAction(java.lang.String name, boolean required)
          Create instance of CurrentAction with specified name and requirement.
CurrentAction(UnprocessedAction action)
          Create instance of the CurrentAction from specified UnprocessedAction.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this CurrentAction to the specified Object.
 java.lang.String getName()
          Returns the name of this ContextEventAction.
 java.lang.String[] getProcessedBy()
           
 int hashCode()
          Returns hash code for this CurrentAction.
 boolean isProcessed()
           
 boolean isRequired()
           
 void processedBy(java.lang.String processor)
          Adds specified processor name to the array of processors that processed this CurrentAction.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurrentAction

public CurrentAction(java.lang.String name,
                     boolean required)
Create instance of CurrentAction with specified name and requirement.

Parameters:
name - the name of the CurrentAction.
required - if the CurrentAction should be required.
Throws:
java.lang.NullPointerException - if specified name is null.
java.lang.IllegalArgumentException - if specified name is an empty or blank string.

CurrentAction

public CurrentAction(UnprocessedAction action)
Create instance of the CurrentAction from specified UnprocessedAction. Name and required properties of the UnprocessedAction are copied.

Parameters:
action - the UnprocessedAction.
Throws:
java.lang.NullPointerException - if specified UnprocessedAction is null.
Method Detail

getName

public java.lang.String getName()
Description copied from interface: ContextEventAction
Returns the name of this ContextEventAction.

Specified by:
getName in interface ContextEventAction
Returns:
the name of this ContextEventAction.

isRequired

public boolean isRequired()
Returns:
if the CurrentAction is required.

getProcessedBy

public java.lang.String[] getProcessedBy()
Returns:
name of all processors that processed this CurrentAction.

isProcessed

public boolean isProcessed()
Returns:
if the CurrentAction has been processed by at least one processor.

processedBy

public void processedBy(java.lang.String processor)
Adds specified processor name to the array of processors that processed this CurrentAction. Processor name cannot be null or an empty or blank string.

Parameters:
processor - the name of the processor.
Throws:
java.lang.NullPointerException - if specified processor name is null.
java.lang.IllegalArgumentException - if specified processor name is an empty or blank string.

hashCode

public int hashCode()
Returns hash code for this CurrentAction. The hash code for a CurrentAction object is hash code of its name.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this CurrentAction.

equals

public boolean equals(java.lang.Object obj)
Compares this CurrentAction to the specified Object. The result is true if and only if the argument is not null and is CurrentAction object that has same name, requirement and processors as this CurrentAction.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the Object to compare this CurrentAction against.
Returns:
true if CurrentActions are equal; false otherwise.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.