org.mega.gasp.platform.impl
Class ActorSessionImpl

java.lang.Object
  extended byorg.mega.gasp.platform.impl.ActorSessionImpl
All Implemented Interfaces:
ActorSession

public class ActorSessionImpl
extends java.lang.Object
implements ActorSession

ActorSession represent the link between a user (represented by instances of Session and Actor) and an ApplicationInstance. It receive and transmit all the events or message in an ApplicationInstance, in game it is the communication link between the client and the game session server.

Author:
PELLERIN Romain (pellerin@cnam.fr) - MEGA Project

Field Summary
private  int actorID
           
private  int actorSessionID
           
private  int applicationInstanceID
           
private  org.apache.log4j.Category cat
           
private  java.util.Vector events
           
private  java.lang.String pseudo
           
private  boolean pseudoModified
           
private  int sessionID
           
 
Constructor Summary
ActorSessionImpl(int aIID, Session session)
           
 
Method Summary
 int getActorID()
          Returns the Actor ID of the user.
 int getActorSessionID()
          Returns the ActorSession ID.
 int getApplicationInstanceID()
          Returns the ApplicationInstance ID linked.
 java.util.Vector getEvents()
          Return the events stored since the last request from the actor.
 java.lang.String getPseudoName()
          Returns the current pseudo name of the user session.
 int getSessionID()
          Returns the Session ID of the user
 boolean isPseudoHasModified()
          Tells if the pseudo has modified during the session.
private  java.util.Vector purgeEvents(java.util.Vector v)
          Purge the deprecated events.
 void raiseEvent(Event e)
          Put the event on the stack of the events must be read by the actor.
 void setPseudoName(java.lang.String name)
          Set the current pseudo name of the user session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applicationInstanceID

private int applicationInstanceID

actorID

private int actorID

sessionID

private int sessionID

actorSessionID

private int actorSessionID

pseudo

private java.lang.String pseudo

events

private java.util.Vector events

cat

private org.apache.log4j.Category cat

pseudoModified

private boolean pseudoModified
Constructor Detail

ActorSessionImpl

public ActorSessionImpl(int aIID,
                        Session session)
Method Detail

getApplicationInstanceID

public int getApplicationInstanceID()
Returns the ApplicationInstance ID linked.

Specified by:
getApplicationInstanceID in interface ActorSession
Returns:
the ApplicationInstance ID

getActorID

public int getActorID()
Returns the Actor ID of the user.

Specified by:
getActorID in interface ActorSession
Returns:
the Actor ID

getSessionID

public int getSessionID()
Returns the Session ID of the user

Specified by:
getSessionID in interface ActorSession
Returns:
the Session ID

getActorSessionID

public int getActorSessionID()
Returns the ActorSession ID.

Specified by:
getActorSessionID in interface ActorSession
Returns:
the ActorSession ID.

getPseudoName

public java.lang.String getPseudoName()
Returns the current pseudo name of the user session.

Specified by:
getPseudoName in interface ActorSession
Returns:
the ActorSession ID

setPseudoName

public void setPseudoName(java.lang.String name)
Set the current pseudo name of the user session.

Specified by:
setPseudoName in interface ActorSession

isPseudoHasModified

public boolean isPseudoHasModified()
Tells if the pseudo has modified during the session.

Specified by:
isPseudoHasModified in interface ActorSession

getEvents

public java.util.Vector getEvents()
Return the events stored since the last request from the actor.

Specified by:
getEvents in interface ActorSession
Returns:
the stack of events

raiseEvent

public void raiseEvent(Event e)
Put the event on the stack of the events must be read by the actor.

Specified by:
raiseEvent in interface ActorSession
Parameters:
e - the Event

purgeEvents

private java.util.Vector purgeEvents(java.util.Vector v)
Purge the deprecated events.

Parameters:
v - the copy of the events vector