org.cumulus4j.store.localkeystoremessagebroker
Class LocalKeyStoreMessageBroker
java.lang.Object
org.cumulus4j.store.crypto.keymanager.messagebroker.AbstractMessageBroker
org.cumulus4j.store.localkeystoremessagebroker.LocalKeyStoreMessageBroker
- All Implemented Interfaces:
- MessageBroker
public class LocalKeyStoreMessageBroker
- extends AbstractMessageBroker
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocalKeyStoreMessageBroker
public LocalKeyStoreMessageBroker()
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)
.
Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.