com.electrotank.electroserver.plugins.utilities
Class LoginResponse

java.lang.Object
  extended bycom.electrotank.electroserver.plugins.utilities.EventResponse
      extended bycom.electrotank.electroserver.plugins.utilities.LoginResponse

public class LoginResponse
extends EventResponse

Represents the response from a LoginEventHandler. The event handler will populate this object with the users' details.


Constructor Summary
LoginResponse(boolean loginSuccessful, String message)
          Constructs a new LoginResponse and sets the loginSuccess boolean as well as the message that will be returned to the user.
 
Method Summary
 void addUserServerVariable(Object key, Object value)
          Adds a single user server variable to the LoginResponse.
 String getUsername()
          Gets the username from the LoginResponse.
 Map getUserServerVariables()
          Returns the Map that contains the userServerVariables defined by the event handler.
 boolean isLoginSuccessful()
          Returns the value of the loginSuccessful boolean.
 boolean isModerator()
          Returns the value of the isModerator boolean.
 void removeUserServerVariable(Object key)
          Removes a specific user server variable based on the key.
 void setLoginSuccessful(boolean loginSuccessful)
          Sets the value of the loginSuccessful boolean.
 void setModerator(boolean moderator)
          Sets the value of the isModerator boolean.
 void setUsername(String username)
          Sets the username on the LoginResponse.
 void setUserServerVariables(Map userServerVariables)
          Sets the user server variables with a Map.
 
Methods inherited from class com.electrotank.electroserver.plugins.utilities.EventResponse
addResponseVariable, getMessage, getResponseVariables, removeResponseVariable, setMessage, setResponseVariables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginResponse

public LoginResponse(boolean loginSuccessful,
                     String message)
Constructs a new LoginResponse and sets the loginSuccess boolean as well as the message that will be returned to the user.

Parameters:
loginSuccessful - a boolean indicating if the user successfully logged in or not.
message - a String that is returned to the calling user. Typically this contains a message that indicates why login failed or not.
Method Detail

isLoginSuccessful

public boolean isLoginSuccessful()
Returns the value of the loginSuccessful boolean.

Returns:
true if the login was successful, false otherwise.

setLoginSuccessful

public void setLoginSuccessful(boolean loginSuccessful)
Sets the value of the loginSuccessful boolean.

Parameters:
loginSuccessful - a boolean indicating if the login was successful or not.

isModerator

public boolean isModerator()
Returns the value of the isModerator boolean.

Returns:
true if the user is a moderator, false otherwise.

setModerator

public void setModerator(boolean moderator)
Sets the value of the isModerator boolean.

Parameters:
moderator - a boolean indicating if this user is a moderator or not.

getUserServerVariables

public Map getUserServerVariables()
Returns the Map that contains the userServerVariables defined by the event handler.

Returns:
a Map containing the user server variables.

setUserServerVariables

public void setUserServerVariables(Map userServerVariables)
Sets the user server variables with a Map.

Parameters:
userServerVariables - a Map containing all the user server variables to be set on this LoginResponse.

addUserServerVariable

public void addUserServerVariable(Object key,
                                  Object value)
Adds a single user server variable to the LoginResponse.

Parameters:
key - the variable key/name.
value - the variable value.

removeUserServerVariable

public void removeUserServerVariable(Object key)
Removes a specific user server variable based on the key.

Parameters:
key - the key of the user server variable to remove.

setUsername

public void setUsername(String username)
Sets the username on the LoginResponse.

Parameters:
username - the username to set.

getUsername

public String getUsername()
Gets the username from the LoginResponse.

Returns:
the username.


Copyright © 2006 Electrotank, Inc. All Rights Reserved.