Cumulus4j API
(1.0.0)

org.cumulus4j.keymanager.api
Class KeyManagerAPIConfiguration

java.lang.Object
  extended by org.cumulus4j.keymanager.api.KeyManagerAPIConfiguration
All Implemented Interfaces:
Serializable

public class KeyManagerAPIConfiguration
extends Object
implements Serializable

Configuration of the KeyManagerAPI.

An instance of this class tells the KeyManagerAPI where the key store is located and which key-store (identified by its keyStoreID) is to be used (among other things).

When you pass a KeyManagerAPIConfiguration instance to KeyManagerAPI.setConfiguration(KeyManagerAPIConfiguration), it becomes immutable. If you want to change the configuration afterwards, create a new one and call KeyManagerAPI.setConfiguration(KeyManagerAPIConfiguration) again.

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

Constructor Summary
KeyManagerAPIConfiguration()
          Create an empty configuration.
KeyManagerAPIConfiguration(KeyManagerAPIConfiguration source)
          Create a copy of another configuration.
 
Method Summary
protected  void finalize()
           
 char[] getAuthPassword()
          Get the password that will be used for authentication at the KeyStore.
 String getAuthUserName()
          Get the user name that will be used for authentication at the KeyStore.
 String getKeyManagerBaseURL()
          Get the URL where the KeyStore is accessible.
 String getKeyStoreID()
           Get the KeyStore's identifier.
 boolean isReadOnly()
          Get the immutable flag.
 void markReadOnly()
          Set the immutable flag.
 void setAuthPassword(char[] authPassword)
          Set the password that will be used for authentication at the KeyStore.
 void setAuthUserName(String authUserName)
          Set the user name that will be used for authentication at the KeyStore.
 void setKeyManagerBaseURL(String keyManagerBaseURL)
          Set the URL where the KeyStore is accessible.
 void setKeyStoreID(String keyStoreID)
          Set the KeyStore's identifier.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyManagerAPIConfiguration

public KeyManagerAPIConfiguration()
Create an empty configuration.


KeyManagerAPIConfiguration

public KeyManagerAPIConfiguration(KeyManagerAPIConfiguration source)
Create a copy of another configuration. You can use this to modify an existing (already immutable) configuration.

Parameters:
source - the original configuration to be copied. Can be null, which means that the new configuration will be completely empty (just as if it was created by the default constructor).
Method Detail

isReadOnly

public boolean isReadOnly()
Get the immutable flag. Iff true, every attempt to modify this instance (i.e. every setter) will throw an IllegalStateException.

Returns:
the immutable flag.
See Also:
markReadOnly()

markReadOnly

public void markReadOnly()
Set the immutable flag. After this method was called, every setter will throw an IllegalStateException rendering this instance read-only.

See Also:
isReadOnly()

getAuthUserName

public String getAuthUserName()
Get the user name that will be used for authentication at the KeyStore.

Returns:
the user name for authentication at the KeyStore.
See Also:
setAuthUserName(String)

setAuthUserName

public void setAuthUserName(String authUserName)
Set the user name that will be used for authentication at the KeyStore.

Parameters:
authUserName - the user name for authentication at the KeyStore.
See Also:
getAuthUserName()

getAuthPassword

public char[] getAuthPassword()
Get the password that will be used for authentication at the KeyStore.

Returns:
the password for authentication at the KeyStore.
See Also:
setAuthPassword(char[])

setAuthPassword

public void setAuthPassword(char[] authPassword)
Set the password that will be used for authentication at the KeyStore.

Parameters:
authPassword - the password for authentication at the KeyStore. This will be copied, i.e. later modifications to the given password will not affect this configuration. You indeed should zero-out the given password as soon as you don't need to keep it in memory, anymore.
See Also:
getAuthPassword()

getKeyStoreID

public String getKeyStoreID()

Get the KeyStore's identifier.

One key manager can manage multiple key stores. This identifier specifies which one to use.

Returns:
the KeyStore's identifier.
See Also:
setKeyStoreID(String)

setKeyStoreID

public void setKeyStoreID(String keyStoreID)
Set the KeyStore's identifier.

Parameters:
keyStoreID - the KeyStore's identifier. This should not contain spaces and other special characters that might not be used in restricted operating-systems (like Windows), because this might be used as (part of) a file name. Actually, it should contain only characters that can be used in URLs.
See Also:
getKeyStoreID()

getKeyManagerBaseURL

public String getKeyManagerBaseURL()
Get the URL where the KeyStore is accessible. This can either be a local directory (the URL starts with "file:") or a key-server (accessible via REST over HTTP or HTTPS).

Returns:
the KeyStore's base-URL (the complete URL is composed of this and the key-store-ID.
See Also:
setKeyManagerBaseURL(String)

setKeyManagerBaseURL

public void setKeyManagerBaseURL(String keyManagerBaseURL)
Set the URL where the KeyStore is accessible. This can either be a local directory (the URL starts with "file:") or a key-server (accessible via REST over HTTP or HTTPS).

Parameters:
keyManagerBaseURL - the base-URL of the remote key-server or a local file-URL (referencing a directory!), if a local key-store is to be used. This argument can be null, which means to use a local file in the default directory "${user.home}/.cumulus4j/".
See Also:
getKeyManagerBaseURL()

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

Cumulus4j API
(1.0.0)

Copyright © 2012 NightLabs Consulting GmbH. All Rights Reserved.