public class IPAccessHandler extends AbstractHttpHandler
Constructor and Description |
---|
IPAccessHandler()
Constructor for the class
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkIP(String ipstring)
Checks if the given ipstring (x.x.x.x) is authorized or not
|
void |
handle(String pathInContext,
String pathParams,
HttpRequest request,
HttpResponse response)
Handles the incoming request
|
void |
setAllowIP(String ipstring)
Allow the given ip-address access
|
void |
setDenyIP(String ipstring)
Deny the given ip-address access
|
void |
setStandard(String s)
Set the standard action beeing taken when not registred IPs wants access
|
getHttpContext, getName, handleTrace, initialize, isStarted, setName, start, stop, toString
public boolean checkIP(String ipstring)
ipstring
- The ip-address as a Stringpublic void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException, IOException
pathInContext
- pathParams
- request
- The incoming HTTP-requestresponse
- The outgoing HTTP-responseHttpException
IOException
public void setAllowIP(String ipstring)
ipstring
- The ip-address as a String on the format "x.x.x.x"public void setDenyIP(String ipstring)
ipstring
- The ip-address as a String on the format "x.x.x.x"public void setStandard(String s)
s
- The standard-string (either 'allow' or 'deny')Copyright © 2013. All rights reserved.