PaP
Class RoleSession

java.lang.Object
  |
  +--PaP.RoleSession
All Implemented Interfaces:
java.io.Serializable

public class RoleSession
extends java.lang.Object
implements java.io.Serializable

A RoleSession is a communication object between two Actors. Implementation of Role Session.

See Also:
GAI, Serialized Form

Field Summary
 GAI cooperator
          RoleSession cooperator
 GAI initiator
          RoleSession initiator
 java.lang.String roleSessionId
          RoleSession identifier
 
Constructor Summary
RoleSession(java.lang.String pRSI, GAI pInitiator, GAI pCooperator)
          Creates a new RoleSession and sets its ID, initiator and cooperator to the specified values.
 
Method Summary
 java.lang.String toString()
          Returns a string containing the ID, initiator and cooperator of this rolesession concatenated.
static java.lang.String toString(RoleSession rs)
          Returns a string representation of the specified rolesession by calling its toString() method and returning whatever it returns.
 boolean validate(int level)
          Validates this rolesession according to the specified level.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

roleSessionId

public java.lang.String roleSessionId
RoleSession identifier

initiator

public GAI initiator
RoleSession initiator

cooperator

public GAI cooperator
RoleSession cooperator
Constructor Detail

RoleSession

public RoleSession(java.lang.String pRSI,
                   GAI pInitiator,
                   GAI pCooperator)
Creates a new RoleSession and sets its ID, initiator and cooperator to the specified values.
Parameters:
pRSI - The rolesession ID.
pInitiator - The initiator of this rolesession.
pCooperator - The cooperator of this rolesession.
Method Detail

toString

public java.lang.String toString()
Returns a string containing the ID, initiator and cooperator of this rolesession concatenated.
Overrides:
toString in class java.lang.Object
Returns:
String form of the values of this rolesession.

toString

public static java.lang.String toString(RoleSession rs)
Returns a string representation of the specified rolesession by calling its toString() method and returning whatever it returns. If the rolesession is null an empty string is returned.
Parameters:
rs - The rolesession who's String representation is wanted.
Returns:
String form of the values of this rolesession.

validate

public boolean validate(int level)
Validates this rolesession according to the specified level. If level = 1 then it is valid if the ID, initiator and cooperator are not null. For any other value it returns false.
Parameters:
level - Specifies the type of validation to perform. If level = 1 then check no null value for all variables.
Returns:
Returns true if this rolesession is valid, false otherwise.