ajanta.pattern
Class Pattern

java.lang.Object
  |
  +--ajanta.pattern.Pattern
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
ItinEntry, PatternCollection

public abstract class Pattern
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Pattern is a abstract class. Every pattern is associated with an action that the agent performs at the host it visits. This is overridden to specialize the action.

See Also:
Serialized Form

Field Summary
 ajanta.util.MethodSpec action
          MethodSpec of the action that an agent perform on a host
static int DONE
          Pattern action was successfuly completed
static int FAILED
          Pattern action failed due to some reason
static int NOTDONE
          Pattern action is yet to be performed
 int status
          Current status of the pattern
 
Constructor Summary
Pattern()
           
 
Method Summary
 java.lang.String getName()
           
protected abstract  int next(ajanta.server.AgentEnv host)
          The pattern traversal is determined by the abstarct method next.
abstract  void print()
          It prints inforamtion about the pattern i.e its status, destination server etc
protected abstract  void reset()
          It reset the current state of the pattern to initial state
protected abstract  void scan()
          It is used to scan the pattern
 void setName(java.lang.String name)
          It sets the name of the pattern to the name passed as argument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DONE

public static final int DONE
Pattern action was successfuly completed

See Also:
Constant Field Values

NOTDONE

public static final int NOTDONE
Pattern action is yet to be performed

See Also:
Constant Field Values

FAILED

public static final int FAILED
Pattern action failed due to some reason

See Also:
Constant Field Values

status

public int status
Current status of the pattern


action

public ajanta.util.MethodSpec action
MethodSpec of the action that an agent perform on a host

Constructor Detail

Pattern

public Pattern()
Method Detail

next

protected abstract int next(ajanta.server.AgentEnv host)
                     throws java.net.UnknownHostException
The pattern traversal is determined by the abstarct method next. It captures the notion of next hop in the migration path of the agent. Each pattern has its own semantics to determine the next hop

java.net.UnknownHostException

reset

protected abstract void reset()
It reset the current state of the pattern to initial state


scan

protected abstract void scan()
It is used to scan the pattern


print

public abstract void print()
It prints inforamtion about the pattern i.e its status, destination server etc


setName

public void setName(java.lang.String name)
It sets the name of the pattern to the name passed as argument


getName

public java.lang.String getName()
Returns:
If the name is not null it returns the name of pattern else Agent