DJDoc v.1.0.0b-1

net.sf.djdoc.action
Interface Action

All Known Implementing Classes:
ApiListAction, BunchListAction, FileAction, ItemListAction

public interface Action

The implementations of the Action interface encapsulate the business logic performed during an HTTP request in the operation of the DJDoc web application. The instances of the implementations hold no state; every class implementing Action is a singleton referenced by the corresponding RequestType enum constant.

Since:
0.9.1
Author:
jv, 2005

Method Summary
 java.lang.Object perform(DjdocRequest djdocRequest)
          The implementations of this method contain the business logic of the respective request type.
 void sendResponse(DjdocRequest req, javax.servlet.http.HttpServletResponse res)
          This method is called after the perform(DjdocRequest) method and handles the communication from the server back to the client.
 

Method Detail

perform

java.lang.Object perform(DjdocRequest djdocRequest)
The implementations of this method contain the business logic of the respective request type. Note that this does not involve the communication of the server back to the client; since the Action implementations are stateless, all data relevant for the HTTP response must be wrapped in the return value of this method. The DJDoc framework stores the result object in the DjdocRequest for use in the sendResponse(DjdocRequest, HttpServletResponse) method.

Parameters:
djdocRequest - The wrapper around the HTTP request
Returns:
An object wrapping the information relevant for the HTTP response

sendResponse

void sendResponse(DjdocRequest req,
                  javax.servlet.http.HttpServletResponse res)
                  throws java.io.IOException
This method is called after the perform(DjdocRequest) method and handles the communication from the server back to the client.

Parameters:
req - The wrapper around the HTTP request which holds a reference to the result object returned by the perform(DjdocRequest) method
res - The HTTP response connected to the server call
Throws:
java.io.IOException

DJDoc v.1.0.0b-1