MicroTAPAS
Class RoleSessionCollection

java.lang.Object
  |
  +--MicroTAPAS.RoleSessionCollection
All Implemented Interfaces:
java.io.Serializable

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

Collection of Role Sessions an actor holds for Actor class

See Also:
Serialized Form

Field Summary
private  java.util.Vector vRS
          Vector containing all the registered RoleSessions of this collection.
 
Constructor Summary
RoleSessionCollection()
          Constructor
RoleSessionCollection(RoleSessionCollection rsc)
          Constructor.
 
Method Summary
 boolean actorMove(GAI oldGAI, GAI newGAI)
          Updates all RoleSessions to reflect an actor move
 void addRoleSession(RoleSession pRS)
          Adds the specified RoleSession to the Collection
 RoleSession findRoleSession(java.lang.String pRSId)
          Finds a RoleSession specified by its name String
 java.util.Vector getAllCooperators(GAI init)
          Method to retreive all the cooperting actors of a particular actor.
 java.util.Vector getAllGAI()
          Method to get all the GAI's from the collection as a Vector of String representation of the GAI's.
 java.util.Vector getAllRS()
          Method to get all the RoleSessions from the collection.
 java.util.Vector getAllRSID()
          Method to get all the RoleSessionId's from the collection as a Vector of Strings.
 RoleSession getLastRoleSession()
          Finds the last added rolesession.
 int getNumRoleSessions()
          Returns the size of this RoleSessionCollection.
 RoleSession initialRoleSession()
          Method to find and return the initial Role Session
 boolean isLastRoleSession()
          Method to check if there is only one RoleSession left in collection.
 boolean isLastRoleSession(GAI pActor)
          Method to check if there is one or less RoleSessions left for the given actor.
 boolean lastRoleSession()
          Deprecated. Replaced by isLastRoleSession()
 boolean lastRoleSession(GAI pActor)
          Deprecated. Replaced by isLastRoleSession(GAI)
 Item listRoleSessions()
          List all RoleSessions in this Collection
 boolean noMoreRoleSessions()
          Simple utility to check wheter there are no more RoleSessions in this Collection
 boolean removeRoleSession(RoleSession pRS, boolean pApo)
          Removes the specified RoleSession from the Collection
 boolean terminalMove(java.lang.String oldNode, java.lang.String newNode)
          Updates all RoleSessions to reflect a move by a terminal
 java.lang.String toString()
          Overloaded toString() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vRS

private java.util.Vector vRS
Vector containing all the registered RoleSessions of this collection.

Constructor Detail

RoleSessionCollection

public RoleSessionCollection()
Constructor


RoleSessionCollection

public RoleSessionCollection(RoleSessionCollection rsc)
Constructor. Initiates this RoleSessionCollection with COPIES of the RoleSessions from the old RoleSessionCollection.

Method Detail

addRoleSession

public void addRoleSession(RoleSession pRS)
Adds the specified RoleSession to the Collection


removeRoleSession

public boolean removeRoleSession(RoleSession pRS,
                                 boolean pApo)
Removes the specified RoleSession from the Collection

Returns:
true iff the removed RoleSession was the last one in the Collection

noMoreRoleSessions

public boolean noMoreRoleSessions()
Simple utility to check wheter there are no more RoleSessions in this Collection

Returns:
true if there are no more RoleSessions

findRoleSession

public RoleSession findRoleSession(java.lang.String pRSId)
Finds a RoleSession specified by its name String

Parameters:
pRSId - The name of the RoleSession to be found
Returns:
The RoleSession Object that was found

initialRoleSession

public RoleSession initialRoleSession()
Method to find and return the initial Role Session

Returns:
The initial/first role session of this collection

lastRoleSession

public boolean lastRoleSession(GAI pActor)
Deprecated. Replaced by isLastRoleSession(GAI)

Method to check if there is one or less RoleSessions left for the given actor.

Parameters:
pActor - The GAI of the actor.
Returns:
True if last RoleSessoion, else false.

isLastRoleSession

public boolean isLastRoleSession(GAI pActor)
Method to check if there is one or less RoleSessions left for the given actor.

Parameters:
pActor - The GAI of the actor.
Returns:
True if last RoleSessoion, else false.

lastRoleSession

public boolean lastRoleSession()
Deprecated. Replaced by isLastRoleSession()

Method to check if there is only one RoleSession left in collection.

Returns:
True if last RoleSessoion, else false.

isLastRoleSession

public boolean isLastRoleSession()
Method to check if there is only one RoleSession left in collection.

Returns:
True if last RoleSessoion, else false.

getLastRoleSession

public RoleSession getLastRoleSession()
Finds the last added rolesession.

Returns:
The last RS that was added to this collection.

getNumRoleSessions

public int getNumRoleSessions()
Returns the size of this RoleSessionCollection.

Returns:
The number of RoleSession.

terminalMove

public boolean terminalMove(java.lang.String oldNode,
                            java.lang.String newNode)
Updates all RoleSessions to reflect a move by a terminal

Parameters:
oldNode - The old node of the terminal
newNode - The new node of the terminal
Returns:
Success indicator

actorMove

public boolean actorMove(GAI oldGAI,
                         GAI newGAI)
Updates all RoleSessions to reflect an actor move

Parameters:
oldGAI - The old GAI of the actor
newGAI - The new GAI of the actor
Returns:
Success indicator

getAllCooperators

public java.util.Vector getAllCooperators(GAI init)
Method to retreive all the cooperting actors of a particular actor.

Parameters:
init - The initiating actor.
Returns:
A vector containing all the GAI's of the coopertors.

getAllGAI

public java.util.Vector getAllGAI()
Method to get all the GAI's from the collection as a Vector of String representation of the GAI's.

Returns:
A vector containing all the GAI's as String objects.

getAllRS

public java.util.Vector getAllRS()
Method to get all the RoleSessions from the collection.

Returns:
A vector containing all the RoleSessions.

getAllRSID

public java.util.Vector getAllRSID()
Method to get all the RoleSessionId's from the collection as a Vector of Strings.

Returns:
A vector containing all the RoleSessionId's.

toString

public java.lang.String toString()
Overloaded toString() method.

Overrides:
toString in class java.lang.Object
Returns:
The String representation of this object.

listRoleSessions

public Item listRoleSessions()
List all RoleSessions in this Collection

Returns:
RoleSessions in an array of Strings


The Telematics Architecture for Plug-and-Play Systems (TAPAS) is a research project undertaken by the Norwegian University of Science and Technology's Telematics department which aims at developing an architecture for network-based service systems with a) flexibility and adaptability, b) robustness and survivability, and c) QoS awareness and resource control.

More information can be found at the project's homepage at http://tapas.item.ntnu.no and the project manager, Professor Finn Arve Aagesen, can be reached at finn.arve.aagesen@item.ntnu.no.