Class LockDate
- java.lang.Object
-
- org.apache.directory.fortress.core.util.time.LockDate
-
- All Implemented Interfaces:
Validator
public class LockDate extends Object implements Validator
This class performs lock date validation forConstraint
. This validator will ensure the current date falls outsideConstraint.getBeginLockDate()
andConstraint.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 constantGlobalIds.NONE
may be used to disable checks for a particular entity.Constraint Targets include
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 class
- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description LockDate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 theConstraint.getBeginLockDate()
andConstraint.getEndLockDate()
range.
-
-
-
Method Detail
-
validate
public 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 theConstraint.getBeginLockDate()
andConstraint.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.- Specified by:
validate
in interfaceValidator
- Parameters:
session
- required forValidator
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.- Returns:
- '0' if validation succeeds else
GlobalErrIds.ACTV_FAILED_LOCK
if failed.
-
-