Top Description Constructors Methods
org.eclipse.jetty.server.handler

public Class InetAccessHandler

extends Abstract
Class Inheritance
Imports
org.eclipse.jetty.http.HttpStatus, org.eclipse.jetty.http.pathmap.PathSpec, org.eclipse.jetty.server.Handler, .Request, .Response, org.eclipse.jetty.util.Callback, .IncludeExcludeSet, .InetAddressPattern, .InetAddressSet

InetAddress Access Handler

Controls access to the wrapped handler using the real remote IP. Control is provided by and IncludeExcludeSet over a InetAddressSet. This handler uses the real internet address of the connection, not one reported in the forwarded for headers, as this cannot be as easily forged.

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
exclude(String
InetAddress pattern to exclude
pattern
)

Excludes an InetAccess entry pattern with an optional connector name, address and URI mapping.

public void
exclude(String...
InetAddress patterns to exclude
patterns
)

Excludes InetAccess patterns

public void
exclude(String
optional name of a connector to exclude.
connectorName
,
String
optional InetAddress pattern to exclude.
addressPattern
,
PathSpec
optional pathSpec to exclude.
pathSpec
)

Excludes an InetAccess entry.

public void
include(String
InetAccess pattern to include
pattern
)

Includes an InetAccess pattern with an optional connector name, address and URI mapping.

public void
include(String...
InetAddress patterns to include
patterns
)

Includes InetAccess patterns

public void
include(String
optional name of a connector to include.
connectorName
,
String
optional InetAddress pattern to include.
addressPattern
,
PathSpec
optional pathSpec to include.
pathSpec
)

Includes an InetAccess entry.

private void
includeExclude(boolean include, String pattern)

protected boolean
onConditionsMet(Request
The request to handle
request
,
Response
The response to generate
response
,
Callback
The callback for completion
callback
)

Implements abstract org.eclipse.jetty.server.handler.ConditionalHandler.onConditionsMet.

Handle a request that has met the conditions.
protected boolean
onConditionsNotMet(Request
The request to handle
request
,
Response
The response to generate
response
,
Callback
The callback for completion
callback
)

Implements abstract org.eclipse.jetty.server.handler.ConditionalHandler.onConditionsNotMet.

This method is called when the request has not met the conditions and is not to be handled by this handler.

Constructor Detail

InetAccessHandlerback to summary
public InetAccessHandler()
InetAccessHandlerback to summary
public InetAccessHandler(Handler handler)

Method Detail

excludeback to summary
public void exclude(String pattern)

Excludes an InetAccess entry pattern with an optional connector name, address and URI mapping.

The connector name is separated from the InetAddress pattern with an '@' character, and the InetAddress pattern is separated from the URI pattern using the "|" (pipe) character. A method name is separated from the URI pattern using the ">" character. URI patterns follow the servlet specification for simple * prefix and suffix wild cards (e.g. /, /foo, /foo/bar, /foo/bar/*, *.baz).


Examples:
Parameters
pattern:String

InetAddress pattern to exclude

See Also
InetAddressSet
excludeback to summary
public void exclude(String... patterns)

Excludes InetAccess patterns

Parameters
patterns:String[]

InetAddress patterns to exclude

See Also
InetAddressSet
excludeback to summary
public void exclude(String connectorName, String addressPattern, PathSpec pathSpec)

Excludes an InetAccess entry.

Parameters
connectorName:String

optional name of a connector to exclude.

addressPattern:String

optional InetAddress pattern to exclude.

pathSpec:PathSpec

optional pathSpec to exclude.

includeback to summary
public void include(String pattern)

Includes an InetAccess pattern with an optional connector name, address and URI mapping.

The connector name is separated from the InetAddress pattern with an '@' character, and the InetAddress pattern is separated from the URI pattern using the "|" (pipe) character. URI patterns follow the servlet specification for simple * prefix and suffix wild cards (e.g. /, /foo, /foo/bar, /foo/bar/*, *.baz).


Examples:
Parameters
pattern:String

InetAccess pattern to include

See Also
InetAddressSet
includeback to summary
public void include(String... patterns)

Includes InetAccess patterns

Parameters
patterns:String[]

InetAddress patterns to include

See Also
InetAddressSet
includeback to summary
public void include(String connectorName, String addressPattern, PathSpec pathSpec)

Includes an InetAccess entry.

Parameters
connectorName:String

optional name of a connector to include.

addressPattern:String

optional InetAddress pattern to include.

pathSpec:PathSpec

optional pathSpec to include.

includeExcludeback to summary
private void includeExclude(boolean include, String pattern)
onConditionsMetback to summary
protected boolean onConditionsMet(Request request, Response response, Callback callback) throws Exception

Implements abstract org.eclipse.jetty.server.handler.ConditionalHandler.onConditionsMet.

Doc from org.eclipse.jetty.server.handler.ConditionalHandler.onConditionsMet.

Handle a request that has met the conditions. Typically, the implementation will provide optional handling and then call the nextHandler(Request, Response, Callback) method to continue handling.

Parameters
request:Request

The request to handle

response:Response

The response to generate

callback:Callback

The callback for completion

Returns:boolean

True if this handler will complete the callback

Annotations
@Override
Exceptions
Exception:
If there is a problem handling
onConditionsNotMetback to summary
protected boolean onConditionsNotMet(Request request, Response response, Callback callback) throws Exception

Implements abstract org.eclipse.jetty.server.handler.ConditionalHandler.onConditionsNotMet.

Doc from org.eclipse.jetty.server.handler.ConditionalHandler.onConditionsNotMet.

This method is called when the request has not met the conditions and is not to be handled by this handler. Implementations may return false; send an error response; or handle the request differently.

Parameters
request:Request

The request to handle

response:Response

The response to generate

callback:Callback

The callback for completion

Returns:boolean

True if this handler will complete the callback

Annotations
@Override
Exceptions
Exception:
If there is a problem handling