public abstract class AuthNValidator extends Object implements Validator
package org.mycompany.myutil; import org.apache.directory.fortress.core.model.Constraint; import org.apache.directory.fortress.core.model.Session; import org.apache.directory.fortress.core.util.time.Time; public class AuthNUserValidator extends AuthNValidator
public int validate(Session session, Constraint constraint, Time time, VUtil.ConstraintType type ) { super.setRoleName( "AuthNUsers" ); super.setAuthenticated( true ); return super.validate( session, constraint, time, type ); }
// This can be any valid role name here: super.setRoleName( "AuthNUsers" );
// This can be true or false: super.setAuthenticated( true );
temporal.validator.0:org.apache.directory.fortress.core.util.time.Date temporal.validator.1:org.apache.directory.fortress.core.util.time.LockDate temporal.validator.2:org.apache.directory.fortress.core.util.time.Timeout temporal.validator.3:org.apache.directory.fortress.core.util.time.ClockTime temporal.validator.4:org.apache.directory.fortress.core.util.time.Day temporal.validator.5:org.mycompany.myutil.AuthNUserValidator
Constructor and Description |
---|
AuthNValidator() |
Modifier and Type | Method and Description |
---|---|
protected String |
getRoleName() |
protected boolean |
isAuthenticated() |
protected void |
setAuthenticated(boolean isAuthenticated) |
protected void |
setRoleName(String roleName) |
int |
validate(Session session,
Constraint constraint,
Time time,
VUtil.ConstraintType type)
This method is called during user-role activation,
.VUtil#validateConstraints and ensures the current user has been
proper authentication status before activating the specified role into the session. |
public int validate(Session session, Constraint constraint, Time time, VUtil.ConstraintType type)
.VUtil#validateConstraints
and ensures the current user has been
proper authentication status before activating the specified role into the session.
This validation routine will automatically pass if session.isAuthenticated matches the isAuthenticated member variable AND the role matches the subclasses name AND type == ROLE.
validate
in interface Validator
session
- contains the isAuthenticated flag. If 'true', user must be authenticated before role may be
authenticated. If 'false' user must not be authenticated for role to activate.constraint
- contains the role name.time
- contains the current time stamp.type
- only constraints of type role use this..GlobalErrIds#ACTV_FAILED_AUTHN
if failed.protected String getRoleName()
protected void setRoleName(String roleName)
protected boolean isAuthenticated()
protected void setAuthenticated(boolean isAuthenticated)
Copyright © 2003-2016, The Apache Software Foundation. All Rights Reserved. Generated 20160718-1621