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
Field Summary |
private boolean |
initiated
Indicates wether initial ActorPlugIn has been performed or not |
private LoginWindow |
window
The reference to an instance of LoginWindow |
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 java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
initiated
private boolean initiated
- Indicates wether initial ActorPlugIn has been performed or not
window
private LoginWindow window
- The reference to an instance of LoginWindow
LoginAgent
public LoginAgent()
- Creates a new LoginAgent.
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.