com.adobe.flashaccess.sdk.protocol
Class AbstractHandler

java.lang.Object
  extended by com.adobe.flashaccess.sdk.protocol.AbstractHandler
All Implemented Interfaces:
HandlerInterface
Direct Known Subclasses:
AbstractBatchHandler, AbstractMessageHandler

public abstract class AbstractHandler
extends java.lang.Object
implements HandlerInterface

The base class for request/response handlers. The handler reads the request data and parses the request. The caller can examine the information in the request and decide whether to return an error or a successful response (subclasses should provide a method for setting response data).


Method Summary
 void close()
          Sends the signed and encrypted response (success or error) to the client.
 void parseRequest()
          Reads the request body from the input stream, parses the request, and verifies the request integrity.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseRequest

public void parseRequest()
                  throws HandlerParsingException
Reads the request body from the input stream, parses the request, and verifies the request integrity. If the request cannot be parsed, an exception containing ErrorData is thrown. If a parsing error occurs, the caller must call close() immediately; the error information in the HandlerParsingException will automatically be sent to the client when close() is called. parseRequest() must be called before any other handler methods.

Specified by:
parseRequest in interface HandlerInterface
Throws:
HandlerParsingException

close

public void close()
           throws java.io.IOException
Sends the signed and encrypted response (success or error) to the client. In some cases, error data will not be encrypted (for example, the request could not be decrypted). close() must be the last method called for this object: it is recommended this be part of a finally block to ensure a response is always sent to the client.

Specified by:
close in interface HandlerInterface
Throws:
java.lang.IllegalStateException - If neither the response or error data has been set, or if close() has already been called.
java.io.IOException


[an error occurred while processing this directive] [an error occurred while processing this directive]