PaP
Class LoginRequest

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

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

This class contains the parameters specified by an actor when a user sends a request for logging himself into a PaP domain administrated by a Director.

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

Field Summary
static int DIRECTOR
          Used when a Director is sending a LoginRequest to another Director on behalf of a visitor user.
static int LOCAL
          Used when a user wants to login to his home PaP domain.
 java.lang.Object objectValue
          Variable for parameters of type Object.
 java.lang.String password
          Specifies the password of the user wanting to login.
static int REMOTE
          Used when a user wants to login to his home PaP domain from another domain.
 boolean resumeSession
          Specifies wether the user wants to resume a previously suspended session or if he wants to start a new session.
 int type
          Specifies the type of this LoginRequest.
 java.lang.String username
          Specifies the username of the user wanting to login.
static int VISITOR
          Used when a user wants to login to a PaP domain as a visitor.
 
Constructor Summary
LoginRequest(int loginType)
          Creates a new LoginRequest of the specifed type.
 
Method Summary
 java.lang.String toString()
          Returns the state of this LoginRequest in the form of a string.
 boolean validate()
          Validates this LoginRequest.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

DIRECTOR

public static final int DIRECTOR
Used when a Director is sending a LoginRequest to another Director on behalf of a visitor user.

LOCAL

public static final int LOCAL
Used when a user wants to login to his home PaP domain.

REMOTE

public static final int REMOTE
Used when a user wants to login to his home PaP domain from another domain. The request is sent to his current Director who forwards the request to the Director of his home PaP domain. This means the user is currently logged in as a visitor.

VISITOR

public static final int VISITOR
Used when a user wants to login to a PaP domain as a visitor.

type

public int type
Specifies the type of this LoginRequest.

username

public java.lang.String username
Specifies the username of the user wanting to login.

password

public java.lang.String password
Specifies the password of the user wanting to login.

resumeSession

public boolean resumeSession
Specifies wether the user wants to resume a previously suspended session or if he wants to start a new session. If a previous session have been suspended and the user specifies not to resume it, it is overwritten.

objectValue

public java.lang.Object objectValue
Variable for parameters of type Object.
Constructor Detail

LoginRequest

public LoginRequest(int loginType)
Creates a new LoginRequest of the specifed type.
Parameters:
loginType - The type of LoginRequest.
Method Detail

toString

public java.lang.String toString()
Returns the state of this LoginRequest in the form of a string. All the names and values of the instance variables are concatenated.
Overrides:
toString in class java.lang.Object
Returns:
The state of the LoginRequest as a String.

validate

public boolean validate()
Validates this LoginRequest. A valid LoginRequest must be of one of the predefined types, and the username and password must not be null.
Returns:
Returns true if this LoginRequest is valid, false otherwise.