com.uwyn.rife.authentication.credentials
Class RoleUser

java.lang.Object
  extended by com.uwyn.rife.site.Validation<ConstrainedBean,ConstrainedProperty>
      extended by com.uwyn.rife.authentication.credentials.RoleUser
All Implemented Interfaces:
Credentials, RememberMe, RoleUserCredentials, Constrained<ConstrainedBean,ConstrainedProperty>, ConstrainedPropertyListener, Validated, ValidatedConstrained<ConstrainedProperty>, Cloneable

public class RoleUser
extends Validation<ConstrainedBean,ConstrainedProperty>
implements RoleUserCredentials, RememberMe

Provides standard RoleUserCredentials functionalities by implementing the property accessors and setting up basic validation rules. These rules make the login and password mandatory and limit their length according to the settings in RifeConfig.Authentication.

Since:
1.0
Version:
$Revision: 3634 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)

Constructor Summary
RoleUser()
           
RoleUser(String login, String password)
           
RoleUser(String login, String password, String role)
           
 
Method Summary
protected  void activateValidation()
          This method is called at least once and maximum once when any method related to Validated rules, subjects and group or Constrained properties are used.
 String getLogin()
          Retrieves the submitted login.
 String getPassword()
          Retrieves the submitted password.
 boolean getRemember()
          Indicates whether the submitted credentials should be remembered.
 String getRole()
          Retrieves the submitted role.
 RoleUser login(String login)
           
 RoleUser password(String password)
           
 RoleUser remember(boolean remember)
           
 RoleUser role(String role)
           
 void setLogin(String login)
          Sets the login to submit.
 void setPassword(String password)
          Sets the password to submit.
 void setRemember(boolean remember)
          Sets whether the submitted credentials should be remembered.
 void setRole(String role)
          Sets the role to submit.
 
Methods inherited from class com.uwyn.rife.site.Validation
addConstrainedPropertyRules, addConstraint, addConstraint, addGroup, addRule, addValidationError, clone, constraintSet, countValidationErrors, focusGroup, generateConstrainedPropertyRules, getConstrainedBean, getConstrainedProperties, getConstrainedProperty, getErrorIndication, getGroup, getGroups, getLoadingErrors, getRules, getValidatedSubjects, getValidationErrors, hasPropertyConstraint, isSubjectValid, limitSubjectErrors, makeErrorValid, makeSubjectValid, provideValidatedBean, replaceValidationErrors, resetGroup, resetValidation, retrieveValidatedBean, unlimitSubjectErrors, validate, validate, validateGroup, validateGroup
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.uwyn.rife.site.Validated
addRule, addValidationError, countValidationErrors, getRules, getValidatedSubjects, getValidationErrors, isSubjectValid, limitSubjectErrors, makeErrorValid, makeSubjectValid, provideValidatedBean, replaceValidationErrors, resetValidation, retrieveValidatedBean, unlimitSubjectErrors, validate, validate
 

Constructor Detail

RoleUser

public RoleUser()

RoleUser

public RoleUser(String login,
                String password)

RoleUser

public RoleUser(String login,
                String password,
                String role)
Method Detail

activateValidation

protected void activateValidation()
Description copied from class: Validation
This method is called at least once and maximum once when any method related to Validated rules, subjects and group or Constrained properties are used.

By overriding this method, you can thus isolate all the validation setup code code and don't enforce a performance penalty at each object construction when doing it in the default constructor.

Overrides:
activateValidation in class Validation<ConstrainedBean,ConstrainedProperty>

getLogin

public String getLogin()
Description copied from interface: RoleUserCredentials
Retrieves the submitted login.

Specified by:
getLogin in interface RoleUserCredentials
Returns:
the login

login

public RoleUser login(String login)

setLogin

public void setLogin(String login)
Description copied from interface: RoleUserCredentials
Sets the login to submit.

Specified by:
setLogin in interface RoleUserCredentials
Parameters:
login - the login

getPassword

public String getPassword()
Description copied from interface: RoleUserCredentials
Retrieves the submitted password.

Specified by:
getPassword in interface RoleUserCredentials
Returns:
the password

password

public RoleUser password(String password)

setPassword

public void setPassword(String password)
Description copied from interface: RoleUserCredentials
Sets the password to submit.

Specified by:
setPassword in interface RoleUserCredentials
Parameters:
password - the password

getRole

public String getRole()
Description copied from interface: RoleUserCredentials
Retrieves the submitted role.

Specified by:
getRole in interface RoleUserCredentials
Returns:
the role

role

public RoleUser role(String role)

setRole

public void setRole(String role)
Description copied from interface: RoleUserCredentials
Sets the role to submit.

Specified by:
setRole in interface RoleUserCredentials
Parameters:
role - the role

getRemember

public boolean getRemember()
Description copied from interface: RememberMe
Indicates whether the submitted credentials should be remembered.

Specified by:
getRemember in interface RememberMe
Returns:
true if the submitted credentials should be remembered; or

false otherwise


remember

public RoleUser remember(boolean remember)

setRemember

public void setRemember(boolean remember)
Description copied from interface: RememberMe
Sets whether the submitted credentials should be remembered.

Specified by:
setRemember in interface RememberMe
Parameters:
remember - true if the submitted credentials should be remembered; or false otherwise


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.