net.sf.j2ep.rules
Class IPRule

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

public class IPRule
extends BaseRule

This rule will check the IP for the remote user allowing the user if his IP is in the specified range.

Author:
Anders Nyman

Constructor Summary
IPRule()
           
 
Method Summary
protected  java.lang.String getEndRange()
          Returns the ending range that a connection has to be made from to be triggered by this rule.
protected  java.lang.String getStartRange()
          Returns the beginning range that a connection has to be made from to be triggered by this rule.
 boolean matches(HttpServletRequest request)
          Checks the IP for the remote user, if it's in the specified range it's a match.
 void setEndRange(java.lang.String endRange)
          Sets the ending range that a connection has to be made from to be triggered by this rule.
 void setStartRange(java.lang.String startRange)
          Sets the beginning range that a connection has to be made from to be triggered by this rule.
 
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

IPRule

public IPRule()
Method Detail

matches

public boolean matches(HttpServletRequest request)
Checks the IP for the remote user, if it's in the specified range it's a match.

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)

setStartRange

public void setStartRange(java.lang.String startRange)
Sets the beginning range that a connection has to be made from to be triggered by this rule.

Parameters:
startRange - The start of the IP range

getStartRange

protected java.lang.String getStartRange()
Returns the beginning range that a connection has to be made from to be triggered by this rule.

Returns:
The start of the IP range

setEndRange

public void setEndRange(java.lang.String endRange)
Sets the ending range that a connection has to be made from to be triggered by this rule.

Parameters:
endRange - The end of the IP range

getEndRange

protected java.lang.String getEndRange()
Returns the ending range that a connection has to be made from to be triggered by this rule.

Returns:
The end of the IP range