This class is for internal purpose only and is subjected to change. Developers are recommended not to use this API
com.adventnet.nms.client
Interface ValidateCredentials
- public interface ValidateCredentials
ValidateCredentials is an interface to do a custom validation over the password field.
The interface is defined with the single method validate().
The implementing class can do custom validation like to ensure the password is the combination
of uppercase, lowercase and special characters etc.
It needs to return false/true based on unsuccessful and successful validation and can show
error dialog to the User at error condition and return false like
public boolean validate(String userName,String oldPassword, String newPassword)
{
if(!isAlphaNumeric(newPassword))
{
JOptionPane.showMessageDialog(null,"Password Should be Combination of Alpha-Numeric
SPecial characters","Change Password",JOptionPane.ERROR_MESSAGE);
return false;
}
return true;
}
The implementation class need to be configured at client configuration file
NMS_HOME/conf/clientparameters.conf file to the attribute 'Validator' like,
The default implementation supports password length(MIN/MAX) validation which can be done by
configuring the parameters PASSWD_MAX_LENGTH AND PASSWD_MIN_LENGTH in clientparameters.conf
file itself.
|
Method Summary |
boolean |
validate(java.lang.String userName,
java.lang.String oldPassword,
java.lang.String newPassword)
The WebNMS Client framework will invoke the method with neccessary arguments as username
current password and new password. |
validate
public boolean validate(java.lang.String userName,
java.lang.String oldPassword,
java.lang.String newPassword)
- The WebNMS Client framework will invoke the method with neccessary arguments as username
current password and new password.
Further it does a custom validation over the the given new password for a given user.
- Parameters:
userName - UserNameoldPassword - Current Password of the UsernewPassword - New Password of the User- Returns:
- boolean value as true if custom validation is successful or false otherwise.