ikrs.httpd
Interface PreparedHTTPResponse

All Known Implementing Classes:
AbstractPreparedResponse, GeneralPreparedResponse, OK

public interface PreparedHTTPResponse

This interface is meant to wrap prepared HTTP reply objects.


Method Summary
 void dispose()
          This method will be called in the final end - even if the execute() method failed.
 void execute()
          This method executes the prepared response; this means that all necessary resources will be accessed, the actual reply built and sent back to the client.
 boolean isDisposed()
          The method returns true if (and only if) this response already disposed.
 boolean isExecuted()
          The method returns true if (and only if) this response was already executed.
 boolean isPrepared()
          This method return true if (and only if) this response is already prepared.
 void prepare(java.util.Map<java.lang.String,BasicType> optionalReturnSettings)
          This method must fully prepare the HTTP response.
 

Method Detail

prepare

void prepare(java.util.Map<java.lang.String,BasicType> optionalReturnSettings)
             throws MalformedRequestException,
                    UnsupportedVersionException,
                    UnsupportedMethodException,
                    UnknownMethodException,
                    ConfigurationException,
                    java.util.MissingResourceException,
                    AuthorizationException,
                    HeaderFormatException,
                    DataFormatException,
                    UnsupportedFormatException,
                    ParametrizedHTTPException,
                    java.lang.SecurityException,
                    java.io.IOException
This method must fully prepare the HTTP response. It is not acceptable that any steps that can be done during preparation are made during the execute()-process! This means that all required ressources must be acquired (use locks), all headers prepared (by the use of addResponseHeader(String,String) or getResponseHeaders()) and perform all necessary security checks.

Parameters:
optionalReturnSettings - This (optional, means may be null) map can be used to retrieve internal values for error recovery.
Throws:
MalformRequestException - If the passed HTTP request headers are malformed and cannot be processed.
UnsupportedVersionException - If the headers' HTTP version is not supported (supported versions are 1.0 and 1.1).
UnsupportedMethodException - If the request method is valid but not supported (status code 405).
UnknownMethodException - If the headers' method (from the request line) is unknown.
ConfigurationException - If the was a server configuration issue the server cannot work properly with.
java.util.MissingResourceException - If the requested resource cannot be found.
AuthorizationException - If the requested resource requires authorization.
HeaderFormatException - If the passed headers are malformed.
DataFormatException - If the passed data is malformed.
java.lang.SecurityException - If the request cannot be processed due to security reasons.
java.io.IOException - If any IO errors occur.
MalformedRequestException
UnsupportedFormatException
ParametrizedHTTPException

execute

void execute()
             throws java.io.IOException
This method executes the prepared response; this means that all necessary resources will be accessed, the actual reply built and sent back to the client. Note that all resources already need to be aquired and all security checks to be done _before_ this method is called.

Throws:
java.io.IOException - If any IO errors occur.

dispose

void dispose()
This method will be called in the final end - even if the execute() method failed. It has to clean up, release resources and all locks!


isPrepared

boolean isPrepared()
This method return true if (and only if) this response is already prepared. In the true-case the prepare()-method should not have any effects.


isExecuted

boolean isExecuted()
The method returns true if (and only if) this response was already executed.


isDisposed

boolean isDisposed()
The method returns true if (and only if) this response already disposed.