com.electrotank.electroserver4.extensions
Class LoginContext

java.lang.Object
  extended by com.electrotank.electroserver4.extensions.LoginContext

public class LoginContext
extends Object

Contains all information from a client attempting to login. This object is passed to the LoginEventHandler for processing. Changes to the LoginContext object made by a LoginEventHandler should be available to the client after a successful login.

See Also:
LoginEventHandler, BaseLoginEventHandler

Constructor Summary
LoginContext(EsObjectRO requestParametersIn, Map<String,Map<Object,Object>> extensionVars, Map<String,EsObject> userVariables, int passwordHashId)
          Creates a new instance of LoginContext
 
Method Summary
 void addExtensionBoundUserServerVariable(Object name, Object value)
           
 void addUserServerVariable(String name, EsObject value)
           
 void addUserVariable(String name, EsObject value)
           
 boolean doHashedPasswordsMatch(String unhashedPassword)
           
 Map<String,EsObject> getBuddyListEntries()
           
 Object getExtensionBoundUserServerVariable(Object name)
           
 String getPassword()
          Gets the password from the login attempt.
 int getPasswordHashId()
           
 String getPermissionSetId()
          Gets the name of the permission set for this user.
 EsObjectRO getRequestParameters()
           
 EsObject getResponseParameters()
           
 String getUserName()
          Gets the username from the login attempt.
 EsObject getUserServerVariable(String name)
           
 Map<String,EsObject> getUserServerVariables()
           
 EsObject getUserVariable(String name)
           
 Map<String,EsObject> getUserVariables()
           
 void setBuddyListEntries(Map<String,EsObject> buddyListEntries)
           
 void setCurrentExtension(String currentExtension)
           
 void setPassword(String password)
          Sets the password, in the LoginContext.
 void setPasswordHashId(int passwordHashId)
           
 void setPermissionSetId(String permissionSetId)
          Sets the name of the permission set for this user.
 void setUserName(String userName)
          Sets the username for the login attempt.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginContext

public LoginContext(EsObjectRO requestParametersIn,
                    Map<String,Map<Object,Object>> extensionVars,
                    Map<String,EsObject> userVariables,
                    int passwordHashId)
Creates a new instance of LoginContext

Method Detail

addUserServerVariable

public void addUserServerVariable(String name,
                                  EsObject value)

getUserServerVariable

public EsObject getUserServerVariable(String name)

addExtensionBoundUserServerVariable

public void addExtensionBoundUserServerVariable(Object name,
                                                Object value)

getExtensionBoundUserServerVariable

public Object getExtensionBoundUserServerVariable(Object name)

doHashedPasswordsMatch

public boolean doHashedPasswordsMatch(String unhashedPassword)

addUserVariable

public void addUserVariable(String name,
                            EsObject value)

getUserVariable

public EsObject getUserVariable(String name)

getRequestParameters

public EsObjectRO getRequestParameters()

getResponseParameters

public EsObject getResponseParameters()

getUserName

public String getUserName()
Gets the username from the login attempt.

Returns:
username

setUserName

public void setUserName(String userName)
Sets the username for the login attempt. Note: if the username has already been set by the client, it is generally not a good practice to change the username.

Parameters:
userName - User name to set

getPassword

public String getPassword()
Gets the password from the login attempt. Useful for comparing to a stored password.

Returns:
password

setPassword

public void setPassword(String password)
Sets the password, in the LoginContext. Will not alter any password stored elsewhere.

Parameters:
password - Password to set

getPermissionSetId

public String getPermissionSetId()
Gets the name of the permission set for this user.

Returns:
permissionSetId

setPermissionSetId

public void setPermissionSetId(String permissionSetId)
Sets the name of the permission set for this user. This permissionSetId needs to be listed in the web admin's list of permission sets.

Parameters:
permissionSetId - name of the permission set

getUserServerVariables

public Map<String,EsObject> getUserServerVariables()

getUserVariables

public Map<String,EsObject> getUserVariables()

setCurrentExtension

public void setCurrentExtension(String currentExtension)

getPasswordHashId

public int getPasswordHashId()

setPasswordHashId

public void setPasswordHashId(int passwordHashId)

getBuddyListEntries

public Map<String,EsObject> getBuddyListEntries()

setBuddyListEntries

public void setBuddyListEntries(Map<String,EsObject> buddyListEntries)


Copyright © 2007 Electrotank, Inc. All Rights Reserved.