org.norther.tammi.core.security
Class DefaultKeyStoreLoader

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.core.security.DefaultKeyStoreLoader
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Manageable, MBeanDelegate, KeyStoreLoader

public class DefaultKeyStoreLoader
extends Adaptee
implements KeyStoreLoader

A default implementation of KeyStoreLoader.

Version:
$Id: DefaultKeyStoreLoader.java,v 1.8 2009/09/28 15:08:42 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Constructor Summary
DefaultKeyStoreLoader()
          Creates a key store.
 
Method Summary
 void addKeyStore(KeyStore store)
          Adds a new key store or refreshes a changed one.
 void clearKeyStores()
          Clears all key stores.
 KeyStore getKeyStore(String alias)
          Gets the first key store for the specified alias.
 KeyStore[] getKeyStores(String alias)
          Gets all key stores for the specified alias.
 String getSecurityKey()
          Gets the path finder key for resolving security paths.
 void load(File file, String password)
          Loads a key store from the specified file.
 void load(InputStream stream, String password)
          Loads a key store from the specified input stream.
 void load(String path, String password)
          Loads a key store from the specified path.
 void load(URL url, String password)
          Loads a key store from the specified URL.
 void removeKeyStore(KeyStore store)
          Removes a key store.
 void removeKeyStores(String alias)
          Removes all key stores for the specified alias.
 void setSecurityKey(String key)
          Sets the path finder key for resolving security paths.
 
Methods inherited from class org.norther.tammi.core.base.Adaptee
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, postmanaged, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unmanaged, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultKeyStoreLoader

public DefaultKeyStoreLoader()
Creates a key store.

Method Detail

getSecurityKey

public String getSecurityKey()
Description copied from interface: KeyStoreLoader
Gets the path finder key for resolving security paths.

Specified by:
getSecurityKey in interface KeyStoreLoader
Returns:
the path finder key.

setSecurityKey

public void setSecurityKey(String key)
Description copied from interface: KeyStoreLoader
Sets the path finder key for resolving security paths. The default key is PathFinderMBean.SECURITY.

Specified by:
setSecurityKey in interface KeyStoreLoader
Parameters:
key - the path finder key.

getKeyStore

public KeyStore getKeyStore(String alias)
Description copied from interface: KeyStoreLoader
Gets the first key store for the specified alias.

Specified by:
getKeyStore in interface KeyStoreLoader
Parameters:
alias - the alias.
Returns:
a key store or null.

getKeyStores

public KeyStore[] getKeyStores(String alias)
Description copied from interface: KeyStoreLoader
Gets all key stores for the specified alias.

Specified by:
getKeyStores in interface KeyStoreLoader
Parameters:
alias - the alias.
Returns:
an array of key stores or null.

addKeyStore

public void addKeyStore(KeyStore store)
                 throws LogException
Description copied from interface: KeyStoreLoader
Adds a new key store or refreshes a changed one.

Specified by:
addKeyStore in interface KeyStoreLoader
Parameters:
store - a key store.
Throws:
LogException - on errors.

removeKeyStore

public void removeKeyStore(KeyStore store)
Description copied from interface: KeyStoreLoader
Removes a key store.

Specified by:
removeKeyStore in interface KeyStoreLoader
Parameters:
store - a key store.

removeKeyStores

public void removeKeyStores(String alias)
Description copied from interface: KeyStoreLoader
Removes all key stores for the specified alias.

Note that the associated key stores are removed from all of their other aliases as well.

Specified by:
removeKeyStores in interface KeyStoreLoader
Parameters:
alias - the alias.

clearKeyStores

public void clearKeyStores()
Description copied from interface: KeyStoreLoader
Clears all key stores.

Specified by:
clearKeyStores in interface KeyStoreLoader

load

public void load(String path,
                 String password)
          throws LogException
Description copied from interface: KeyStoreLoader
Loads a key store from the specified path.

Specified by:
load in interface KeyStoreLoader
Parameters:
path - the path from which the key store is loaded.
password - the (optional) password used to check the integrity.
Throws:
LogException - on errors.

load

public void load(File file,
                 String password)
          throws LogException
Description copied from interface: KeyStoreLoader
Loads a key store from the specified file.

Specified by:
load in interface KeyStoreLoader
Parameters:
file - the file from which the key store is loaded.
password - the (optional) password used to check the integrity.
Throws:
LogException - on errors.

load

public void load(URL url,
                 String password)
          throws LogException
Description copied from interface: KeyStoreLoader
Loads a key store from the specified URL.

Specified by:
load in interface KeyStoreLoader
Parameters:
url - the URL from which the key store is loaded.
password - the (optional) password used to check the integrity.
Throws:
LogException - on errors.

load

public void load(InputStream stream,
                 String password)
          throws LogException
Description copied from interface: KeyStoreLoader
Loads a key store from the specified input stream.

Specified by:
load in interface KeyStoreLoader
Parameters:
stream - the input stream from which the key store is loaded.
password - the (optional) password used to check the integrity.
Throws:
LogException - on errors.


Copyright © 2004 The Norther Organization. All rights reserved.