smbdav
Interface MethodHandler

All Known Implementing Classes:
AbstractHandler

public interface MethodHandler

A class can implement the MethodHandler interface when it wishes to service requests via a particular HTTP method. The Davenport servlet registers a method handler for a particular method, and dispatches requests to that handler. To install a handler,

As an example, if you have a class com.foo.MyGetHandler designed to service HTTP GET requests, you would add the following to the Davenport deployment descriptor:

 <init-param>
     <param-name>handler.GET</param-name>
     <param-value>com.foo.MyGetHandler</param-value>
 </init-param>
 

Author:
Eric Glass

Field Summary
static int SC_FAILED_DEPENDENCY
          Status code (424) indicating that the method could not be performed because an action upon which this action depends failed.
static int SC_INSUFFICIENT_STORAGE
          Status code (507) indicating that the method could not be performed on a resource because the server is unable to store the representation needed to successfully complete the request.
static int SC_LOCKED
          Status code (423) indicating that the source or destination resource of a method is locked.
static int SC_MULTISTATUS
          Status code (207) providing status for multiple independent operations.
static int SC_PROCESSING
          Interim status code (102) indicating that the server has accepted the request but has not yet completed it.
static int SC_UNPROCESSABLE_ENTITY
          Status code (422) indicating that the server understands the content type of the request entity, and the syntax of the request entity is correct, but the contained instructions could not be processed.
 
Method Summary
 void destroy()
          Called by the Davenport servlet to indicate that the handler is being taken out of service.
 void init(javax.servlet.ServletConfig config)
          Called by the Davenport servlet to indicate that the handler is being placed into service.
 void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, jcifs.smb.NtlmPasswordAuthentication auth)
          Called by the Davenport servlet to allow the handler to service a request.
 

Field Detail

SC_PROCESSING

public static final int SC_PROCESSING
Interim status code (102) indicating that the server has accepted the request but has not yet completed it.

See Also:
Constant Field Values

SC_MULTISTATUS

public static final int SC_MULTISTATUS
Status code (207) providing status for multiple independent operations.

See Also:
Constant Field Values

SC_UNPROCESSABLE_ENTITY

public static final int SC_UNPROCESSABLE_ENTITY
Status code (422) indicating that the server understands the content type of the request entity, and the syntax of the request entity is correct, but the contained instructions could not be processed.

See Also:
Constant Field Values

SC_LOCKED

public static final int SC_LOCKED
Status code (423) indicating that the source or destination resource of a method is locked.

See Also:
Constant Field Values

SC_FAILED_DEPENDENCY

public static final int SC_FAILED_DEPENDENCY
Status code (424) indicating that the method could not be performed because an action upon which this action depends failed.

See Also:
Constant Field Values

SC_INSUFFICIENT_STORAGE

public static final int SC_INSUFFICIENT_STORAGE
Status code (507) indicating that the method could not be performed on a resource because the server is unable to store the representation needed to successfully complete the request.

See Also:
Constant Field Values
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Called by the Davenport servlet to indicate that the handler is being placed into service. Semantics are identical to the Servlet init method; the method is called exactly once after instantiation.

Parameters:
config - a ServletConfig object containing the Davenport servlet's configuration and initialization parameters.
Throws:
javax.servlet.ServletException - If an error occurs during initialization.

destroy

public void destroy()
Called by the Davenport servlet to indicate that the handler is being taken out of service. Semantics are identical to the Servlet destroy method. This method gives the handler an opportunity to clean up any resources that are being held. After this method has been called, the service method will not be invoked again.


service

public void service(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response,
                    jcifs.smb.NtlmPasswordAuthentication auth)
             throws java.io.IOException,
                    javax.servlet.ServletException
Called by the Davenport servlet to allow the handler to service a request. The Davenport servlet will select an appropriate handler for a given HTTP method, and dispatch the request accordingly.

Parameters:
request - The request that is being serviced.
response - The servlet response object.
auth - The authentication information provided by the user.
Throws:
java.io.IOException - If an input or output exception occurs.
javax.servlet.ServletException - If an exception occurs that interferes with normal operation.


Copyright © 2004 Eric Glass