dk.netarkivet.viewerproxy
Class UnknownCommandResolver

java.lang.Object
  extended by dk.netarkivet.viewerproxy.CommandResolver
      extended by dk.netarkivet.viewerproxy.UnknownCommandResolver
All Implemented Interfaces:
URIResolver, URIResolverHandler

public class UnknownCommandResolver
extends CommandResolver

Wrapper for an URIResolver, which gives failures on specific specific URLs, and forwards all others to the wrapped handler. This allows you to reserve a specific host for commands and get a well-defined error if giving an undefined command.


Field Summary
 
Fields inherited from class dk.netarkivet.viewerproxy.CommandResolver
ur, VIEWERPROXY_COMMAND_NAME
 
Fields inherited from interface dk.netarkivet.viewerproxy.URIResolver
NOT_FOUND
 
Constructor Summary
UnknownCommandResolver(URIResolver ur)
          Make a new UnknownCommandResolver, which gives an error for any command- like URL and forwards other URLs to the given URIResolver
 
Method Summary
protected  boolean executeCommand(Request request, Response response)
          Helper method that checks if this is a command URL and throw an error if it is.
 
Methods inherited from class dk.netarkivet.viewerproxy.CommandResolver
isCommandHostRequest, lookup, setURIResolver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnknownCommandResolver

public UnknownCommandResolver(URIResolver ur)
Make a new UnknownCommandResolver, which gives an error for any command- like URL and forwards other URLs to the given URIResolver

Parameters:
ur - The URIResolver to handle all other uris.
Throws:
ArgumentNotValid - if either argument is null.
Method Detail

executeCommand

protected boolean executeCommand(Request request,
                                 Response response)
Helper method that checks if this is a command URL and throw an error if it is.

Specified by:
executeCommand in class CommandResolver
Parameters:
request - The request to check
response - The response to give command results to if it is a command
Returns:
Whether this was a command URL