SL-GMS Enterprise RTView Customization

com.sl.gmsjrtview
Class GmsCustomUserManager

java.lang.Object
  extended by com.sl.gmsjrtview.GmsCustomUserManager

public class GmsCustomUserManager
extends java.lang.Object

The GmsCustomUserManager class provides a way for the user to customize user login.


Constructor Summary
GmsCustomUserManager()
          Creates a GmsCustomRoleManager.
 
Method Summary
 boolean activate()
          This method is called after the constructor.
 void clientLogin(java.lang.String userName, java.lang.String role, java.lang.String sessionID)
          In the display server and data server applications, this method is invoked when a client user logs in.
 void clientLogout(java.lang.String userName, java.lang.String role, java.lang.String sessionID)
          In the display server and data server applications, this method is invoked when a client user logs out.
 java.lang.String getPassword(java.lang.String userName)
          This method must return the password for the specified user, or null if if the user is not recognized.
 java.util.Vector getRoleNamesForUser(java.lang.String userName)
          This method must return a Vector containing the role names for the specified user.
 java.util.Vector[] getSubstitutions(java.lang.String userName)
          This method should return substitutions to set on the Enterprise RTView application when the specified user is logged in.
 void invalidateLogin()
          This method is called if the user presses Reset in the login dialog.
 boolean userHasMultipleRoles(java.lang.String userName)
          This method must return true if the specified user has multiple roles, otherwise false.
 boolean validateClientCredentials(java.lang.String userName, java.lang.String password)
          This method is called from server applications to validate the userName and password provided by a client application.
 boolean validateLogin(java.lang.String userName, java.lang.String password)
          This method is called from the login dialog to validate the userName and password.
protected  int validateLoginOnDefaultDataServer(java.lang.String userName, java.lang.String password, java.util.Vector rolesReturn)
          Call this method to validate a login on the default data server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GmsCustomUserManager

public GmsCustomUserManager()
Creates a GmsCustomRoleManager. Subclasses do not need to override this method.

Method Detail

activate

public boolean activate()
This method is called after the constructor. Subclasses should override this method to initialize any data needed to validate the userName and password. This method should return true if the initialization was successful, otherwise return false. If this method returns false, the login will be considered invalid and Enterprise RTView will exit.


clientLogin

public void clientLogin(java.lang.String userName,
                        java.lang.String role,
                        java.lang.String sessionID)
In the display server and data server applications, this method is invoked when a client user logs in. There is a unique sessionID for each client login session.


clientLogout

public void clientLogout(java.lang.String userName,
                         java.lang.String role,
                         java.lang.String sessionID)
In the display server and data server applications, this method is invoked when a client user logs out. There is a unique sessionID for each client login session.


getPassword

public java.lang.String getPassword(java.lang.String userName)
This method must return the password for the specified user, or null if if the user is not recognized. This method is called for data sources to use when Use Client Credentials is enabled. Some data sources do not support this feature. For information on Application Options for your data source, refer to the Data Sources section of the Enterprise RTView User Guide.

Parameters:
userName - the user to return the password for

getRoleNamesForUser

public java.util.Vector getRoleNamesForUser(java.lang.String userName)
This method must return a Vector containing the role names for the specified user. Each user is required to have at least one role.

Parameters:
userName - the name of the user

getSubstitutions

public java.util.Vector[] getSubstitutions(java.lang.String userName)
This method should return substitutions to set on the Enterprise RTView application when the specified user is logged in. If this user does not have any associated substitutions, this method should return null. Otherwise, return a pair of Vectors. Both Vectors must be the same length, with the first Vector containing the substutition strings and the second Vector containing the corresponding substitution values.

Parameters:
userName - the user to return substitutions for

invalidateLogin

public void invalidateLogin()
This method is called if the user presses Reset in the login dialog. The Reset button clears the fields so the user can set a new user name and password. If subclasses stored the userName or password from validateLogin() or the status of whether they were valid these values should be cleared.


userHasMultipleRoles

public boolean userHasMultipleRoles(java.lang.String userName)
This method must return true if the specified user has multiple roles, otherwise false.

Parameters:
userName - the name of the user

validateClientCredentials

public boolean validateClientCredentials(java.lang.String userName,
                                         java.lang.String password)
This method is called from server applications to validate the userName and password provided by a client application. Subclasses should override this method to return true if the userName and password are valid, otherwise false. The default implementation simply calls this.validateLogin(userName, password) and returns the result.

Parameters:
userName - the name of the user to validate
password - the password to validate

validateLogin

public boolean validateLogin(java.lang.String userName,
                             java.lang.String password)
This method is called from the login dialog to validate the userName and password. Subclasses should override this method to return true if the userName and password are valid, otherwise return false. If there are no roles defined for the specified user, the login will fail, even if this method returns true.

Parameters:
userName - the name of the user to validate
password - the password to validate

validateLoginOnDefaultDataServer

protected int validateLoginOnDefaultDataServer(java.lang.String userName,
                                               java.lang.String password,
                                               java.util.Vector rolesReturn)
Call this method to validate a login on the default data server.

Parameters:
userName - the name of the user to validate
password - the password to validate
rolesReturn - if the credentials are successfully validated by the server, the roles for will be added to this Vector, if non-null.
Returns:
zero if valid, -1 if login fails, -2 if the default data server is undefined or unavailable.

SL-GMS Enterprise RTView Customization

Copyright 2009 Sherrill-Lubinski Corporation, 240 Tamal Vista Blvd
Corte Madera, CA 94925, U.S.A. All Rights Reserved