public class LockDate extends Object implements Validator
Constraint
. This validator will ensure the current date falls outside Constraint.getBeginLockDate()
and Constraint.getEndLockDate()
range.
The idea is an entity can be barred from activation for a particular blackout period, i.e. vacation, leave of absence, etc.
The data format requires YYYYMMDD, i.e. 20110101 for January 1, 2011. The constant GlobalIds.NONE
may be used to disable checks for a particular entity.
User
maps to 'ftCstr' attribute on 'ftUserAttrs' object classUserRole
maps to 'ftRC' attribute on 'ftUserAttrs' object classRole
maps to 'ftCstr' attribute on 'ftRls' object classAdminRole
maps to 'ftCstr' attribute on 'ftRls' object classUserAdminRole
maps to 'ftARC' attribute on 'ftRls' object classConstructor and Description |
---|
LockDate() |
Modifier and Type | Method and Description |
---|---|
int |
validate(Session session,
Constraint constraint,
Time time,
VUtil.ConstraintType type)
This method is called during entity activation,
VUtil.validateConstraints(org.apache.directory.fortress.core.model.Session, org.apache.directory.fortress.core.util.VUtil.ConstraintType, boolean) and ensures the current date falls
outside the Constraint.getBeginLockDate() and Constraint.getEndLockDate() range. |
public int validate(Session session, Constraint constraint, Time time, VUtil.ConstraintType type)
VUtil.validateConstraints(org.apache.directory.fortress.core.model.Session, org.apache.directory.fortress.core.util.VUtil.ConstraintType, boolean)
and ensures the current date falls
outside the Constraint.getBeginLockDate()
and Constraint.getEndLockDate()
range.
This validation routine will automatically pass if either beginLockDate or endLockDate equals null or "none".
If both beginLockDate and endLockDate are set the validator will ensure current date does not fall between the date range.
The format expected if date is set is YYYYMMDD. For example, '20110101' equals Jan 1, 2011.validate
in interface Validator
session
- required for Validator
interface but not used here.constraint
- contains the begin and end lock dates. Maps listed above.time
- contains the current time stamp.type
- contains type of either role or user constraint.GlobalErrIds.ACTV_FAILED_LOCK
if failed.Copyright © 2003-2016, The Apache Software Foundation. All Rights Reserved. Generated 20160718-1621