|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.util.login.LoginBeanCFBValidate
public class LoginBeanCFBValidate
The LoginBeanCFBValidate class is an implementation of the LoginBeanValidateInterface for com.sas.util.connection.ConnectionFactoryBean. It performs login credential validation for the com.sas.services.connection.ConnectionFactory represented by the bean. This class can be set as a validation handler for the LoginBean and the bean will then perform ConnectionFactory validation for the credentials entered in by the user.
The following example illustrates a typical use of the LoginBean in conjunction with this class.
LoginBean loginBean = new LoginBean(); loginBean.setTitle("Enter your username and password:"); // Provide a default value for the username. loginBean.setUsername("James"); // Allow 2 retry attempts before failing (default is 3). loginBean.setAttempts(2); // Instantiate the LoginBeanSwingUtil class using the constructor which sets the // login bean as the model. LoginBeanSwingUtil loginBeanSwingUtil = new LoginBeanSwingUtil(loginBean); // Set our LoginBeanSwingUtil instance as the action handler for the login bean. // Note that the LoginBeanSwingUtil class implements LoginBeanActionInterface as a convenience for // typical usage scenarios. loginBean.setActionHandler(loginBeanSwingUtil); // Instantiate this validation class, providing the login bean and connection factory in the constructor. // Note: The connectionFactory object is defined elsewhere. See the com.sas.util.connection.ConnectionFactoryBean // documentation for details on how to configure the ConnectionFactoryBean. LoginBeanCFBValidate CFBValidate = new LoginBeanCFBValidate(loginBean, connectionFactory); // Set this instance as the validation handler for the login bean. loginBean.setValidateHandler(CFBValidate); // Call the showDialog method to display a model Swing dialog with a visual representation // of the login bean. loginBeanSwingUtil.showDialog("LoginBean", null);
Field Summary | |
---|---|
protected ConnectionFactoryBean |
connectionFactoryBean
The associated LoginBean instance. |
protected boolean |
debug
A flag indicating whether debugging information should be displayed. |
protected com.sas.util.login.LoginBean |
loginBean
The associated LoginBean instance. |
Constructor Summary | |
---|---|
LoginBeanCFBValidate()
Default constructor. |
|
LoginBeanCFBValidate(com.sas.util.login.LoginBean loginBean,
ConnectionFactoryBean connectionFactoryBean)
Constructor allowing for the specification of a LoginBean and ConnectionFactoryBean |
Method Summary | |
---|---|
ConnectionFactoryBean |
getConnectionFactoryBean()
Returns the ConnectionFactoryBean instance associated with this class. |
boolean |
getDebug()
Returns the value for the debug property. |
com.sas.util.login.LoginBean |
getLoginBean()
Returns the LoginBean instance associated with this class. |
protected void |
init()
Initialization of member variables. |
static void |
main(java.lang.String[] argv)
|
void |
setConnectionFactoryBean(ConnectionFactoryBean bean)
Sets the ConnectionFactoryBean associated with this util class. |
void |
setDebug(boolean value)
Sets the debug property, which when enabled can assist in tracking down login validation problems. |
void |
setLoginBean(com.sas.util.login.LoginBean bean)
Sets the LoginBean associated with this util class. |
boolean |
validate(java.lang.String username,
java.lang.String password)
Implementation of the LoginBeanValidateInterface. |
Field Detail |
---|
protected com.sas.util.login.LoginBean loginBean
protected ConnectionFactoryBean connectionFactoryBean
protected boolean debug
Constructor Detail |
---|
public LoginBeanCFBValidate()
public LoginBeanCFBValidate(com.sas.util.login.LoginBean loginBean, ConnectionFactoryBean connectionFactoryBean)
loginBean
- An instance of LoginBean associated with this class.connectionFactoryBean
- An instance of a ConnectionFactoryBean associated with this class.Method Detail |
---|
protected void init()
public void setLoginBean(com.sas.util.login.LoginBean bean)
bean
- An instance of LoginBean to associate with this class.getLoginBean()
public com.sas.util.login.LoginBean getLoginBean()
setLoginBean(LoginBean)
public void setConnectionFactoryBean(ConnectionFactoryBean bean)
bean
- An instance of ConnectionFactoryBean to associate with this class.getConnectionFactoryBean()
public ConnectionFactoryBean getConnectionFactoryBean()
setConnectionFactoryBean(ConnectionFactoryBean)
public void setDebug(boolean value)
value
- The boolean value for whether or not debugging should be enabled.getDebug()
public boolean getDebug()
setDebug(boolean)
public boolean validate(java.lang.String username, java.lang.String password)
If exceptions are thrown during validation within the ConnectionFactoryBean, they are caught and analyzed to in an attempt to notify the LoginBean of the type of failure encountered. This information can then be presented to the user in some manner to highlight the type of problem.
validate
in interface com.sas.util.login.LoginBeanValidateInterface
username
- The name of the user.password
- The password for the specified username.
public static void main(java.lang.String[] argv)
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |