public abstract class CommandResolver extends Object implements URIResolverHandler, URIResolver
Modifier and Type | Field and Description |
---|---|
protected URIResolver |
ur
The URI resolver which is wrapped, and which handles all non-command URIs.
|
static String |
VIEWERPROXY_COMMAND_NAME
Fake host used as hostname when doing commands.
|
NOT_FOUND
Constructor and Description |
---|
CommandResolver(URIResolver ur)
Constructor which sets the next resolver in the chain.
|
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
executeCommand(Request request,
Response response)
Abstract method for parsing of the URL and delegating to relevant methods.
|
protected static boolean |
isCommandHostRequest(Request request)
Returns true if the request specifies the host that we're running on.
|
int |
lookup(Request request,
Response response)
Parses the given URI and executes commands for all command URLs.
|
void |
setURIResolver(URIResolver anUr)
Change the URI resolver which handles URIs that we don't handle here.
|
protected URIResolver ur
public static final String VIEWERPROXY_COMMAND_NAME
public CommandResolver(URIResolver ur)
ur
- The URIResolver that handles URIs that are not handled by this resolver.public final void setURIResolver(URIResolver anUr)
setURIResolver
in interface URIResolverHandler
anUr
- The URI resolver to handle unhandled URIs.ArgumentNotValid
- if either argument is null.public final int lookup(Request request, Response response)
If uri is none of these, the uri and response are forwarded to the wrapped URI resolver.
lookup
in interface URIResolver
request
- The HTTP request we are working onresponse
- HTTP response to generate effect on or to forwardprotected abstract boolean executeCommand(Request request, Response response)
request
- The request to checkresponse
- The response to give command results to if it is a commandprotected static boolean isCommandHostRequest(Request request)
request
- An HTTP request.Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.