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 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 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 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 clientLogin (String userName, String role, String sessionID) This method is called when a client user logs in to Display Server and Data Server applications. There is a unique sessionID for each client login session.
public void clientLogout (String userName, String role, String sessionID) This method is called when a client user logs out from Display Server and Data Server applications. There is a unique sessionID for each client login session.
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 int validateLoginOnDefaultDataServer (String userName, String password) This method is called to allow the Custom User Manager to request validation from the default Data Server.

This method returns 0 if userName and password are valid, -1 if login fails and -2 if the default Data Server is undefined or unavailable.

getSubstitutions (String userName) This method should return substitutions to set on the 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 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, 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-2012 Sherrill-Lubinski Corporation. All Rights Reserved.

 

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

 

Third Party Notice Requirements