PaP
Class RoleFigureRequest

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

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

A RoleFigureRequest contains a set of parameters specified by an actor when he wants a RoleFigure to be plugged in or out. Plugging in a RoleFigure means to create a RoleSession between two actors where one of the actors is playing the wanted Role. An actor that wants to plugin a RoleFigure needs to specify the GAI of both the initiator and the cooperator of the RoleSession to be created, as well as the Role of the actor sending the request. By specifying the Role the receiving actors know what kind of an actor is sending the request and can therefore take appropriate actions depending on the sender. Note that the sender do not have to be either the initiator or the cooperator of the RoleSession. When an actor wants to plugout a RoleFigure he adds the GAI of the initiator and cooperator, the role of the sender as well as the RoleSession to be plugged out.

The request is sent to the Director by calling roleFigurePlugIn() or roleFigurePlugOut() that the actor inherits from ApplicationActor. The Director then forwards the request to both the initiator and the cooperator.

Version:
1.0
Author:
Lars Erik Liljebäck
See Also:
Serialized Form

Field Summary
 java.lang.String role
          Specifies what entity is trying to plugin the rolesession.
 RoleSession roleSession
          The rolesession to be added to the actor's RoleSessionCollection.
 GAI roleSessionCooperator
          Specifies the entity to be the initiator of the rolesession.
 GAI roleSessionInitiator
          Specifies the entity to be the initiator of the rolesession.
 
Constructor Summary
RoleFigureRequest(GAI rsInitiator, GAI rsCooperator)
          Creates a new RoleFigureRequest with the specified initiator and cooperator.
 
Method Summary
 java.lang.String toString()
          Returns a string form of this RoleFigureRequest.
 boolean validate()
          Returns true if this RoleFigureRequest is valid, meaning the roleSessionInitiator and roleSessionCooperator is not null, else it returns false.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

roleSessionInitiator

public GAI roleSessionInitiator
Specifies the entity to be the initiator of the rolesession.

roleSessionCooperator

public GAI roleSessionCooperator
Specifies the entity to be the initiator of the rolesession.

role

public java.lang.String role
Specifies what entity is trying to plugin the rolesession.

roleSession

public RoleSession roleSession
The rolesession to be added to the actor's RoleSessionCollection.
Constructor Detail

RoleFigureRequest

public RoleFigureRequest(GAI rsInitiator,
                         GAI rsCooperator)
Creates a new RoleFigureRequest with the specified initiator and cooperator.
Parameters:
rsInitiator - GAI of the initiator of the RoleSession to be created.
rsCooperator - GAI of the cooperator of the RoleSession to be created.
Method Detail

toString

public java.lang.String toString()
Returns a string form of this RoleFigureRequest. The string contains the values of the initiator and cooperator, the Role of the sender of the request and the value of the rolesession variable.
Overrides:
toString in class java.lang.Object
Returns:
The string form of this RoleFigureRequest.

validate

public boolean validate()
Returns true if this RoleFigureRequest is valid, meaning the roleSessionInitiator and roleSessionCooperator is not null, else it returns false.
Returns:
Returns wether this RoleFigureRequest is valid or not.