Daisy Open Source CMS

org.outerj.daisy.httpconnector.spi
Interface RequestHandler


public interface RequestHandler

Handler for HTTP requests.

Handlers always deal with URL's of the following structure:

 {namespace}/{remainder of URL}
 
The {namespace} part is a fixed string (should not contain slashes) used to have a bulk division of the URL space among different subsystems.

The {remainder of URL} can have any structure whatsoever. The structure handled by this RequestHandler is the pattern returned by getPathPattern().

The RequestHandler should be registered as a plugin with the PluginRegistry


Method Summary
 String getNamespace()
          See class description.
 String getPathPattern()
          Pattern for the URLs that should be handled by this request handler.
 void handleRequest(Map matchMap, HttpServletRequest request, HttpServletResponse response, Repository repository, RequestHandlerSupport support)
           
 

Method Detail

handleRequest

void handleRequest(Map matchMap,
                   HttpServletRequest request,
                   HttpServletResponse response,
                   Repository repository,
                   RequestHandlerSupport support)
                   throws Exception
Parameters:
matchMap - contains the content of the matched wildcards from the pattern, if any. The keys for retrieving these patterns are "1", "2", etc (as string objects).
repository - Repository object of the authenticated user.
support -
Throws:
Exception

getPathPattern

String getPathPattern()
Pattern for the URLs that should be handled by this request handler.

The pattern should usually start with a slash. It should not include the namespace to which this RequestHandler belongs.

The pattern can contain the wildcards * and **. One star matches any character without slash, two stars matches any character including slash.

Patterns will be checked in the order by which the request handlers are registered (within a namespace).


getNamespace

String getNamespace()
See class description.


Daisy Open Source CMS