Cumulus4j API
(1.1.1)

org.cumulus4j.store.localkeystoremessagebroker
Class LocalKeyStoreMessageBroker

java.lang.Object
  extended by org.cumulus4j.store.crypto.keymanager.messagebroker.AbstractMessageBroker
      extended by org.cumulus4j.store.localkeystoremessagebroker.LocalKeyStoreMessageBroker
All Implemented Interfaces:
MessageBroker

public class LocalKeyStoreMessageBroker
extends AbstractMessageBroker


Field Summary
 
Fields inherited from interface org.cumulus4j.store.crypto.keymanager.messagebroker.MessageBroker
SYSTEM_PROPERTY_POLL_REQUEST_TIMEOUT, SYSTEM_PROPERTY_QUERY_TIMEOUT
 
Constructor Summary
LocalKeyStoreMessageBroker()
           
 
Method Summary
protected  Request _pollRequest(String cryptoSessionIDPrefix)
          Delegate of the AbstractMessageBroker.pollRequest(String) method.
protected  void _pushResponse(Response response)
          Delegate of the AbstractMessageBroker.pushResponse(Response) method.
protected  Response _query(Class<? extends Response> responseClass, Request request)
          Delegate of the AbstractMessageBroker.query(Class, Request) method.
 KeyStore getKeyStore()
           
 char[] getPassword()
           
 String getUserName()
           
protected  GetActiveEncryptionKeyResponse handle(GetActiveEncryptionKeyRequest request)
           
protected  GetKeyResponse handle(GetKeyRequest request)
           
 void setKeyStore(KeyStore keyStore)
           
 void setPassword(char[] authPassword)
           
 void setUserName(String authUserName)
           
 
Methods inherited from class org.cumulus4j.store.crypto.keymanager.messagebroker.AbstractMessageBroker
getPollRequestTimeout, getQueryTimeout, pollRequest, pushResponse, query
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalKeyStoreMessageBroker

public LocalKeyStoreMessageBroker()
Method Detail

getKeyStore

public KeyStore getKeyStore()

setKeyStore

public void setKeyStore(KeyStore keyStore)

getUserName

public String getUserName()

setUserName

public void setUserName(String authUserName)

getPassword

public char[] getPassword()

setPassword

public void setPassword(char[] authPassword)

handle

protected GetActiveEncryptionKeyResponse handle(GetActiveEncryptionKeyRequest request)
                                         throws GeneralSecurityException,
                                                IOException,
                                                CryptoException
Throws:
GeneralSecurityException
IOException
CryptoException

handle

protected GetKeyResponse handle(GetKeyRequest request)
                         throws GeneralSecurityException,
                                IOException,
                                CryptoException
Throws:
GeneralSecurityException
IOException
CryptoException

_query

protected Response _query(Class<? extends Response> responseClass,
                          Request request)
                   throws TimeoutException,
                          ErrorResponseException
Description copied from class: AbstractMessageBroker
Delegate of the AbstractMessageBroker.query(Class, Request) method. Subclasses should implement this method instead of query(...).

Specified by:
_query in class AbstractMessageBroker
Parameters:
responseClass - the type of the expected response; can be null, if you expect to receive null (i.e. you pass a "void" request).
request - the request to be sent to the key-manager.
Returns:
the response from the key-manager. Will be null, if the key-manager replied with a NullResponse.
Throws:
TimeoutException - if the request was not replied within the query-timeout.
ErrorResponseException - if the key-manager (either running embedded on the remote client or in a separate key-server) sent an ErrorResponse.

_pollRequest

protected Request _pollRequest(String cryptoSessionIDPrefix)
Description copied from class: AbstractMessageBroker
Delegate of the AbstractMessageBroker.pollRequest(String) method. Subclasses should implement this method instead of pollRequest(...).

Specified by:
_pollRequest in class AbstractMessageBroker
Parameters:
cryptoSessionIDPrefix - usually, every key-manager uses the same prefix for all crypto-sessions. Thus, this prefix is used to efficiently route requests to the right key-manager.
Returns:
the next request waiting for processing and fitting to the given cryptoSessionIDPrefix or null, if no such request pops up in the to-do-queue within the timeout.

_pushResponse

protected void _pushResponse(Response response)
Description copied from class: AbstractMessageBroker
Delegate of the AbstractMessageBroker.pushResponse(Response) method. Subclasses should implement this method instead of pushResponse(...).

Specified by:
_pushResponse in class AbstractMessageBroker
Parameters:
response - the response answering a previous Request enqueued by AbstractMessageBroker.query(Class, Request).

Cumulus4j API
(1.1.1)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.