|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.adobe.flashaccess.sdk.protocol.AbstractHandler com.adobe.flashaccess.sdk.protocol.AbstractBatchHandler com.adobe.flashaccess.sdk.protocol.BatchHandlerBase
public abstract class BatchHandlerBase
Base class for Flash Access request/response handlers which handle multiple
requests/responses sent in a batch. The handler reads the request data
and parses the requests. The caller can examine the information
in the requests and decide whether to return an error or a successful response
for each RequestMessageBase
(subclasses of RequestMessageBase
provide a method for
setting response data).
Handlers should be invoked as follows (this example employs a concrete instance of
BatchHandlerBase
called ConcreteBatchHandler
):
ConcreteBatchHandler handler = new ConcreteBatchHandler(handlerConfig, inputStream, outputStream);
try {
handler.parseRequest();
List<? extends RequestMessageBase> requests = handler.getRequests();
for (RequestMessageBase req : requests) {
// Use request's getters to examine request info and evaluate request
// If successful, construct appropriate responseData and use request's methods to set response
// If an error occurs, construct errorData and call request.setErrorData(errorData);
}
} finally {
// Always call close in a finally statement to ensure a response is sent to the client
handler.close();
}
Method Summary | |
---|---|
void |
close()
Sends the signed and encrypted response (success or error) to the client. |
abstract java.util.List |
getRequests()
Retrieves the requests. |
Methods inherited from class com.adobe.flashaccess.sdk.protocol.AbstractHandler |
---|
parseRequest |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public abstract java.util.List getRequests()
getRequests
in class AbstractBatchHandler
RequestMessageBase
> containing the requests.public void close() throws java.io.IOException
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.
close
in interface HandlerInterface
close
in class AbstractBatchHandler
java.lang.IllegalStateException
- if neither the response or error data has been set, or if
close()
has already been called.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |