Enterprise RTView® 
User Guide


Custom User Manager

Defining Users in a Custom User Manager Class
NOTE: This section assumes you have a working knowledge of writing, compiling and deploying Java classes.

The Custom User Manager class extends the functionality of Enterprise RTView by allowing you to write Java code that gets called when the user is logs in. You can use this class to implement your own mechanism for validating users, such as getting user information from a database or LDAP server. To implement your own Custom User Manager, create a Java class named MyUserManager.java that extends com.sl.gmsjrtview.GmsCustomUserManager.

The following methods are available to overwrite in the MyUserManager:
 
Method Name Description
public boolean activate () This method is called after the constructor. Subclasses should overwrite 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.
public boolean validateLogin (String userName, String password) This method is called from the login dialog to validate the userName and password. Subclasses should overwrite 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.
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 userName and password. If subclasses stored the userName or password from validateLogin() or the status of whether they were valid these values should be cleared.
public boolean userHasMultipleRoles (String userName) This method must return true if the specified user has multiple roles, otherwise false.
public Vector getRoleNamesForUser (String userName) This method must return a Vector containing the role names for the specified user. This method will only be called if userHasMultipleRoles() returns true for the specified user. Each user is required to have at least one role.
public String getRole (String userName) This method is only called if the login is valid and the user only has one role. If the user has multiple roles, the role selected in the login dialog is used. Users should overwrite this method to return the role for the specified user. Each user is required to have at least one role.
getSubstitutions (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 substitution strings and the second Vector containing the corresponding substitution values.
getPassword (String userName) This method must return the password for the specified user, or null if the user is not recognized.

This method is called for data sources that have the Use Client Credentials option selected. If the Use Client Credentials feature is not used in your application, this method can return null for all users. NOTE: Some data sources do not support this feature. For information on Application Options for your data source, refer to the Data Sources section of this documentation.

Add gmsjrtview.jar located in the lib directory (found in your installation directory) to your classpath when you compile your Custom User Manager. You must include your compiled Custom User Manager class in the classpath for Enterprise RTView by adding it to the definition for the RTV_USERPATH environment variable or by packing it into myclasses.jar. If you will be using the Custom User Manager class with the Display Viewer Applet, include it in a .jar that is referenced in the Applet's ARCHIVE parameter.  


 
SL, SL-GMS, GMS, Enterprise RTView, SL Corporation, and the SL logo are trademarks or registered trademarks of Sherrill-Lubinski Corporation in the United States and other countries. Copyright © 1998-2008 Sherrill-Lubinski Corporation. All Rights Reserved.

 
JMS, JMX and Java are trademarks and/or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. They are mentioned in this document for identification purposes only.