Cumulus4j API
(1.0.1)

org.cumulus4j.keymanager.channel
Interface RequestHandler<R extends Request>

Type Parameters:
R - the request type for which this request handler is responsible.
All Known Implementing Classes:
AbstractRequestHandler, GetActiveEncryptionKeyRequestHandler, GetKeyRequestHandler

public interface RequestHandler<R extends Request>

Handler processing and replying requests coming from the application server.

The so-called "key manager channel" is - as shown in the document Deployment scenarios - an HTTP(S) connection from the key-manager to the application server with an inverse request-response-cycle. This means, the application server sends a Request, the key manager handles it and then sends a Response back.

For every Request type (i.e. subclass), there's one implementation of RequestHandler registered in the KeyManagerChannelManager. For every incoming Request, the KeyManagerChannelManager instantiates an appropriate RequestHandler implementation, initialises it (i.e. calls setKeyManagerChannelManager(KeyManagerChannelManager)) and then calls handle(Request).

If handling a request fails, an ErrorResponse is sent to the server.

Important: You should not directly implement this interface but instead subclass AbstractRequestHandler!

Author:
Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de

Method Summary
 KeyManagerChannelManager getKeyManagerChannelManager()
          Get the KeyManagerChannelManager.
 Response handle(R request)
          Handle the given request.
 void setKeyManagerChannelManager(KeyManagerChannelManager keyManagerChannelManager)
          Set the KeyManagerChannelManager.
 

Method Detail

getKeyManagerChannelManager

KeyManagerChannelManager getKeyManagerChannelManager()
Get the KeyManagerChannelManager.

Returns:
the KeyManagerChannelManager or null, if it has not yet been set.

setKeyManagerChannelManager

void setKeyManagerChannelManager(KeyManagerChannelManager keyManagerChannelManager)
Set the KeyManagerChannelManager. This method is called by the KeyManagerChannelManager after instantiating a new RequestHandler instance and before invoking handle(Request).

Parameters:
keyManagerChannelManager - the KeyManagerChannelManager

handle

Response handle(R request)
                throws Throwable
Handle the given request.

Parameters:
request - the request to be handled; never null.
Returns:
the response for the given request; can be null, which is sent as NullResponse to the server.
Throws:
Throwable

Cumulus4j API
(1.0.1)

Copyright © 2012 NightLabs Consulting GmbH. All Rights Reserved.