net.sf.j2ep.rules
Class TimeRule

java.lang.Object
  extended by net.sf.j2ep.rules.BaseRule
      extended by net.sf.j2ep.rules.TimeRule
All Implemented Interfaces:
Rule

public class TimeRule
extends BaseRule

A simple rule that checks the hour. If the hour is in the specified range we will allow the request.

Author:
Anders Nyman

Constructor Summary
TimeRule()
           
 
Method Summary
 boolean matches(HttpServletRequest request)
          Making check to see that the time lies between the start and end time.
 void setEndTime(java.lang.String time)
          Sets the end hour that request will be allowed.
 void setStartTime(java.lang.String time)
          Sets the start hour that requests will be allowed.
 
Methods inherited from class net.sf.j2ep.rules.BaseRule
process, revert, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeRule

public TimeRule()
Method Detail

matches

public boolean matches(HttpServletRequest request)
Making check to see that the time lies between the start and end time. If the time crosses a date barrier, e.g. 23-01 the time will be checked correctly. Note the difference between 01-23 and 23-01.

Parameters:
request - The request
Returns:
true if the request is matched, otherwise false
See Also:
net.sf.j2ep.model.Rule#matches(javax.servlet.http.HttpServletRequest)

setStartTime

public void setStartTime(java.lang.String time)
Sets the start hour that requests will be allowed.

Parameters:
time - The hour

setEndTime

public void setEndTime(java.lang.String time)
Sets the end hour that request will be allowed.

Parameters:
time - The hour