User.v1_1
Class LoginAgent

java.lang.Object
  |
  +--PaP.Actor
        |
        +--PaP.ApplicationActor
              |
              +--User.v1_1.LoginAgent
All Implemented Interfaces:
ActorInterface, ControlInterface, java.rmi.Remote, java.io.Serializable

public class LoginAgent
extends ApplicationActor

LoginAgent is the Plug-and-Play (PaP) specific class of this application. It is used for logging a user into a PaP domain. Each LoginAgent has an instance of LoginWindow which is the graphical user interface of the application. LoginAgent extends ApplicationActor and therefore has access to functionality provided by the PaP support system.

Version:
1.0 - 12.05.02
Author:
Lars Erik Liljebäck
See Also:
LoginWindow, sendLoginRequest(boolean, java.lang.String, java.lang.String, boolean), Serialized Form

Inner Class Summary
 class LoginAgent.CloseWindowThread
          This thread is started when an ActorPlugOut request is received.
 
Field Summary
private  boolean initiated
          Indicates wether initial ActorPlugIn has been performed or not
private  LoginWindow window
          The reference to an instance of LoginWindow
 
Fields inherited from class PaP.Actor
bf, context, fh
 
Constructor Summary
LoginAgent()
          Creates a new LoginAgent.
 
Method Summary
 RequestResult applicationActorEntry(RequestPars rpars)
          This method is the common entry point for all external requests to this actor.
 void closeApplication()
          This method is used by the GUI to notify that the user wants to close the application.
private  void dbg(java.lang.String dbg)
          Sends debug information to this actor's BaseFrame window, which is an interactive debug client window for several entities.
 void sendLoginRequest(boolean localUser, java.lang.String username, java.lang.String password, boolean resumeSession)
          Sends a configured LoginRequest to the Director.
 
Methods inherited from class PaP.ApplicationActor
actorBehaviourPlugIn, actorBehaviourPlugOut, actorCapabilities, actorChangeBehaviour, actorEntry, actorPlay, actorPlugIn, actorPlugOut, anyOtherRequestType, callActorChangeBehaviour, control, init, loginUser, logoutUser, playChangesPlugIn, playPlugIn, playPlugOut, requestToActor, roleFigurePlugIn, roleFigurePlugOut, roleSessionAction, sessionResume, sessionSuspend, sessionUpdate, subscribeCancel, subscribeReport, subscribeRequest
 
Methods inherited from class PaP.Actor
findRoleSession, getGAI, start, status, term
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

initiated

private boolean initiated
Indicates wether initial ActorPlugIn has been performed or not

window

private LoginWindow window
The reference to an instance of LoginWindow
Constructor Detail

LoginAgent

public LoginAgent()
Creates a new LoginAgent.
Method Detail

applicationActorEntry

public RequestResult applicationActorEntry(RequestPars rpars)
                                    throws java.lang.Exception
This method is the common entry point for all external requests to this actor. Checks which type of request was received and performs the appropriate actions based on the type.
Overrides:
applicationActorEntry in class ApplicationActor
Parameters:
rpars - Instance of RequestPars which specifies type of request and additional parametres to the request.
Returns:
An instance of RequestResult which indicates success or failure in treatment of the request.
Throws:
java.lang.Exception -  

closeApplication

public void closeApplication()
This method is used by the GUI to notify that the user wants to close the application. It sends an ActorPlugOut request to the Director.

sendLoginRequest

public void sendLoginRequest(boolean localUser,
                             java.lang.String username,
                             java.lang.String password,
                             boolean resumeSession)
                      throws java.lang.Exception
Sends a configured LoginRequest to the Director. If localUser is true then the request is of type LOCAL, else it is of type VISITOR. If the user successfully loggs in as LOCAL then a UserAgent is plugged in, else a VisitorAgent is plugged in. In order for a user to login to a remote Director he first needs to login as VISITOR and then send a REMOTE LoginRequest from the VisitorAgent.

The LoginRequest contains the specified username and password and indicates wether a stored session is to be resumed or not. A visitor user has no session to resume.
Parameters:
localUser - Indicates wether the LoginRequest is of type LOCAL or VISITOR.
username - The username of the user logging in.
password - The password of the user logging in.
resumeSession - If true the user's stored session is resumed, else a new session is created.
Throws:
java.lang.Exception - if something goes wrong.

dbg

private void dbg(java.lang.String dbg)
Sends debug information to this actor's BaseFrame window, which is an interactive debug client window for several entities.
Overrides:
dbg in class ApplicationActor
Parameters:
dbg - The debug information to be sent.