at.ac.tuwien.infosys.sm4all.copal.api
Class ProcessorAction

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.ProcessorAction

public class ProcessorAction
extends Object

Class which defines action which a ContextProcessor can process. The name and the event name of processor action uniquely defines the ContextEventAction and its associated ContextEventType using same values of ContextEventAction.getName() and ContextEventType.getName() respectively. Each action also defines the names of events returned by the processor after processing the action.

Author:
sanjin

Constructor Summary
ProcessorAction(String name, String eventType)
          Creates an instance of processor action without a result.
ProcessorAction(String name, String eventType, String resultType)
          Creates an instance of processor action.
 
Method Summary
 boolean equals(Object obj)
          Compares this processor action to the specified object.
 String getEventType()
           
 String getName()
           
 String getResultType()
           
 int hashCode()
          Returns hash code for this processor action.
 boolean hasResult()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessorAction

public ProcessorAction(String name,
                       String eventType,
                       String resultType)
Creates an instance of processor action. The name is the globally unique name of the ContextEventAction and cannot be null. The eventType is the globally unique name of the ContextEventType and also cannot be null. The result is globally unique name of the ContextEventType of event returned by the processor as result of processing this action. If result is null then processor will not produce a result.

Parameters:
name - the globally unique name of the ContextEventAction.
eventType - the globally unique name of the ContextEventType .
resultType - the globally unique name of the ContextEventType for processor's result.
Throws:
NullPointerException - if specified name or event name is null.
IllegalArgumentException - if specified name or event name is an empty or blank string.

ProcessorAction

public ProcessorAction(String name,
                       String eventType)
Creates an instance of processor action without a result. The name is the globally unique name of the ContextEventAction and cannot be null. The eventType is the globally unique name of the ContextEventType and also cannot be null.

Parameters:
name - the globally unique name of the ContextEventAction.
eventType - the globally unique name of the ContextEventType .
Throws:
NullPointerException - if specified name or event name is null.
IllegalArgumentException - if specified name or event name is an empty or blank string.
Method Detail

getName

public String getName()
Returns:
the globally unique name of the ContextEventAction.

getEventType

public String getEventType()
Returns:
the globally unique name of the ContextEventType.

getResultType

public String getResultType()
Returns:
the name of ContextEventType for processor's result.

hasResult

public boolean hasResult()
Returns:
if this processor action produces a result.

hashCode

public int hashCode()
Returns hash code for this processor action. The hash code for a ProcessorAction object is computed as:
 name * 31 + event type
 
using integer arithmetic.

Overrides:
hashCode in class Object
Returns:
a hash code value for this processor action.

equals

public boolean equals(Object obj)
Compares this processor action to the specified object. The result is true if and only if the argument is not null and is a ProcessorAction object that has same name and event name as this processor action.

Overrides:
equals in class Object
Parameters:
obj - the object to compare this processor action against.
Returns:
true if processor actions are equal; false otherwise.


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