org.opends.server.extensions
Class FileBasedTrustManagerProvider

java.lang.Object
  extended by org.opends.server.api.TrustManagerProvider<FileBasedTrustManagerProviderCfg>
      extended by org.opends.server.extensions.FileBasedTrustManagerProvider
All Implemented Interfaces:
ConfigurationChangeListener<FileBasedTrustManagerProviderCfg>

public class FileBasedTrustManagerProvider
extends TrustManagerProvider<FileBasedTrustManagerProviderCfg>
implements ConfigurationChangeListener<FileBasedTrustManagerProviderCfg>

This class defines a trust manager provider that will reference certificates stored in a file located on the Directory Server filesystem.


Constructor Summary
FileBasedTrustManagerProvider()
          Creates a new instance of this file-based trust manager provider.
 
Method Summary
 ConfigChangeResult applyConfigurationChange(FileBasedTrustManagerProviderCfg configuration)
          Applies the configuration changes to this change listener.
 void finalizeTrustManagerProvider()
          Performs any finalization that may be necessary for this trust manager provider.
 javax.net.ssl.TrustManager[] getTrustManagers()
          Retrieves a set of TrustManager objects that may be used for interactions requiring access to a trust manager.
 void initializeTrustManagerProvider(FileBasedTrustManagerProviderCfg configuration)
          Initializes this trust manager provider based on the information in the provided configuration entry.
 boolean isConfigurationAcceptable(TrustManagerProviderCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the provided configuration is acceptable for this trust manager provider.
 boolean isConfigurationChangeAcceptable(FileBasedTrustManagerProviderCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the proposed change to the configuration is acceptable to this change listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileBasedTrustManagerProvider

public FileBasedTrustManagerProvider()
Creates a new instance of this file-based trust manager provider. The initializeTrustManagerProvider method must be called on the resulting object before it may be used.

Method Detail

initializeTrustManagerProvider

public void initializeTrustManagerProvider(FileBasedTrustManagerProviderCfg configuration)
                                    throws ConfigException,
                                           InitializationException
Initializes this trust manager provider based on the information in the provided configuration entry.

Specified by:
initializeTrustManagerProvider in class TrustManagerProvider<FileBasedTrustManagerProviderCfg>
Parameters:
configuration - The configuration to use for this trust manager provider.
Throws:
ConfigException - If an unrecoverable problem arises in the process of performing the initialization as a result of the server configuration.
InitializationException - If a problem occurs during initialization that is not related to the server configuration.

finalizeTrustManagerProvider

public void finalizeTrustManagerProvider()
Performs any finalization that may be necessary for this trust manager provider.

Specified by:
finalizeTrustManagerProvider in class TrustManagerProvider<FileBasedTrustManagerProviderCfg>

getTrustManagers

public javax.net.ssl.TrustManager[] getTrustManagers()
                                              throws DirectoryException
Retrieves a set of TrustManager objects that may be used for interactions requiring access to a trust manager.

Specified by:
getTrustManagers in class TrustManagerProvider<FileBasedTrustManagerProviderCfg>
Returns:
A set of TrustManager objects that may be used for interactions requiring access to a trust manager.
Throws:
DirectoryException - If a problem occurs while attempting to obtain the set of trust managers.

isConfigurationAcceptable

public boolean isConfigurationAcceptable(TrustManagerProviderCfg configuration,
                                         java.util.List<Message> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this trust manager provider. It should be possible to call this method on an uninitialized trust manager provider instance in order to determine whether the trust manager provider would be able to use the provided configuration.

Note that implementations which use a subclass of the provided configuration class will likely need to cast the configuration to the appropriate subclass type.

Overrides:
isConfigurationAcceptable in class TrustManagerProvider<FileBasedTrustManagerProviderCfg>
Parameters:
configuration - The trust manager provider configuration for which to make the determination.
unacceptableReasons - A list that may be used to hold the reasons that the provided configuration is not acceptable.
Returns:
true if the provided configuration is acceptable for this trust manager provider, or false if not.

isConfigurationChangeAcceptable

public boolean isConfigurationChangeAcceptable(FileBasedTrustManagerProviderCfg configuration,
                                               java.util.List<Message> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener.

Specified by:
isConfigurationChangeAcceptable in interface ConfigurationChangeListener<FileBasedTrustManagerProviderCfg>
Parameters:
configuration - The new configuration containing the changes.
unacceptableReasons - A list that can be used to hold messages about why the provided configuration is not acceptable.
Returns:
Returns true if the proposed change is acceptable, or false if it is not.

applyConfigurationChange

public ConfigChangeResult applyConfigurationChange(FileBasedTrustManagerProviderCfg configuration)
Applies the configuration changes to this change listener.

Specified by:
applyConfigurationChange in interface ConfigurationChangeListener<FileBasedTrustManagerProviderCfg>
Parameters:
configuration - The new configuration containing the changes.
Returns:
Returns information about the result of changing the configuration.