Class ClockTime
- java.lang.Object
-
- org.apache.directory.fortress.core.util.time.ClockTime
-
- All Implemented Interfaces:
Validator
public class ClockTime extends Object implements Validator
This class performs time validation forConstraint
. This validator will ensure the current time falls betweenConstraint.getBeginTime()
andConstraint.getEndTime()
The format requires military time, i.e. 0800 for 8:00 am, 1700 for 5:00 pm. The constantGlobalIds.NONE
may be used to disable checks for a particular entity. forConstraint
validations that occur inConstraint 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 ClockTime()
-
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 time is betweenConstraint.getBeginTime()
andConstraint.getBeginTime()
.
-
-
-
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 time is betweenConstraint.getBeginTime()
andConstraint.getBeginTime()
.- Specified by:
validate
in interfaceValidator
- Parameters:
session
- required forValidator
interface but not used here.constraint
- contains the begin and end times. Maps listed above.time
- contains the current time.type
- required by interface, not used here.- Returns:
- '0' if validation succeeds else
GlobalErrIds.ACTV_FAILED_TIME
if failed.
-
-