Cumulus4j API
(1.1.0)

org.cumulus4j.keymanager.api.internal
Class AbstractKeyManagerAPI

java.lang.Object
  extended by org.cumulus4j.keymanager.api.internal.AbstractKeyManagerAPI
All Implemented Interfaces:
KeyManagerAPI
Direct Known Subclasses:
DefaultKeyManagerAPI, LocalKeyManagerAPI, RemoteKeyManagerAPI

public abstract class AbstractKeyManagerAPI
extends Object
implements KeyManagerAPI

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

Field Summary
protected static String FILE_URL_PREFIX
           
 
Constructor Summary
AbstractKeyManagerAPI()
           
 
Method Summary
protected static boolean equals(Object o1, Object o2)
           
 char[] getAuthPassword()
          Convenience method delegating to KeyManagerAPIConfiguration.getAuthPassword().
 String getAuthUserName()
          Convenience method delegating to KeyManagerAPIConfiguration.getAuthUserName().
 KeyManagerAPIConfiguration getConf()
          Get the configuration.
 KeyManagerAPIConfiguration getConfiguration()
          Get the current configuration of this KeyManagerAPI.
 String getKeyManagerBaseURL()
          Convenience method delegating to KeyManagerAPIConfiguration.getKeyManagerBaseURL().
 String getKeyStoreID()
          Convenience method delegating to KeyManagerAPIConfiguration.getKeyStoreID().
 void setConfiguration(KeyManagerAPIConfiguration configuration)
           Set the configuration for this KeyManagerAPI instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.cumulus4j.keymanager.api.KeyManagerAPI
deleteUser, getCryptoSession, initDateDependentKeyStrategy, putUser
 

Field Detail

FILE_URL_PREFIX

protected static final String FILE_URL_PREFIX
See Also:
Constant Field Values
Constructor Detail

AbstractKeyManagerAPI

public AbstractKeyManagerAPI()
Method Detail

getConf

public KeyManagerAPIConfiguration getConf()
                                   throws IllegalStateException
Get the configuration. If there is no configuration, yet, an IllegalStateException is thrown.

Returns:
the configuration, never null.
Throws:
IllegalStateException - if there is no configuration, yet, i.e. setConfiguration(...) was not yet called.

getAuthUserName

public String getAuthUserName()
                       throws IllegalStateException
Convenience method delegating to KeyManagerAPIConfiguration.getAuthUserName().

Returns:
the authUserName.
Throws:
IllegalStateException - if there is no configuration, yet, i.e. setConfiguration(...) was not yet called.

getAuthPassword

public char[] getAuthPassword()
                       throws IllegalStateException
Convenience method delegating to KeyManagerAPIConfiguration.getAuthPassword().

Returns:
the authPassword.
Throws:
IllegalStateException - if there is no configuration, yet, i.e. setConfiguration(...) was not yet called.

getKeyStoreID

public String getKeyStoreID()
                     throws IllegalStateException
Convenience method delegating to KeyManagerAPIConfiguration.getKeyStoreID().

Returns:
the keyStoreID.
Throws:
IllegalStateException - if there is no configuration, yet, i.e. setConfiguration(...) was not yet called.

getKeyManagerBaseURL

public String getKeyManagerBaseURL()
                            throws IllegalStateException
Convenience method delegating to KeyManagerAPIConfiguration.getKeyManagerBaseURL().

Returns:
the keyManagerBaseURL.
Throws:
IllegalStateException - if there is no configuration, yet, i.e. setConfiguration(...) was not yet called.

setConfiguration

public void setConfiguration(KeyManagerAPIConfiguration configuration)
                      throws IllegalArgumentException,
                             KeyManagerAPIInstantiationException
Description copied from interface: KeyManagerAPI

Set the configuration for this KeyManagerAPI instance.

Before a KeyManagerAPI instance can actually be used, it first needs to be configured. The configuration passed to this method will be marked read-only.

Specified by:
setConfiguration in interface KeyManagerAPI
Parameters:
configuration - the configuration (which will be marked read-only by this operation). Must not be null.
Throws:
IllegalArgumentException - if the configuration is null or incomplete (e.g. configuration.keyStoreID being null).
KeyManagerAPIInstantiationException - if the actual implementation cannot be instantiated.

getConfiguration

public KeyManagerAPIConfiguration getConfiguration()
Description copied from interface: KeyManagerAPI
Get the current configuration of this KeyManagerAPI. If KeyManagerAPI.setConfiguration(KeyManagerAPIConfiguration) was not yet called, this is null.

Specified by:
getConfiguration in interface KeyManagerAPI
Returns:
the KeyManagerAPIConfiguration (or null, if not yet configured).

equals

protected static boolean equals(Object o1,
                                Object o2)

Cumulus4j API
(1.1.0)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.