| | |
| | | package org.opends.server.api; |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.AccessControlHandlerCfg; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.*; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this access control handler. It should be possible to call this |
| | | * method on an uninitialized access control handler instance in |
| | | * order to determine whether the handler would be able to use the |
| | | * provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The access control handler |
| | | * configuration for which to make the |
| | | * determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this access control handler, or {@code false} if |
| | | * not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | AccessControlHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by access control handler |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any necessary finalization for the access control |
| | | * handler implementation. This will be called just after the |
| | | * handler has been deregistered with the server but before it has |
| | |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.AccessLogPublisherCfg; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.*; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this access log publisher. It should be possible to call this |
| | | * method on an uninitialized access log publisher instance in |
| | | * order to determine whether the access log publisher would be able |
| | | * to use the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The access log publisher |
| | | * configuration for which to make the |
| | | * determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this access log publisher, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | AccessLogPublisherCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by access log publisher |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Close this publisher. |
| | | */ |
| | | public abstract void close(); |
| | |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server. |
| | | AccountStatusNotificationHandlerCfg; |
| | | import org.opends.server.config.ConfigException; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this account status notification handler. It should be possible |
| | | * to call this method on an uninitialized account status |
| | | * notification handler instance in order to determine whether the |
| | | * handler would be able to use the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The account status notification |
| | | * handler configuration for which to |
| | | * make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this account status notification handler, or |
| | | * {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | AccountStatusNotificationHandlerCfg |
| | | configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by account status |
| | | // notification implementations that wish to perform more detailed |
| | | // validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary when this status |
| | | * notification handler is taken out of service. |
| | | */ |
| | |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.AttributeSyntaxCfg; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.ByteString; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this attribute syntax. It should be possible to call this method |
| | | * on an uninitialized attribute syntax instance in order to |
| | | * determine whether the syntax would be able to use the provided |
| | | * configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The attribute syntax configuration |
| | | * for which to make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this attribute syntax, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | AttributeSyntaxCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by attribute syntax |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary for this |
| | | * attribute syntax. By default, no finalization is performed. |
| | | */ |
| | |
| | | import java.util.Set; |
| | | import java.util.concurrent.locks.Lock; |
| | | |
| | | import org.opends.server.admin.Configuration; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.AddOperation; |
| | | import org.opends.server.core.DeleteOperation; |
| | |
| | | |
| | | import static org.opends.server.messages.BackendMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import org.opends.server.admin.Configuration; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | public abstract class Backend |
| | | { |
| | | |
| | | |
| | | |
| | | // The backend that holds a portion of the DIT that is |
| | | // hierarchically above the information in this backend. |
| | | private Backend parentBackend; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this backend. It should be possible to call this method on an |
| | | * uninitialized backend instance in order to determine whether the |
| | | * backend would be able to use the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The backend configuration for which |
| | | * to make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this backend, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | Configuration configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by backend implementations |
| | | // that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Initializes this backend based on the information provided |
| | | * when the backend was configured. |
| | | * |
| | |
| | | |
| | | |
| | | import java.security.cert.Certificate; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.CertificateMapperCfg; |
| | | import org.opends.server.config.ConfigException; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this certificate mapper. It should be possible to call this |
| | | * method on an uninitialized certificate mapper instance in order |
| | | * to determine whether the certificate mapper would be able to use |
| | | * the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The certificate mapper configuration |
| | | * for which to make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this certificate mapper, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | CertificateMapperCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by certificate mapper |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary for this |
| | | * certificate mapper. By default, no finalization is performed. |
| | | */ |
| | |
| | | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.*; |
| | | import org.opends.server.config.ConfigException; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this connection handler. It should be possible to call this |
| | | * method on an uninitialized connection handler instance in order |
| | | * to determine whether the connection handler would be able to use |
| | | * the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The connection handler configuration |
| | | * for which to make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this connection handler, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | ConnectionHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by connection handler |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Operates in a loop, accepting new connections and ensuring that |
| | | * requests on those connections are handled properly. |
| | | */ |
| | |
| | | |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.TreeMap; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this debug log publisher. It should be possible to call this |
| | | * method on an uninitialized debug log publisher instance in |
| | | * order to determine whether the debug log publisher would be able |
| | | * to use the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The debug log publisher |
| | | * configuration for which to make the |
| | | * determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this debug log publisher, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | DebugLogPublisherCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by debug log publisher |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Gets the method trace levels for a specified class. |
| | | * |
| | | * @param className The fully-qualified name of the class for |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this entry cache. It should be possible to call this method on |
| | | * an uninitialized entry cache instance in order to determine |
| | | * whether the entry cache would be able to use the provided |
| | | * configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The entry cache configuration for |
| | | * which to make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this entry cache, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | EntryCacheCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by entry cache |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any necessary cleanup work (e.g., flushing all cached |
| | | * entries and releasing any other held resources) that should be |
| | | * performed when the server is to be shut down or the entry cache |
| | |
| | | |
| | | import java.util.HashSet; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.ErrorLogPublisherCfg; |
| | | import org.opends.server.config.ConfigException; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this error log publisher. It should be possible to call this |
| | | * method on an uninitialized error log publisher instance in |
| | | * order to determine whether the error log publisher would be able |
| | | * to use the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The error log publisher |
| | | * configuration for which to make the |
| | | * determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this error log publisher, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | ErrorLogPublisherCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by error log publisher |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Close this publisher. |
| | | */ |
| | | public abstract void close(); |
| | |
| | | |
| | | |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import org.opends.server.config.ConfigException; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this extended operation handler. It should be possible to call |
| | | * this method on an uninitialized extended operation handler |
| | | * instance in order to determine whether the extended operation |
| | | * handler would be able to use the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The extended operation handler |
| | | * configuration for which to make the |
| | | * determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this extended operation handler, or {@code false} if |
| | | * not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | ExtendedOperationHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by extended operation |
| | | // handler implementations that wish to perform more detailed |
| | | // validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary for this extended |
| | | * operation handler. By default, no finalization is performed. |
| | | */ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | * @param <T> The type of configuration handled by this group |
| | | * implementation. |
| | | */ |
| | | public abstract class Group<T |
| | | extends GroupImplementationCfg> |
| | | public abstract class Group<T extends GroupImplementationCfg> |
| | | { |
| | | /** |
| | | * Initializes a "shell" instance of this group implementation that |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this group implementation. It should be possible to call this |
| | | * method on an uninitialized group implementation instance in order |
| | | * to determine whether the group implementation would be able to |
| | | * use the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The group implementation |
| | | * configuration for which to make the |
| | | * determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this group implementation, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | GroupImplementationCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by group implementations |
| | | // that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any necessary finalization that may be needed whenever |
| | | * this group implementation is taken out of service within the |
| | | * Directory Server (e.g., if it is disabled or the server is |
| | |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.IdentityMapperCfg; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.DirectoryException; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this identity mapper. It should be possible to call this method |
| | | * on an uninitialized identity mapper instance in order to |
| | | * determine whether the identity mapper would be able to use the |
| | | * provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The identity mapper configuration |
| | | * for which to make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this identity mapper, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | IdentityMapperCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by identity mapper |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary for this identity |
| | | * mapper. By default, no finalization is performed. |
| | | */ |
| | |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | import javax.net.ssl.KeyManager; |
| | | |
| | | import org.opends.server.admin.std.server.KeyManagerCfg; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this key manager provider. It should be possible to call this |
| | | * method on an uninitialized key manager provider instance in order |
| | | * to determine whether the key manager provider would be able to |
| | | * use the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The key manager provider |
| | | * configuration for which to make the |
| | | * determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this key manager provider, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | KeyManagerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by key manager provider |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary for this key |
| | | * manager provider. |
| | | */ |
| | |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.ByteString; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this matching rule. It should be possible to call this method on |
| | | * an uninitialized matching rule instance in order to determine |
| | | * whether the matching rule would be able to use the provided |
| | | * configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The matching rule configuration for |
| | | * which to make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this matching rule, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | MatchingRuleCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by matching rule |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be needed whenever this |
| | | * matching rule is taken out of service. |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this monitor provider. It should be possible to call this method |
| | | * on an uninitialized monitor provider instance in order to |
| | | * determine whether the monitor provider would be able to use the |
| | | * provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The monitor provider configuration |
| | | * for which to make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this monitor provider, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | MonitorProviderCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by monitor provider |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Finalizes this monitor provider so that it may be unloaded and |
| | | * taken out of service. This method should be overridden by any |
| | | * monitor provider that has resources that should be released when |
| | |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.PasswordGeneratorCfg; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.ByteString; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this password generator. It should be possible to call this |
| | | * method on an uninitialized password generator instance in order |
| | | * to determine whether the password generator would be able to use |
| | | * the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The password generator configuration |
| | | * for which to make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this password generator, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | PasswordGeneratorCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by password generator |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization work that may be necessary when this |
| | | * password generator is taken out of service. |
| | | */ |
| | |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.PasswordStorageSchemeCfg; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.ByteString; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this password storage scheme. It should be possible to call this |
| | | * method on an uninitialized password storage scheme instance in |
| | | * order to determine whether the password storage scheme would be |
| | | * able to use the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The password storage scheme |
| | | * configuration for which to make the |
| | | * determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this password storage scheme, or {@code false} if |
| | | * not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | PasswordStorageSchemeCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by password storage scheme |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any necessary finalization that might be required when |
| | | * this password storage scheme is no longer needed (e.g., the |
| | | * scheme is disabled or the server is shutting down). |
| | |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import org.opends.server.admin.std.server.PasswordValidatorCfg; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this password validator. It should be possible to call this |
| | | * method on an uninitialized password validator instance in order |
| | | * to determine whether the password validator would be able to use |
| | | * the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The password validator configuration |
| | | * for which to make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this password validator, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | PasswordValidatorCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by password validator |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that might be required when this |
| | | * password validator is unloaded. No action is taken in the |
| | | * default implementation. |
| | |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.SASLMechanismHandlerCfg; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.BindOperation; |
| | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class defines the set of methods and structures that must be |
| | | * implemented by a Directory Server module that implements the |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this SASL mechanism handler. It should be possible to call this |
| | | * method on an uninitialized SASL mechanism handler instance in |
| | | * order to determine whether the SASL mechanism handler would be |
| | | * able to use the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The SASL mechanism handler |
| | | * configuration for which to make the |
| | | * determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this SASL mechanism handler, or {@code false} if |
| | | * not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | SASLMechanismHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by SASL mechanism handler |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary for this SASL |
| | | * mechanism handler. By default, no finalization is performed. |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this synchronization provider. It should be possible to call |
| | | * this method on an uninitialized synchronization provider instance |
| | | * in order to determine whether the synchronization provider would |
| | | * be able to use the provided configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The synchronization provider |
| | | * configuration for which to make the |
| | | * the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this synchronization provider, or {@code false} if |
| | | * not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | SynchronizationProviderCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by synchronization |
| | | // provider implementations that wish to perform more detailed |
| | | // validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any necessary finalization for this synchronization |
| | | * provider. This will be called just after the provider has been |
| | | * deregistered with the server but before it has been unloaded. |
| | |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | import javax.net.ssl.TrustManager; |
| | | |
| | | import org.opends.server.admin.std.server.TrustManagerCfg; |
| | |
| | | |
| | | |
| | | /** |
| | | * 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. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The trust manager provider |
| | | * configuration for which to make the |
| | | * determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this trust manager provider, or {@code false} if |
| | | * not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | TrustManagerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by trust manager provider |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary for this trust |
| | | * manager provider. |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this virtual attribute provider. It should be possible to call |
| | | * this method on an uninitialized virtual attribute provider |
| | | * instance in order to determine whether the virtual attribute |
| | | * provider would be able to use the provided configuration. |
| | | * |
| | | * @param configuration The virtual attribute provider |
| | | * configuration for which to make the |
| | | * determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this virtual attribute provider, or {@code false} if |
| | | * not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | VirtualAttributeCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by virtual attribute |
| | | // provider implementations that wish to perform more detailed |
| | | // validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary whenever this |
| | | * virtual attribute provider is taken out of service. |
| | | */ |
| | |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import org.opends.server.admin.std.server.PluginCfg; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this plugin. It should be possible to call this method on an |
| | | * uninitialized plugin instance in order to determine whether the |
| | | * plugin would be able to use the provided configuration. |
| | | * |
| | | * @param configuration The plugin configuration for which |
| | | * to make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this plugin, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by plugin implementations |
| | | // that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any initialization that should be done for all types of |
| | | * plugins regardless of type. This should only be called by the |
| | | * core Directory Server code during the course of loading a plugin. |
| | |
| | | import java.util.Set; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | import org.opends.server.admin.Configuration; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.RootDSEBackendCfg; |
| | | import org.opends.server.api.Backend; |
| | | import org.opends.server.config.ConfigEntry; |
| | | import org.opends.server.config.ConfigException; |
| | |
| | | import org.opends.server.core.ModifyOperation; |
| | | import org.opends.server.core.ModifyDNOperation; |
| | | import org.opends.server.core.SearchOperation; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | |
| | | import org.opends.server.types.CancelRequest; |
| | | import org.opends.server.types.CancelResult; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.Entry; |
| | |
| | | import org.opends.server.util.Validator; |
| | | |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import static org.opends.server.messages.BackendMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.messages.ConfigMessages. |
| | | MSGID_CONFIG_BACKEND_ERROR_INTERACTING_WITH_BACKEND_ENTRY; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | import org.opends.server.admin.std.server.RootDSEBackendCfg; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.Configuration; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void configureBackend(Configuration config) throws ConfigException |
| | | public void configureBackend(Configuration config) |
| | | throws ConfigException |
| | | { |
| | | Validator.ensureNotNull(config); |
| | | Validator.ensureTrue(config instanceof RootDSEBackendCfg); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(Configuration configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | RootDSEBackendCfg config = (RootDSEBackendCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | RootDSEBackendCfg cfg, |
| | | List<String> unacceptableReasons) |
| | |
| | | |
| | | return new ConfigChangeResult(resultCode, adminActionRequired, messages); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import java.util.List; |
| | | import java.util.concurrent.locks.Lock; |
| | | |
| | | import org.opends.server.admin.Configuration; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.TaskBackendCfg; |
| | | import org.opends.server.api.Backend; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.config.ConfigEntry; |
| | |
| | | import org.opends.server.core.ModifyOperation; |
| | | import org.opends.server.core.ModifyDNOperation; |
| | | import org.opends.server.core.SearchOperation; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.BackupConfig; |
| | | import org.opends.server.types.BackupDirectory; |
| | | import org.opends.server.types.CancelledOperationException; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.LDIFExportConfig; |
| | |
| | | import org.opends.server.types.ResultCode; |
| | | import org.opends.server.types.SearchFilter; |
| | | import org.opends.server.types.SearchScope; |
| | | import org.opends.server.util.Validator; |
| | | |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.messages.BackendMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | import org.opends.server.util.Validator; |
| | | import org.opends.server.admin.std.server.TaskBackendCfg; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.Configuration; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void configureBackend(Configuration config) throws ConfigException |
| | | public void configureBackend(Configuration config) |
| | | throws ConfigException |
| | | { |
| | | Validator.ensureNotNull(config); |
| | | Validator.ensureTrue(config instanceof TaskBackendCfg); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(Configuration configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | TaskBackendCfg config = (TaskBackendCfg) configuration; |
| | | return isConfigAcceptable(config, unacceptableReasons, null); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable(TaskBackendCfg configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | return isConfigAcceptable(configEntry, unacceptableReasons, |
| | | taskBackingFile); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for this task |
| | | * backend. |
| | | * |
| | | * @param config The configuration for which to make the |
| | | * determination. |
| | | * @param unacceptableReasons A list into which the unacceptable reasons |
| | | * should be placed. |
| | | * @param taskBackingFile The currently-configured task backing file, or |
| | | * {@code null} if it should not be taken into |
| | | * account. |
| | | * |
| | | * @return {@code true} if the configuration is acceptable, or {@code false} |
| | | * if not. |
| | | */ |
| | | private static boolean isConfigAcceptable(TaskBackendCfg config, |
| | | List<String> unacceptableReasons, |
| | | String taskBackingFile) |
| | | { |
| | | boolean configIsAcceptable = true; |
| | | |
| | | |
| | | try |
| | | { |
| | | String tmpBackingFile = configEntry.getTaskBackingFile(); |
| | | if (! taskBackingFile.equals(tmpBackingFile)) |
| | | String tmpBackingFile = config.getTaskBackingFile(); |
| | | if ((taskBackingFile == null) || |
| | | (! taskBackingFile.equals(tmpBackingFile))) |
| | | { |
| | | File f = getFileForPath(tmpBackingFile); |
| | | if (f.exists()) |
| | | { |
| | | int msgID = MSGID_TASKBE_BACKING_FILE_EXISTS; |
| | | unacceptableReasons.add(getMessage(msgID, tmpBackingFile)); |
| | | configIsAcceptable = false; |
| | | // This is only a problem if it's different from the active one. |
| | | if (taskBackingFile != null) |
| | | { |
| | | int msgID = MSGID_TASKBE_BACKING_FILE_EXISTS; |
| | | unacceptableReasons.add(getMessage(msgID, tmpBackingFile)); |
| | | configIsAcceptable = false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | configIsAcceptable = false; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return configIsAcceptable; |
| | | } |
| | | |
| | |
| | | { |
| | | return taskScheduler.getRecurringTask(taskEntryDN); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | |
| | | { |
| | | if (newConfiguration.isEnabled()) |
| | | { |
| | | newHandler = loadHandler(newHandlerClass, newConfiguration); |
| | | newHandler = loadHandler(newHandlerClass, newConfiguration, true); |
| | | } |
| | | else |
| | | { |
| | |
| | | // can load the access control handler class. |
| | | if (configuration.isEnabled()) |
| | | { |
| | | loadHandler(configuration.getAclHandlerClass(), null); |
| | | loadHandler(configuration.getAclHandlerClass(), configuration, false); |
| | | } |
| | | } |
| | | catch (InitializationException e) |
| | |
| | | |
| | | |
| | | /** |
| | | * Loads the specified class, instantiates it as a AccessControlProvider, and |
| | | * Loads the specified class, instantiates it as a AccessControlHandler, and |
| | | * optionally initializes that instance. |
| | | * |
| | | * @param className The fully-qualified name of the Access Control |
| | | * provider class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the |
| | | * Access Control Provider, or {@code null} if the |
| | | * Access Control Provider should not be initialized. |
| | | * Access Control Handler. It must not be |
| | | * {@code null}. |
| | | * @param initialize Indicates whether the access control handler |
| | | * instance should be initialized. |
| | | * |
| | | * @return The possibly initialized Access Control Provider. |
| | | * @return The possibly initialized Access Control Handler. |
| | | * |
| | | * @throws InitializationException If a problem occurred while attempting to |
| | | * initialize the Access Control Provider. |
| | | * initialize the Access Control Handler. |
| | | */ |
| | | private AccessControlHandler<? extends AccessControlHandlerCfg> |
| | | loadHandler(String className, |
| | | AccessControlHandlerCfg configuration) |
| | | AccessControlHandlerCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | configuration.definition().getServerConfigurationClass()); |
| | | method.invoke(provider, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = |
| | | provider.getClass().getMethod("isConfigurationAcceptable", |
| | | AccessControlHandlerCfg.class, |
| | | List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(provider, configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_AUTHZ_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return provider; |
| | | } |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | |
| | | try |
| | | { |
| | | // Load the class but don't initialize it. |
| | | loadNotificationHandler(className, null); |
| | | loadNotificationHandler(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | try |
| | | { |
| | | // Load the class but don't initialize it. |
| | | loadNotificationHandler (className, null); |
| | | loadNotificationHandler (className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | // Load the notification handler class... |
| | | AccountStatusNotificationHandler |
| | | <? extends AccountStatusNotificationHandlerCfg> handlerClass; |
| | | handlerClass = loadNotificationHandler (className, configuration); |
| | | handlerClass = loadNotificationHandler (className, configuration, true); |
| | | |
| | | // ... and install the entry cache in the server. |
| | | DN configEntryDN = configuration.dn(); |
| | |
| | | * @param className The fully-qualified name of the notification handler |
| | | * class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the |
| | | * notification handler, or {@code null} if the |
| | | * notification handler should not be initialized. |
| | | * notification handler. It must not be {@code null}. |
| | | * @param initialize Indicates whether the key manager provider instance |
| | | * should be initialized. |
| | | * |
| | | * @return The possibly initialized notification handler. |
| | | * |
| | |
| | | <? extends AccountStatusNotificationHandlerCfg> |
| | | loadNotificationHandler( |
| | | String className, |
| | | AccountStatusNotificationHandlerCfg configuration |
| | | ) |
| | | AccountStatusNotificationHandlerCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | <? extends AccountStatusNotificationHandlerCfg>) |
| | | handlerClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = notificationHandler.getClass().getMethod( |
| | | "initializeStatusNotificationHandler", |
| | |
| | | ); |
| | | method.invoke(notificationHandler, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = |
| | | notificationHandler.getClass().getMethod( |
| | | "isConfigurationAcceptable", |
| | | AccountStatusNotificationHandlerCfg.class, List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(notificationHandler, |
| | | configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_ACCTNOTHANDLER_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return notificationHandler; |
| | | } |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | |
| | | String className = syntaxConfiguration.getSyntaxClass(); |
| | | try |
| | | { |
| | | AttributeSyntax syntax = loadSyntax(className, syntaxConfiguration); |
| | | AttributeSyntax syntax = loadSyntax(className, syntaxConfiguration, |
| | | true); |
| | | |
| | | try |
| | | { |
| | |
| | | String className = configuration.getSyntaxClass(); |
| | | try |
| | | { |
| | | loadSyntax(className, null); |
| | | loadSyntax(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getSyntaxClass(); |
| | | try |
| | | { |
| | | syntax = loadSyntax(className, configuration); |
| | | syntax = loadSyntax(className, configuration, true); |
| | | |
| | | try |
| | | { |
| | |
| | | String className = configuration.getSyntaxClass(); |
| | | try |
| | | { |
| | | loadSyntax(className, null); |
| | | loadSyntax(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | AttributeSyntax syntax = null; |
| | | try |
| | | { |
| | | syntax = loadSyntax(className, configuration); |
| | | syntax = loadSyntax(className, configuration, true); |
| | | |
| | | try |
| | | { |
| | |
| | | * @param className The fully-qualified name of the attribute syntax |
| | | * class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the attribute |
| | | * syntax, or {@code null} if the attribute syntax |
| | | * should not be initialized. |
| | | * syntax. It should not be {@code null}. |
| | | * @param initialize Indicates whether the key manager provider instance |
| | | * should be initialized. |
| | | * |
| | | * @return The possibly initialized attribute syntax. |
| | | * |
| | |
| | | * initialize the attribute syntax. |
| | | */ |
| | | private AttributeSyntax loadSyntax(String className, |
| | | AttributeSyntaxCfg configuration) |
| | | AttributeSyntaxCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | propertyDefinition.loadClass(className, AttributeSyntax.class); |
| | | AttributeSyntax syntax = syntaxClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = |
| | | syntax.getClass().getMethod("initializeSyntax", |
| | | configuration.definition().getServerConfigurationClass()); |
| | | method.invoke(syntax, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = syntax.getClass().getMethod("isConfigurationAcceptable", |
| | | AttributeSyntaxCfg.class, |
| | | List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(syntax, configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_SCHEMA_SYNTAX_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return syntax; |
| | | } |
| | |
| | | String.valueOf(backendDN))); |
| | | return false; |
| | | } |
| | | |
| | | Backend b = (Backend) backendClass.newInstance(); |
| | | if (! b.isConfigurationAcceptable(configEntry, unacceptableReason)) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | |
| | | String className = mapperConfiguration.getMapperClass(); |
| | | try |
| | | { |
| | | CertificateMapper mapper = loadMapper(className, mapperConfiguration); |
| | | CertificateMapper mapper = loadMapper(className, mapperConfiguration, |
| | | true); |
| | | certificateMappers.put(mapperConfiguration.dn(), mapper); |
| | | DirectoryServer.registerCertificateMapper(mapperConfiguration.dn(), |
| | | mapper); |
| | |
| | | String className = configuration.getMapperClass(); |
| | | try |
| | | { |
| | | loadMapper(className, null); |
| | | loadMapper(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getMapperClass(); |
| | | try |
| | | { |
| | | certificateMapper = loadMapper(className, configuration); |
| | | certificateMapper = loadMapper(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getMapperClass(); |
| | | try |
| | | { |
| | | loadMapper(className, null); |
| | | loadMapper(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | CertificateMapper certificateMapper = null; |
| | | try |
| | | { |
| | | certificateMapper = loadMapper(className, configuration); |
| | | certificateMapper = loadMapper(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | * @param className The fully-qualified name of the certificate mapper |
| | | * class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the |
| | | * certificate mapper, or {@code null} if the |
| | | * certificate mapper should not be initialized. |
| | | * certificate mapper. It must not be {@code null}. |
| | | * @param initialize Indicates whether the certificate mapper instance |
| | | * should be initialized. |
| | | * |
| | | * @return The possibly initialized certificate mapper. |
| | | * |
| | |
| | | * initialize the certificate mapper. |
| | | */ |
| | | private CertificateMapper loadMapper(String className, |
| | | CertificateMapperCfg configuration) |
| | | CertificateMapperCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | propertyDefinition.loadClass(className, CertificateMapper.class); |
| | | CertificateMapper mapper = mapperClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = |
| | | mapper.getClass().getMethod("initializeCertificateMapper", |
| | | configuration.definition().getServerConfigurationClass()); |
| | | method.invoke(mapper, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = mapper.getClass().getMethod("isConfigurationAcceptable", |
| | | CertificateMapperCfg.class, |
| | | List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(mapper, configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_CERTMAPPER_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return mapper; |
| | | } |
| | |
| | | .getJavaImplementationClassPropertyDefinition(); |
| | | |
| | | // Load the class and cast it to a connection handler. |
| | | ConnectionHandler connectionHandler = null; |
| | | Class<? extends ConnectionHandler> theClass; |
| | | try { |
| | | theClass = pd.loadClass(className, ConnectionHandler.class); |
| | | theClass.newInstance(); |
| | | connectionHandler = theClass.newInstance(); |
| | | } catch (Exception e) { |
| | | if (debugEnabled()) |
| | | { |
| | |
| | | // Determine the initialization method to use: it must take a |
| | | // single parameter which is the exact type of the configuration |
| | | // object. |
| | | theClass.getMethod("initializeConnectionHandler", config.definition() |
| | | .getServerConfigurationClass()); |
| | | Method method = theClass.getMethod("isConfigurationAcceptable", |
| | | ConnectionHandlerCfg.class, |
| | | List.class); |
| | | Boolean acceptable = (Boolean) method.invoke(connectionHandler, config, |
| | | unacceptableReasons); |
| | | |
| | | if (! acceptable) |
| | | { |
| | | return false; |
| | | } |
| | | } catch (Exception e) { |
| | | if (debugEnabled()) |
| | | { |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.api.EntryCache; |
| | | import org.opends.server.extensions.DefaultEntryCache; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.ErrorLogCategory; |
| | | import org.opends.server.types.ErrorLogSeverity; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | import org.opends.server.config.ConfigException; |
| | | |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import static org.opends.server.messages.ConfigMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | |
| | | import org.opends.server.admin.ClassPropertyDefinition; |
| | | import org.opends.server.admin.server.ConfigurationAddListener; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | |
| | | import org.opends.server.admin.std.server.EntryCacheCfg; |
| | | import org.opends.server.admin.std.server.RootCfg; |
| | | import org.opends.server.admin.std.meta.EntryCacheCfgDefn; |
| | | import org.opends.server.api.EntryCache; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.extensions.DefaultEntryCache; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.ErrorLogCategory; |
| | | import org.opends.server.types.ErrorLogSeverity; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.messages.ConfigMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | try |
| | | { |
| | | // Load the class but don't initialize it. |
| | | loadEntryCache(className, null); |
| | | loadEntryCache(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | try |
| | | { |
| | | // Load the class but don't initialize it. |
| | | loadEntryCache(className, null); |
| | | loadEntryCache(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | throws InitializationException |
| | | { |
| | | // Load the entry cache class... |
| | | EntryCache entryCache = loadEntryCache (className, configuration); |
| | | EntryCache entryCache = loadEntryCache (className, configuration, true); |
| | | |
| | | // ... and install the entry cache in the server. |
| | | DirectoryServer.setEntryCache(entryCache); |
| | |
| | | * @param className The fully-qualified name of the entry cache |
| | | * class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the |
| | | * entry cache, or {@code null} if the |
| | | * entry cache should not be initialized. |
| | | * entry cache. It must not be {@code null}. |
| | | * @param initialize Indicates whether the key manager provider instance |
| | | * should be initialized. |
| | | * |
| | | * @return The possibly initialized entry cache. |
| | | * |
| | |
| | | */ |
| | | private EntryCache<? extends EntryCacheCfg> loadEntryCache( |
| | | String className, |
| | | EntryCacheCfg configuration |
| | | EntryCacheCfg configuration, |
| | | boolean initialize |
| | | ) |
| | | throws InitializationException |
| | | { |
| | |
| | | cacheClass = propertyDefinition.loadClass(className, EntryCache.class); |
| | | cache = (EntryCache<? extends EntryCacheCfg>) cacheClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = cache.getClass().getMethod( |
| | | "initializeEntryCache", |
| | |
| | | ); |
| | | method.invoke(cache, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = cache.getClass().getMethod("isConfigurationAcceptable", |
| | | EntryCacheCfg.class, |
| | | List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(cache, configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_ENTRYCACHE_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return cache; |
| | | } |
| | |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.lang.reflect.Method; |
| | | |
| | | import org.opends.server.api.ExtendedOperationHandler; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.messages.ConfigMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.getMessage; |
| | | import org.opends.server.admin.ClassPropertyDefinition; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.server.ConfigurationAddListener; |
| | | import org.opends.server.admin.server.ConfigurationDeleteListener; |
| | |
| | | import org.opends.server.admin.std.server.ExtendedOperationHandlerCfg; |
| | | import org.opends.server.admin.std.server.RootCfg; |
| | | import org.opends.server.admin.std.meta.ExtendedOperationHandlerCfgDefn; |
| | | import org.opends.server.admin.ClassPropertyDefinition; |
| | | import org.opends.server.api.ExtendedOperationHandler; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.messages.ConfigMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class defines a utility that will be used to manage the set of extended |
| | | * operation handlers defined in the Directory Server. It will initialize the |
| | |
| | | |
| | | |
| | | |
| | | |
| | | // A mapping between the DNs of the config entries and the associated extended |
| | | // operation handlers. |
| | | private ConcurrentHashMap<DN,ExtendedOperationHandler> handlers; |
| | |
| | | */ |
| | | public ExtendedOperationConfigManager() |
| | | { |
| | | handlers = new ConcurrentHashMap<DN,ExtendedOperationHandler>(); |
| | | handlers = new ConcurrentHashMap<DN,ExtendedOperationHandler>(); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | // Determines whether or not the new configuration's implementation |
| | | // class is acceptable. |
| | | private boolean isJavaClassAcceptable( |
| | | ExtendedOperationHandlerCfg config, |
| | | List<String> unacceptableReasons) |
| | | private boolean isJavaClassAcceptable(ExtendedOperationHandlerCfg config, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | String className = config.getJavaImplementationClass(); |
| | | ExtendedOperationHandlerCfgDefn d = |
| | |
| | | Class<? extends ExtendedOperationHandler> theClass; |
| | | try { |
| | | theClass = pd.loadClass(className, ExtendedOperationHandler.class); |
| | | theClass.newInstance(); |
| | | ExtendedOperationHandler extOpHandler = theClass.newInstance(); |
| | | |
| | | // Determine the initialization method to use: it must take a |
| | | // single parameter which is the exact type of the configuration |
| | | // object. |
| | | theClass.getMethod("initializeExtendedOperationHandler", |
| | | config.definition().getServerConfigurationClass()); |
| | | Method method = theClass.getMethod("isConfigurationAcceptable", |
| | | ExtendedOperationHandlerCfg.class, |
| | | List.class); |
| | | Boolean acceptable = (Boolean) method.invoke(extOpHandler, config, |
| | | unacceptableReasons); |
| | | |
| | | if (! acceptable) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | |
| | | import org.opends.server.workflowelement.localbackend.*; |
| | | import org.opends.server.admin.ClassPropertyDefinition; |
| | | import org.opends.server.admin.server.ConfigurationAddListener; |
| | |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class provides a mechanism for interacting with all groups defined in |
| | | * the Directory Server. It will handle all necessary processing at server |
| | |
| | | |
| | | |
| | | |
| | | |
| | | // A mapping between the DNs of the config entries and the associated |
| | | // group implementations. |
| | | private ConcurrentHashMap<DN,Group> groupImplementations; |
| | |
| | | String className = groupConfiguration.getGroupClass(); |
| | | try |
| | | { |
| | | Group group = loadGroup(className, groupConfiguration); |
| | | Group group = loadGroup(className, groupConfiguration, true); |
| | | groupImplementations.put(groupConfiguration.dn(), group); |
| | | } |
| | | catch (InitializationException ie) |
| | |
| | | String className = configuration.getGroupClass(); |
| | | try |
| | | { |
| | | loadGroup(className, null); |
| | | loadGroup(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getGroupClass(); |
| | | try |
| | | { |
| | | group = loadGroup(className, configuration); |
| | | group = loadGroup(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getGroupClass(); |
| | | try |
| | | { |
| | | loadGroup(className, null); |
| | | loadGroup(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | Group group = null; |
| | | try |
| | | { |
| | | group = loadGroup(className, configuration); |
| | | group = loadGroup(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | * @param className The fully-qualified name of the group implementation |
| | | * class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the group |
| | | * implementation, or {@code null} if the group |
| | | * implementation should not be initialized. |
| | | * implementation. It must not be {@code null}. |
| | | * @param initialize Indicates whether the key manager provider instance |
| | | * should be initialized. |
| | | * |
| | | * @return The possibly initialized group implementation. |
| | | * |
| | |
| | | * initialize the group implementation. |
| | | */ |
| | | private Group loadGroup(String className, |
| | | GroupImplementationCfg configuration) |
| | | GroupImplementationCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | propertyDefinition.loadClass(className, Group.class); |
| | | Group group = groupClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = |
| | | group.getClass().getMethod("initializeGroupImplementation", |
| | | configuration.definition().getServerConfigurationClass()); |
| | | method.invoke(group, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = group.getClass().getMethod("isConfigurationAcceptable", |
| | | GroupImplementationCfg.class, |
| | | List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(group, configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_GROUP_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return group; |
| | | } |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | |
| | | String className = mapperConfiguration.getMapperClass(); |
| | | try |
| | | { |
| | | IdentityMapper mapper = loadMapper(className, mapperConfiguration); |
| | | IdentityMapper mapper = loadMapper(className, mapperConfiguration, |
| | | true); |
| | | identityMappers.put(mapperConfiguration.dn(), mapper); |
| | | DirectoryServer.registerIdentityMapper(mapperConfiguration.dn(), |
| | | mapper); |
| | |
| | | String className = configuration.getMapperClass(); |
| | | try |
| | | { |
| | | loadMapper(className, null); |
| | | loadMapper(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getMapperClass(); |
| | | try |
| | | { |
| | | identityMapper = loadMapper(className, configuration); |
| | | identityMapper = loadMapper(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getMapperClass(); |
| | | try |
| | | { |
| | | loadMapper(className, null); |
| | | loadMapper(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | IdentityMapper identityMapper = null; |
| | | try |
| | | { |
| | | identityMapper = loadMapper(className, configuration); |
| | | identityMapper = loadMapper(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | * @param className The fully-qualified name of the identity mapper |
| | | * class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the identity |
| | | * mapper, or {@code null} if the identity mapper |
| | | * should not be initialized. |
| | | * mapper. It must not be {@code null}. |
| | | * @param initialize Indicates whether the identity mapper instance |
| | | * should be initialized. |
| | | * |
| | | * @return The possibly initialized identity mapper. |
| | | * |
| | |
| | | * initialize the identity mapper. |
| | | */ |
| | | private IdentityMapper loadMapper(String className, |
| | | IdentityMapperCfg configuration) |
| | | IdentityMapperCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | propertyDefinition.loadClass(className, IdentityMapper.class); |
| | | IdentityMapper mapper = mapperClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = |
| | | mapper.getClass().getMethod("initializeIdentityMapper", |
| | | configuration.definition().getServerConfigurationClass()); |
| | | method.invoke(mapper, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = mapper.getClass().getMethod("isConfigurationAcceptable", |
| | | IdentityMapperCfg.class, |
| | | List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(mapper, configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_IDMAPPER_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return mapper; |
| | | } |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | |
| | | try |
| | | { |
| | | KeyManagerProvider provider = |
| | | loadProvider(className, providerConfig); |
| | | loadProvider(className, providerConfig, true); |
| | | providers.put(providerConfig.dn(), provider); |
| | | DirectoryServer.registerKeyManagerProvider(providerConfig.dn(), |
| | | provider); |
| | |
| | | String className = configuration.getJavaImplementationClass(); |
| | | try |
| | | { |
| | | loadProvider(className, null); |
| | | loadProvider(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getJavaImplementationClass(); |
| | | try |
| | | { |
| | | provider = loadProvider(className, configuration); |
| | | provider = loadProvider(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getJavaImplementationClass(); |
| | | try |
| | | { |
| | | loadProvider(className, null); |
| | | loadProvider(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | KeyManagerProvider provider = null; |
| | | try |
| | | { |
| | | provider = loadProvider(className, configuration); |
| | | provider = loadProvider(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | * @param className The fully-qualified name of the key manager |
| | | * provider class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the key |
| | | * manager provider, or {@code null} if the provider |
| | | * should not be initialized. |
| | | * manager provider. It must not be {@code null}. |
| | | * @param initialize Indicates whether the key manager provider instance |
| | | * should be initialized. |
| | | * |
| | | * @return The possibly initialized key manager provider. |
| | | * |
| | | * @throws InitializationException If a problem occurred while attempting to |
| | | * initialize the key manager provider. |
| | | * @throws InitializationException If the provided configuration is not |
| | | * acceptable, or if a problem occured while |
| | | * attempting to initialize the key manager |
| | | * provider using that configuration. |
| | | */ |
| | | private KeyManagerProvider loadProvider(String className, |
| | | KeyManagerCfg configuration) |
| | | KeyManagerCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | propertyDefinition.loadClass(className, KeyManagerProvider.class); |
| | | KeyManagerProvider provider = providerClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | |
| | | if (initialize) |
| | | { |
| | | Method method = |
| | | provider.getClass().getMethod("initializeKeyManagerProvider", |
| | | configuration.definition().getServerConfigurationClass()); |
| | | method.invoke(provider, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = |
| | | provider.getClass().getMethod("isConfigurationAcceptable", |
| | | KeyManagerCfg.class, List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(provider, configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_KEYMANAGER_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return provider; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | throw ie; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | int msgID = MSGID_CONFIG_KEYMANAGER_INITIALIZATION_FAILED; |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | |
| | | try |
| | | { |
| | | MatchingRule matchingRule = |
| | | loadMatchingRule(className, mrConfiguration); |
| | | loadMatchingRule(className, mrConfiguration, true); |
| | | |
| | | try |
| | | { |
| | |
| | | String className = configuration.getMatchingRuleClass(); |
| | | try |
| | | { |
| | | loadMatchingRule(className, null); |
| | | loadMatchingRule(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getMatchingRuleClass(); |
| | | try |
| | | { |
| | | matchingRule = loadMatchingRule(className, configuration); |
| | | matchingRule = loadMatchingRule(className, configuration, true); |
| | | |
| | | try |
| | | { |
| | |
| | | String className = configuration.getMatchingRuleClass(); |
| | | try |
| | | { |
| | | loadMatchingRule(className, null); |
| | | loadMatchingRule(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | MatchingRule matchingRule = null; |
| | | try |
| | | { |
| | | matchingRule = loadMatchingRule(className, configuration); |
| | | matchingRule = loadMatchingRule(className, configuration, true); |
| | | |
| | | try |
| | | { |
| | |
| | | * @param className The fully-qualified name of the attribute syntax |
| | | * class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the attribute |
| | | * syntax, or {@code null} if the attribute syntax |
| | | * should not be initialized. |
| | | * syntax. It must not be {@code null}. |
| | | * @param initialize Indicates whether the matching rule instance should |
| | | * be initialized. |
| | | * |
| | | * @return The possibly initialized attribute syntax. |
| | | * |
| | |
| | | * initialize the attribute syntax. |
| | | */ |
| | | private MatchingRule loadMatchingRule(String className, |
| | | MatchingRuleCfg configuration) |
| | | MatchingRuleCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | configuration.getClass().getName()); |
| | | } |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = |
| | | matchingRule.getClass().getMethod("initializeMatchingRule", |
| | | configuration.definition().getServerConfigurationClass()); |
| | | method.invoke(matchingRule, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = |
| | | matchingRule.getClass().getMethod("isConfigurationAcceptable", |
| | | MatchingRuleCfg.class, |
| | | List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(matchingRule, |
| | | configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_SCHEMA_MR_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return matchingRule; |
| | | } |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | |
| | | try |
| | | { |
| | | PasswordGenerator<? extends PasswordGeneratorCfg> |
| | | generator = loadGenerator(className, generatorConfiguration); |
| | | generator = loadGenerator(className, generatorConfiguration, |
| | | true); |
| | | passwordGenerators.put(generatorConfiguration.dn(), generator); |
| | | DirectoryServer.registerPasswordGenerator(generatorConfiguration.dn(), |
| | | generator); |
| | |
| | | String className = configuration.getGeneratorClass(); |
| | | try |
| | | { |
| | | loadGenerator(className, null); |
| | | loadGenerator(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | passwordGenerator = null; |
| | | try |
| | | { |
| | | passwordGenerator = loadGenerator(className, configuration); |
| | | passwordGenerator = loadGenerator(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getGeneratorClass(); |
| | | try |
| | | { |
| | | loadGenerator(className, null); |
| | | loadGenerator(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getGeneratorClass(); |
| | | try |
| | | { |
| | | passwordGenerator = loadGenerator(className, configuration); |
| | | passwordGenerator = loadGenerator(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | * @param configuration The configuration to use to initialize the |
| | | * password generator, or {@code null} if the |
| | | * password generator should not be initialized. |
| | | * @param initialize Indicates whether the password generator instance |
| | | * should be initialized. |
| | | * |
| | | * @return The possibly initialized password generator. |
| | | * |
| | |
| | | */ |
| | | private PasswordGenerator<? extends PasswordGeneratorCfg> |
| | | loadGenerator(String className, |
| | | PasswordGeneratorCfg configuration) |
| | | PasswordGeneratorCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | (PasswordGenerator<? extends PasswordGeneratorCfg>) |
| | | generatorClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = |
| | | generator.getClass().getMethod("initializePasswordGenerator", |
| | | configuration.definition().getServerConfigurationClass()); |
| | | method.invoke(generator, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = |
| | | generator.getClass().getMethod("isConfigurationAcceptable", |
| | | PasswordGeneratorCfg.class, |
| | | List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(generator, configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_PWGENERATOR_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return generator; |
| | | } |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | |
| | | try |
| | | { |
| | | // Load the class but don't initialize it. |
| | | loadPasswordStorageScheme (className, null); |
| | | loadPasswordStorageScheme (className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | try |
| | | { |
| | | // Load the class but don't initialize it. |
| | | loadPasswordStorageScheme (className, null); |
| | | loadPasswordStorageScheme (className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | // Load the password storage scheme class... |
| | | PasswordStorageScheme |
| | | <? extends PasswordStorageSchemeCfg> schemeClass; |
| | | schemeClass = loadPasswordStorageScheme (className, configuration); |
| | | schemeClass = loadPasswordStorageScheme (className, configuration, true); |
| | | |
| | | // ... and install the password storage scheme in the server. |
| | | DN configEntryDN = configuration.dn(); |
| | |
| | | * @param className The fully-qualified name of the class |
| | | * to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the |
| | | * class, or {@code null} if the |
| | | * class should not be initialized. |
| | | * class. It must not be {@code null}. |
| | | * @param initialize Indicates whether the password storage scheme |
| | | * instance should be initialized. |
| | | * |
| | | * @return The possibly initialized password storage scheme. |
| | | * |
| | |
| | | private PasswordStorageScheme <? extends PasswordStorageSchemeCfg> |
| | | loadPasswordStorageScheme( |
| | | String className, |
| | | PasswordStorageSchemeCfg configuration |
| | | ) |
| | | PasswordStorageSchemeCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | (PasswordStorageScheme<? extends PasswordStorageSchemeCfg>) |
| | | schemeClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = passwordStorageScheme.getClass().getMethod( |
| | | "initializePasswordStorageScheme", |
| | |
| | | ); |
| | | method.invoke(passwordStorageScheme, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = passwordStorageScheme.getClass().getMethod( |
| | | "isConfigurationAcceptable", |
| | | PasswordStorageSchemeCfg.class, List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(passwordStorageScheme, |
| | | configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_PWSCHEME_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return passwordStorageScheme; |
| | | } |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | |
| | | try |
| | | { |
| | | PasswordValidator<? extends PasswordValidatorCfg> |
| | | validator = loadValidator(className, validatorConfiguration); |
| | | validator = loadValidator(className, validatorConfiguration, |
| | | true); |
| | | passwordValidators.put(validatorConfiguration.dn(), validator); |
| | | DirectoryServer.registerPasswordValidator(validatorConfiguration.dn(), |
| | | validator); |
| | |
| | | String className = configuration.getValidatorClass(); |
| | | try |
| | | { |
| | | loadValidator(className, null); |
| | | loadValidator(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getValidatorClass(); |
| | | try |
| | | { |
| | | passwordValidator = loadValidator(className, configuration); |
| | | passwordValidator = loadValidator(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getValidatorClass(); |
| | | try |
| | | { |
| | | loadValidator(className, null); |
| | | loadValidator(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | passwordValidator = null; |
| | | try |
| | | { |
| | | passwordValidator = loadValidator(className, configuration); |
| | | passwordValidator = loadValidator(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | * @param className The fully-qualified name of the password validator |
| | | * class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the |
| | | * password validator, or {@code null} if the |
| | | * password validator should not be initialized. |
| | | * password validator. It must not be {@code null}. |
| | | * @param initialize Indicates whether the password validator instance |
| | | * should be initialized. |
| | | * |
| | | * @return The possibly initialized password validator. |
| | | * |
| | |
| | | */ |
| | | private PasswordValidator<? extends PasswordValidatorCfg> |
| | | loadValidator(String className, |
| | | PasswordValidatorCfg configuration) |
| | | PasswordValidatorCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | (PasswordValidator<? extends PasswordValidatorCfg>) |
| | | validatorClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = |
| | | validator.getClass().getMethod("initializePasswordValidator", |
| | | configuration.definition().getServerConfigurationClass()); |
| | | method.invoke(validator, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = |
| | | validator.getClass().getMethod("isConfigurationAcceptable", |
| | | PasswordValidatorCfg.class, |
| | | List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(validator, configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_PWVALIDATOR_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return validator; |
| | | } |
| | |
| | | { |
| | | DirectoryServerPlugin<? extends PluginCfg> plugin = |
| | | loadPlugin(pluginConfiguration.getPluginClass(), initTypes, |
| | | pluginConfiguration); |
| | | pluginConfiguration, true); |
| | | registerPlugin(plugin, pluginConfiguration.dn(), initTypes); |
| | | } |
| | | catch (InitializationException ie) |
| | |
| | | * which the server is running in a special mode that |
| | | * only uses a minimal set of plugins (e.g., LDIF |
| | | * import or export). |
| | | * @param configuration The configuration to use to initialize the plugin, |
| | | * or {@code null} if the plugin should not be |
| | | * @param configuration The configuration to use to initialize the plugin. |
| | | * It must not be {@code null}. |
| | | * @param initialize Indicates whether the plugin instance should be |
| | | * initialized. |
| | | * |
| | | * @return The possibly initialized plugin. |
| | |
| | | */ |
| | | private DirectoryServerPlugin<? extends PluginCfg> |
| | | loadPlugin(String className, Set<PluginType> pluginTypes, |
| | | PluginCfg configuration) |
| | | PluginCfg configuration, boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | (DirectoryServerPlugin<? extends PluginCfg>) |
| | | pluginClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = plugin.getClass().getMethod("initializeInternal", |
| | | DN.class, Set.class); |
| | |
| | | configuration.definition().getServerConfigurationClass()); |
| | | method.invoke(plugin, pluginTypes, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = plugin.getClass().getMethod("isConfigurationAcceptable", |
| | | PluginCfg.class, |
| | | List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(plugin, configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_PLUGIN_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return plugin; |
| | | } |
| | |
| | | String className = configuration.getPluginClass(); |
| | | try |
| | | { |
| | | loadPlugin(className, pluginTypes, null); |
| | | loadPlugin(className, pluginTypes, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getPluginClass(); |
| | | try |
| | | { |
| | | plugin = loadPlugin(className, pluginTypes, configuration); |
| | | plugin = loadPlugin(className, pluginTypes, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getPluginClass(); |
| | | try |
| | | { |
| | | loadPlugin(className, pluginTypes, null); |
| | | loadPlugin(className, pluginTypes, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | DirectoryServerPlugin<? extends PluginCfg> plugin = null; |
| | | try |
| | | { |
| | | plugin = loadPlugin(className, pluginTypes, configuration); |
| | | plugin = loadPlugin(className, pluginTypes, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | |
| | | try |
| | | { |
| | | SASLMechanismHandler handler = loadHandler(className, |
| | | handlerConfiguration); |
| | | handlerConfiguration, |
| | | true); |
| | | handlers.put(handlerConfiguration.dn(), handler); |
| | | } |
| | | catch (InitializationException ie) |
| | |
| | | String className = configuration.getHandlerClass(); |
| | | try |
| | | { |
| | | loadHandler(className, null); |
| | | loadHandler(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getHandlerClass(); |
| | | try |
| | | { |
| | | handler = loadHandler(className, configuration); |
| | | handler = loadHandler(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getHandlerClass(); |
| | | try |
| | | { |
| | | loadHandler(className, null); |
| | | loadHandler(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | SASLMechanismHandler handler = null; |
| | | try |
| | | { |
| | | handler = loadHandler(className, configuration); |
| | | handler = loadHandler(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | * |
| | | * @param className The fully-qualified name of the SASL mechanism |
| | | * handler class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the handler, |
| | | * or {@code null} if the SASL mechanism handler should |
| | | * not be initialized. |
| | | * @param configuration The configuration to use to initialize the handler. |
| | | * It must not be {@code null}. |
| | | * @param initialize Indicates whether the SASL mechanism handler |
| | | * instance should be initialized. |
| | | * |
| | | * @return The possibly initialized SASL mechanism handler. |
| | | * |
| | |
| | | */ |
| | | private SASLMechanismHandler loadHandler(String className, |
| | | SASLMechanismHandlerCfg |
| | | configuration) |
| | | configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | propertyDefinition.loadClass(className, SASLMechanismHandler.class); |
| | | SASLMechanismHandler handler = handlerClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = |
| | | handler.getClass().getMethod("initializeSASLMechanismHandler", |
| | | configuration.definition().getServerConfigurationClass()); |
| | | method.invoke(handler, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = |
| | | handler.getClass().getMethod("isConfigurationAcceptable", |
| | | SASLMechanismHandlerCfg.class, |
| | | List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(handler, configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_SASL_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return handler; |
| | | } |
| | |
| | | import static org.opends.server.messages.MessageHandler.getMessage; |
| | | import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | |
| | | d.getJavaImplementationClassPropertyDefinition(); |
| | | |
| | | // Load the class and cast it to a synchronizationProvider. |
| | | SynchronizationProvider provider = null; |
| | | Class<? extends SynchronizationProvider> theClass; |
| | | try |
| | | { |
| | | theClass = pd.loadClass(className, SynchronizationProvider.class); |
| | | theClass.newInstance(); |
| | | provider = theClass.newInstance(); |
| | | } catch (Exception e) |
| | | { |
| | | // Handle the exception: put a message in the unacceptable reasons. |
| | |
| | | // Determine the initialization method to use: it must take a |
| | | // single parameter which is the exact type of the configuration |
| | | // object. |
| | | theClass.getMethod("initializeSynchronizationProvider", |
| | | configuration.definition().getServerConfigurationClass()); |
| | | Method method = theClass.getMethod("isConfigurationAcceptable", |
| | | SynchronizationProviderCfg.class, |
| | | List.class); |
| | | Boolean acceptable = (Boolean) method.invoke(provider, configuration, |
| | | unacceptableReasons); |
| | | |
| | | if (! acceptable) |
| | | { |
| | | return false; |
| | | } |
| | | } catch (Exception e) |
| | | { |
| | | // Handle the exception: put a message in the unacceptable reasons. |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | |
| | | try |
| | | { |
| | | TrustManagerProvider provider = |
| | | loadProvider(className, providerConfig); |
| | | loadProvider(className, providerConfig, true); |
| | | providers.put(providerConfig.dn(), provider); |
| | | DirectoryServer.registerTrustManagerProvider(providerConfig.dn(), |
| | | provider); |
| | |
| | | String className = configuration.getJavaImplementationClass(); |
| | | try |
| | | { |
| | | loadProvider(className, null); |
| | | loadProvider(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getJavaImplementationClass(); |
| | | try |
| | | { |
| | | provider = loadProvider(className, configuration); |
| | | provider = loadProvider(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getJavaImplementationClass(); |
| | | try |
| | | { |
| | | loadProvider(className, null); |
| | | loadProvider(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | TrustManagerProvider provider = null; |
| | | try |
| | | { |
| | | provider = loadProvider(className, configuration); |
| | | provider = loadProvider(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | * @param className The fully-qualified name of the trust manager |
| | | * provider class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the trust |
| | | * manager provider, or {@code null} if the provider |
| | | * should not be initialized. |
| | | * manager provider. It must not be {@code null}. |
| | | * @param initialize Indicates whether the trust manager provider |
| | | * instance should be initialized. |
| | | * |
| | | * @return The possibly initialized trust manager provider. |
| | | * |
| | |
| | | * initialize the trust manager provider. |
| | | */ |
| | | private TrustManagerProvider loadProvider(String className, |
| | | TrustManagerCfg configuration) |
| | | TrustManagerCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | propertyDefinition.loadClass(className, TrustManagerProvider.class); |
| | | TrustManagerProvider provider = providerClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = |
| | | provider.getClass().getMethod("initializeTrustManagerProvider", |
| | | configuration.definition().getServerConfigurationClass()); |
| | | method.invoke(provider, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = |
| | | provider.getClass().getMethod("isConfigurationAcceptable", |
| | | TrustManagerCfg.class, List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(provider, configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_TRUSTMANAGER_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return provider; |
| | | } |
| | |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.LinkedHashSet; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | |
| | | try |
| | | { |
| | | VirtualAttributeProvider<? extends VirtualAttributeCfg> provider = |
| | | loadProvider(className, cfg); |
| | | loadProvider(className, cfg, true); |
| | | |
| | | LinkedHashSet<SearchFilter> filters = |
| | | new LinkedHashSet<SearchFilter>(); |
| | |
| | | String className = configuration.getProviderClass(); |
| | | try |
| | | { |
| | | loadProvider(className, null); |
| | | loadProvider(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getProviderClass(); |
| | | try |
| | | { |
| | | provider = loadProvider(className, configuration); |
| | | provider = loadProvider(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getProviderClass(); |
| | | try |
| | | { |
| | | loadProvider(className, null); |
| | | loadProvider(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | String className = configuration.getProviderClass(); |
| | | try |
| | | { |
| | | provider = loadProvider(className, configuration); |
| | | provider = loadProvider(className, configuration, true); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | * @param className The fully-qualified name of the certificate mapper |
| | | * class to load, instantiate, and initialize. |
| | | * @param configuration The configuration to use to initialize the |
| | | * certificate mapper, or {@code null} if the |
| | | * certificate mapper should not be initialized. |
| | | * virtual attribute provider. It must not be |
| | | * {@code null}. |
| | | * @param initialize Indicates whether the virtual attribute provider |
| | | * instance should be initialized. |
| | | * |
| | | * @return The possibly initialized certificate mapper. |
| | | * |
| | |
| | | * initialize the certificate mapper. |
| | | */ |
| | | private VirtualAttributeProvider<? extends VirtualAttributeCfg> |
| | | loadProvider(String className, VirtualAttributeCfg configuration) |
| | | loadProvider(String className, VirtualAttributeCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | |
| | | (VirtualAttributeProvider<? extends VirtualAttributeCfg>) |
| | | providerClass.newInstance(); |
| | | |
| | | if (configuration != null) |
| | | if (initialize) |
| | | { |
| | | Method method = |
| | | provider.getClass().getMethod("initializeVirtualAttributeProvider", |
| | | configuration.definition().getServerConfigurationClass()); |
| | | method.invoke(provider, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = |
| | | provider.getClass().getMethod("isConfigurationAcceptable", |
| | | VirtualAttributeCfg.class, |
| | | List.class); |
| | | |
| | | List<String> unacceptableReasons = new ArrayList<String>(); |
| | | Boolean acceptable = (Boolean) method.invoke(provider, configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | | if (! unacceptableReasons.isEmpty()) |
| | | { |
| | | Iterator<String> iterator = unacceptableReasons.iterator(); |
| | | buffer.append(iterator.next()); |
| | | while (iterator.hasNext()) |
| | | { |
| | | buffer.append(". "); |
| | | buffer.append(iterator.next()); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_VATTR_CONFIG_NOT_ACCEPTABLE; |
| | | String message = getMessage(msgID, String.valueOf(configuration.dn()), |
| | | buffer.toString()); |
| | | throw new InitializationException(msgID, message); |
| | | } |
| | | } |
| | | |
| | | return provider; |
| | | } |
| | |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.AttributeValuePasswordValidatorCfg; |
| | | import org.opends.server.admin.std.server.PasswordValidatorCfg; |
| | | import org.opends.server.api.PasswordValidator; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(PasswordValidatorCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | AttributeValuePasswordValidatorCfg config = |
| | | (AttributeValuePasswordValidatorCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | AttributeValuePasswordValidatorCfg configuration, |
| | | List<String> unacceptableReasons) |
| | |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.CramMD5SASLMechanismHandlerCfg; |
| | | import org.opends.server.admin.std.server.SASLMechanismHandlerCfg; |
| | | import org.opends.server.api.ClientConnection; |
| | | import org.opends.server.api.IdentityMapper; |
| | | import org.opends.server.api.SASLMechanismHandler; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable( |
| | | SASLMechanismHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | CramMD5SASLMechanismHandlerCfg config = |
| | | (CramMD5SASLMechanismHandlerCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | CramMD5SASLMechanismHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Get the identity mapper that should be used to find users. |
| | | DN identityMapperDN = configuration.getIdentityMapperDN(); |
| | |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.CharacterSetPasswordValidatorCfg; |
| | | import org.opends.server.admin.std.server.PasswordValidatorCfg; |
| | | import org.opends.server.api.PasswordValidator; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(PasswordValidatorCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | CharacterSetPasswordValidatorCfg config = |
| | | (CharacterSetPasswordValidatorCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | CharacterSetPasswordValidatorCfg configuration, |
| | | List<String> unacceptableReasons) |
| | |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.DictionaryPasswordValidatorCfg; |
| | | import org.opends.server.admin.std.server.PasswordValidatorCfg; |
| | | import org.opends.server.api.PasswordValidator; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(PasswordValidatorCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | DictionaryPasswordValidatorCfg config = |
| | | (DictionaryPasswordValidatorCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | DictionaryPasswordValidatorCfg configuration, |
| | | List<String> unacceptableReasons) |
| | |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.DigestMD5SASLMechanismHandlerCfg; |
| | | import org.opends.server.admin.std.server.SASLMechanismHandlerCfg; |
| | | import org.opends.server.api.Backend; |
| | | import org.opends.server.api.ClientConnection; |
| | | import org.opends.server.api.IdentityMapper; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable( |
| | | SASLMechanismHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | DigestMD5SASLMechanismHandlerCfg config = |
| | | (DigestMD5SASLMechanismHandlerCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | DigestMD5SASLMechanismHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Get the identity mapper that should be used to find users. |
| | | DN identityMapperDN = configuration.getIdentityMapperDN(); |
| | |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.loggers.ErrorLogger.logError; |
| | | import static org.opends.server.messages.ExtensionsMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.getMessage; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.meta. |
| | | ErrorLogAccountStatusNotificationHandlerCfgDefn; |
| | | import org.opends.server.admin.std.server.AccountStatusNotificationHandlerCfg; |
| | | import org.opends.server.admin.std.server. |
| | | ErrorLogAccountStatusNotificationHandlerCfg; |
| | | import org.opends.server.api.AccountStatusNotificationHandler; |
| | | import org.opends.server.config.ConfigAttribute; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.config.MultiChoiceConfigAttribute; |
| | | import org.opends.server.types.AccountStatusNotificationType; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DN; |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the DN of the configuration entry with which this component is |
| | | * associated. |
| | | * |
| | | * @return The DN of the configuration entry with which this component is |
| | | * associated. |
| | | * {@inheritDoc} |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | @Override() |
| | | public boolean isConfigurationAcceptable( |
| | | AccountStatusNotificationHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | return configEntryDN; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the set of configuration attributes that are associated with this |
| | | * configurable component. |
| | | * |
| | | * @return The set of configuration attributes that are associated with this |
| | | * configurable component. |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | LinkedList<String> typeNames = new LinkedList<String>(); |
| | | for (AccountStatusNotificationType t : notificationTypes) |
| | | { |
| | | typeNames.add(t.getNotificationTypeName()); |
| | | } |
| | | |
| | | int msgID = MSGID_ERRORLOG_ACCTNOTHANDLER_DESCRIPTION_NOTIFICATION_TYPES; |
| | | attrList.add(new MultiChoiceConfigAttribute(ATTR_ACCT_NOTIFICATION_TYPE, |
| | | getMessage(msgID), true, true, |
| | | false, NOTIFICATION_TYPE_NAMES, |
| | | typeNames)); |
| | | |
| | | return attrList; |
| | | ErrorLogAccountStatusNotificationHandlerCfg config = |
| | | (ErrorLogAccountStatusNotificationHandlerCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.ExactMatchIdentityMapperCfg; |
| | | import org.opends.server.admin.std.server.IdentityMapperCfg; |
| | | import org.opends.server.api.IdentityMapper; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(IdentityMapperCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | ExactMatchIdentityMapperCfg config = |
| | | (ExactMatchIdentityMapperCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ExactMatchIdentityMapperCfg configuration, |
| | | List<String> unacceptableReasons) |
| | |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.ExternalSASLMechanismHandlerCfg; |
| | | import org.opends.server.admin.std.server.SASLMechanismHandlerCfg; |
| | | import org.opends.server.api.CertificateMapper; |
| | | import org.opends.server.api.ClientConnection; |
| | | import org.opends.server.api.ConnectionSecurityProvider; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable( |
| | | SASLMechanismHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | ExternalSASLMechanismHandlerCfg config = |
| | | (ExternalSASLMechanismHandlerCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ExternalSASLMechanismHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Get the attribute type to use for validating the certificates. If none |
| | | // is provided, then default to the userCertificate type. |
| | |
| | | import java.util.concurrent.locks.Lock; |
| | | import java.util.concurrent.locks.ReentrantLock; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.EntryCacheCfg; |
| | | import org.opends.server.admin.std.server.FIFOEntryCacheCfg; |
| | | import org.opends.server.api.Backend; |
| | | import org.opends.server.api.EntryCache; |
| | | import org.opends.server.admin.std.server.FIFOEntryCacheCfg; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.config.ConfigAttribute; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.config.IntegerConfigAttribute; |
| | | import org.opends.server.config.IntegerWithUnitConfigAttribute; |
| | | import org.opends.server.config.StringConfigAttribute; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.CacheEntry; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.InitializationException; |
| | |
| | | |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.messages.ExtensionsMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(EntryCacheCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | FIFOEntryCacheCfg config = (FIFOEntryCacheCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FIFOEntryCacheCfg configuration, |
| | | List<String> unacceptableReasons |
| | |
| | | HashSet<SearchFilter> newIncludeFilters = null; |
| | | HashSet<SearchFilter> newExcludeFilters = null; |
| | | |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Read configuration. |
| | | newConfigEntryDN = configuration.dn(); |
| | | newLockTimeout = configuration.getLockTimeout(); |
| | |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.FileBasedKeyManagerCfg; |
| | | import org.opends.server.admin.std.server.KeyManagerCfg; |
| | | import org.opends.server.api.KeyManagerProvider; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(KeyManagerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | FileBasedKeyManagerCfg config = (FileBasedKeyManagerCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FileBasedKeyManagerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | |
| | | // Get the path to the key store file. |
| | |
| | | import javax.net.ssl.X509TrustManager; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.TrustManagerCfg; |
| | | import org.opends.server.admin.std.server.FileBasedTrustManagerCfg; |
| | | import org.opends.server.api.TrustManagerProvider; |
| | | import org.opends.server.config.ConfigException; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(TrustManagerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | FileBasedTrustManagerCfg config = (FileBasedTrustManagerCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | |
| | | // Get the path to the trust store file. |
| | | String newTrustStoreFile = configuration.getTrustStoreFile(); |
| | | try |
| | | { |
| | | File f = getFileForPath(newTrustStoreFile); |
| | | if (!(f.exists() && f.isFile())) |
| | | { |
| | | int msgID = MSGID_FILE_TRUSTMANAGER_NO_SUCH_FILE; |
| | | unacceptableReasons.add(getMessage(msgID, |
| | | String.valueOf(newTrustStoreFile), |
| | | String.valueOf(configEntryDN))); |
| | | configAcceptable = false; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_FILE_TRUSTMANAGER_CANNOT_DETERMINE_FILE; |
| | | unacceptableReasons.add(getMessage(msgID, String.valueOf(configEntryDN), |
| | | getExceptionMessage(e))); |
| | | configAcceptable = false; |
| | | } |
| | | |
| | | |
| | | // Check to see if the trust store type is acceptable. |
| | | String storeType = configuration.getTrustStoreType(); |
| | |
| | | import com.sleepycat.je.StatsConfig; |
| | | import org.opends.server.api.Backend; |
| | | import org.opends.server.api.EntryCache; |
| | | import org.opends.server.admin.std.server.EntryCacheCfg; |
| | | import org.opends.server.admin.std.server.FileSystemEntryCacheCfg; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.config.ConfigException; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(EntryCacheCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | FileSystemEntryCacheCfg config = (FileSystemEntryCacheCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FileSystemEntryCacheCfg configuration, |
| | | List<String> unacceptableReasons |
| | |
| | | String newCacheType = DEFAULT_FSCACHE_TYPE; |
| | | String newCacheHome = DEFAULT_FSCACHE_HOME; |
| | | |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Read configuration. |
| | | newConfigEntryDN = configuration.dn(); |
| | | newLockTimeout = configuration.getLockTimeout(); |
| | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.CertificateMapperCfg; |
| | | import org.opends.server.admin.std.server.FingerprintCertificateMapperCfg; |
| | | import org.opends.server.api.CertificateMapper; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import org.opends.server.protocols.internal.InternalSearchOperation; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.InitializationException; |
| | |
| | | import org.opends.server.types.SearchScope; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.messages.ExtensionsMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(CertificateMapperCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | FingerprintCertificateMapperCfg config = |
| | | (FingerprintCertificateMapperCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FingerprintCertificateMapperCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Make sure that the fingerprint attribute is defined in the server schema. |
| | | String attrName = configuration.getFingerprintAttribute(); |
| | |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.GSSAPISASLMechanismHandlerCfg; |
| | | import org.opends.server.admin.std.server.SASLMechanismHandlerCfg; |
| | | import org.opends.server.api.ClientConnection; |
| | | import org.opends.server.api.IdentityMapper; |
| | | import org.opends.server.api.SASLMechanismHandler; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable( |
| | | SASLMechanismHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | GSSAPISASLMechanismHandlerCfg config = |
| | | (GSSAPISASLMechanismHandlerCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | GSSAPISASLMechanismHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Get the identity mapper that should be used to find users. |
| | | DN identityMapperDN = configuration.getIdentityMapperDN(); |
| | |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.LengthBasedPasswordValidatorCfg; |
| | | import org.opends.server.admin.std.server.PasswordValidatorCfg; |
| | | import org.opends.server.api.PasswordValidator; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.ByteString; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(PasswordValidatorCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | LengthBasedPasswordValidatorCfg config = |
| | | (LengthBasedPasswordValidatorCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | LengthBasedPasswordValidatorCfg configuration, |
| | | List<String> unacceptableReasons) |
| | |
| | | import javax.net.ssl.KeyManagerFactory; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.KeyManagerCfg; |
| | | import org.opends.server.admin.std.server.PKCS11KeyManagerCfg; |
| | | import org.opends.server.api.KeyManagerProvider; |
| | | import org.opends.server.config.ConfigException; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(KeyManagerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | PKCS11KeyManagerCfg config = (PKCS11KeyManagerCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | PKCS11KeyManagerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | |
| | | // Get the PIN needed to access the contents of the keystore file. |
| | |
| | | import java.util.HashSet; |
| | | import java.util.concurrent.locks.Lock; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.ExtendedOperationHandlerCfg; |
| | | import org.opends.server.admin.std.server. |
| | | PasswordModifyExtendedOperationHandlerCfg; |
| | | import org.opends.server.api.ClientConnection; |
| | | import org.opends.server.api.ExtendedOperationHandler; |
| | | import org.opends.server.api.IdentityMapper; |
| | |
| | | import org.opends.server.core.ExtendedOperation; |
| | | import org.opends.server.core.ModifyOperation; |
| | | import org.opends.server.core.PasswordPolicyState; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.protocols.asn1.ASN1Element; |
| | | import org.opends.server.protocols.asn1.ASN1Exception; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.Control; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | |
| | | import static org.opends.server.extensions.ExtensionsConstants.*; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.messages.ExtensionsMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | import org.opends.server.admin.std.server. |
| | | PasswordModifyExtendedOperationHandlerCfg; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | |
| | | |
| | | // The current configuration state. |
| | | private PasswordModifyExtendedOperationHandlerCfg currentConfig; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(ExtendedOperationHandlerCfg |
| | | configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | PasswordModifyExtendedOperationHandlerCfg config = |
| | | (PasswordModifyExtendedOperationHandlerCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration entry has an acceptable |
| | | * configuration for this component. If it does not, then detailed |
| | | * information about the problem(s) should be added to the provided list. |
| | |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.PlainSASLMechanismHandlerCfg; |
| | | import org.opends.server.admin.std.server.SASLMechanismHandlerCfg; |
| | | import org.opends.server.api.IdentityMapper; |
| | | import org.opends.server.api.SASLMechanismHandler; |
| | | import org.opends.server.config.ConfigException; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable( |
| | | SASLMechanismHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | PlainSASLMechanismHandlerCfg config = |
| | | (PlainSASLMechanismHandlerCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | PlainSASLMechanismHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Get the identity mapper that should be used to find users. |
| | | DN identityMapperDN = configuration.getIdentityMapperDN(); |
| | |
| | | import java.util.concurrent.locks.ReentrantLock; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.PasswordGeneratorCfg; |
| | | import org.opends.server.admin.std.server.RandomPasswordGeneratorCfg; |
| | | import org.opends.server.api.PasswordGenerator; |
| | | import org.opends.server.config.ConfigAttribute; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(PasswordGeneratorCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | RandomPasswordGeneratorCfg config = |
| | | (RandomPasswordGeneratorCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | RandomPasswordGeneratorCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | int msgID; |
| | | |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Get the character sets for use in generating the password. At |
| | | // least one |
| | | // must have been provided. |
| | |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.locks.Lock; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.EntryCacheCfg; |
| | | import org.opends.server.admin.std.server.SoftReferenceEntryCacheCfg; |
| | | import org.opends.server.api.Backend; |
| | | import org.opends.server.api.EntryCache; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.SoftReferenceEntryCacheCfg; |
| | | import org.opends.server.config.ConfigAttribute; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.config.IntegerWithUnitConfigAttribute; |
| | | import org.opends.server.config.StringConfigAttribute; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.CacheEntry; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.InitializationException; |
| | |
| | | |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.messages.ExtensionsMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(EntryCacheCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | SoftReferenceEntryCacheCfg config = |
| | | (SoftReferenceEntryCacheCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SoftReferenceEntryCacheCfg configuration, |
| | | List<String> unacceptableReasons) |
| | |
| | | HashSet<SearchFilter> newIncludeFilters = null; |
| | | HashSet<SearchFilter> newExcludeFilters = null; |
| | | |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Read configuration. |
| | | newConfigEntryDN = configuration.dn(); |
| | | newLockTimeout = configuration.getLockTimeout(); |
| | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.CertificateMapperCfg; |
| | | import org.opends.server.admin.std.server. |
| | | SubjectAttributeToUserAttributeCertificateMapperCfg; |
| | | import org.opends.server.api.CertificateMapper; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import org.opends.server.protocols.internal.InternalSearchOperation; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.InitializationException; |
| | |
| | | import org.opends.server.types.SearchScope; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.messages.ExtensionsMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | private LinkedHashMap<String,AttributeType> attributeMap; |
| | | |
| | | // The current configuration for this certificate mapper. |
| | | private SubjectAttributeToUserAttributeCertificateMapperCfg |
| | | currentConfig; |
| | | private SubjectAttributeToUserAttributeCertificateMapperCfg currentConfig; |
| | | |
| | | |
| | | |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(CertificateMapperCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | SubjectAttributeToUserAttributeCertificateMapperCfg config = |
| | | (SubjectAttributeToUserAttributeCertificateMapperCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SubjectAttributeToUserAttributeCertificateMapperCfg |
| | | configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Get and validate the subject attribute to user attribute mappings. |
| | | LinkedHashMap<String,AttributeType> newAttributeMap = |
| | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.CertificateMapperCfg; |
| | | import org.opends.server.admin.std.server. |
| | | SubjectDNToUserAttributeCertificateMapperCfg; |
| | | import org.opends.server.api.CertificateMapper; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import org.opends.server.protocols.internal.InternalSearchOperation; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.InitializationException; |
| | |
| | | import org.opends.server.types.SearchScope; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.messages.ExtensionsMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(CertificateMapperCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | SubjectDNToUserAttributeCertificateMapperCfg config = |
| | | (SubjectDNToUserAttributeCertificateMapperCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SubjectDNToUserAttributeCertificateMapperCfg |
| | | configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Make sure that the subject attribute is defined in the server schema. |
| | | String attrName = configuration.getSubjectAttribute(); |
| | |
| | | ClassPropertyDefinition pd = |
| | | d.getJavaImplementationClassPropertyDefinition(); |
| | | // Load the class and cast it to a DebugLogPublisher. |
| | | AccessLogPublisher publisher = null; |
| | | Class<? extends AccessLogPublisher> theClass; |
| | | try { |
| | | theClass = pd.loadClass(className, AccessLogPublisher.class); |
| | | theClass.newInstance(); |
| | | publisher = theClass.newInstance(); |
| | | } catch (Exception e) { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_ACCESS_LOGGER_CLASS; |
| | | String message = getMessage(msgID, className, |
| | |
| | | // Determine the initialization method to use: it must take a |
| | | // single parameter which is the exact type of the configuration |
| | | // object. |
| | | theClass.getMethod("initializeAccessLogPublisher", config.definition() |
| | | .getServerConfigurationClass()); |
| | | Method method = theClass.getMethod("isConfigurationAcceptable", |
| | | AccessLogPublisherCfg.class, |
| | | List.class); |
| | | Boolean acceptable = (Boolean) method.invoke(publisher, config, |
| | | unacceptableReasons); |
| | | |
| | | if (! acceptable) |
| | | { |
| | | return false; |
| | | } |
| | | } catch (Exception e) { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_ACCESS_LOGGER_CLASS; |
| | | String message = getMessage(msgID, className, |
| | |
| | | ClassPropertyDefinition pd = |
| | | d.getJavaImplementationClassPropertyDefinition(); |
| | | // Load the class and cast it to a DebugLogPublisher. |
| | | ErrorLogPublisher publisher = null; |
| | | Class<? extends ErrorLogPublisher> theClass; |
| | | try { |
| | | theClass = pd.loadClass(className, ErrorLogPublisher.class); |
| | | theClass.newInstance(); |
| | | publisher = theClass.newInstance(); |
| | | } catch (Exception e) { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_ERROR_LOGGER_CLASS; |
| | | String message = getMessage(msgID, className, |
| | |
| | | // Determine the initialization method to use: it must take a |
| | | // single parameter which is the exact type of the configuration |
| | | // object. |
| | | theClass.getMethod("initializeErrorLogPublisher", config.definition() |
| | | .getServerConfigurationClass()); |
| | | Method method = theClass.getMethod("isConfigurationAcceptable", |
| | | ErrorLogPublisherCfg.class, |
| | | List.class); |
| | | Boolean acceptable = (Boolean) method.invoke(publisher, config, |
| | | unacceptableReasons); |
| | | |
| | | if (! acceptable) |
| | | { |
| | | return false; |
| | | } |
| | | } catch (Exception e) { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_ERROR_LOGGER_CLASS; |
| | | String message = getMessage(msgID, className, |
| | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.AccessLogPublisherCfg; |
| | | import org.opends.server.admin.std.server.FileBasedAccessLogPublisherCfg; |
| | | import org.opends.server.api.*; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.AbandonOperation; |
| | |
| | | import org.opends.server.core.SearchOperation; |
| | | import org.opends.server.core.UnbindOperation; |
| | | import org.opends.server.types.*; |
| | | import org.opends.server.util.TimeThread; |
| | | |
| | | import static org.opends.server.messages.ConfigMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.getMessage; |
| | | import org.opends.server.admin.std.server.FileBasedAccessLogPublisherCfg; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import static org.opends.server.util.StaticUtils.getFileForPath; |
| | | import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString; |
| | | import org.opends.server.util.TimeThread; |
| | | |
| | | |
| | | /** |
| | |
| | | config.addFileBasedAccessChangeListener(this); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(AccessLogPublisherCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | FileBasedAccessLogPublisherCfg config = |
| | | (FileBasedAccessLogPublisherCfg) configuration; |
| | | |
| | | // Validate retention and rotation policies. |
| | | for(DN dn : config.getRotationPolicyDN()) |
| | | { |
| | | RotationPolicy policy = DirectoryServer.getRotationPolicy(dn); |
| | | if(policy == null) |
| | | { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_ROTATION_POLICY; |
| | | String message = getMessage(msgID, dn.toString(), |
| | | config.dn().toString()); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | | } |
| | | for(DN dn: config.getRetentionPolicyDN()) |
| | | { |
| | | RetentionPolicy policy = DirectoryServer.getRetentionPolicy(dn); |
| | | if(policy == null) |
| | | { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_RETENTION_POLICY; |
| | | String message = getMessage(msgID, dn.toString(), |
| | | config.dn().toString()); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | |
| | | return false; |
| | | } |
| | | |
| | | // Validate retention and rotation policies. |
| | | for(DN dn : config.getRotationPolicyDN()) |
| | | { |
| | | RotationPolicy policy = DirectoryServer.getRotationPolicy(dn); |
| | | if(policy == null) |
| | | { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_ROTATION_POLICY; |
| | | String message = getMessage(msgID, dn.toString(), |
| | | config.dn().toString()); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | | } |
| | | for(DN dn: config.getRetentionPolicyDN()) |
| | | { |
| | | RetentionPolicy policy = DirectoryServer.getRetentionPolicy(dn); |
| | | if(policy == null) |
| | | { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_RETENTION_POLICY; |
| | | String message = getMessage(msgID, dn.toString(), |
| | | config.dn().toString()); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | return isConfigurationAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | |
| | | import static org.opends.server.messages.ConfigMessages.*; |
| | | import static org.opends.server.messages.LoggerMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.getMessage; |
| | | import org.opends.server.admin.std.server.ErrorLogPublisherCfg; |
| | | import org.opends.server.admin.std.server.FileBasedErrorLogPublisherCfg; |
| | | import org.opends.server.admin.std.meta.ErrorLogPublisherCfgDefn; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | |
| | | config.addFileBasedErrorChangeListener(this); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FileBasedErrorLogPublisherCfg config, List<String> unacceptableReasons) |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(ErrorLogPublisherCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | // Make sure the permission is valid. |
| | | try |
| | | { |
| | | if(!currentConfig.getLogFileMode().equalsIgnoreCase( |
| | | config.getLogFileMode())) |
| | | { |
| | | FilePermission.decodeUNIXMode(config.getLogFileMode()); |
| | | } |
| | | if(!currentConfig.getLogFile().equalsIgnoreCase(config.getLogFile())) |
| | | { |
| | | File logFile = getFileForPath(config.getLogFile()); |
| | | if(logFile.createNewFile()) |
| | | { |
| | | logFile.delete(); |
| | | } |
| | | } |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | int msgID = MSGID_CONFIG_LOGGING_CANNOT_CREATE_WRITER; |
| | | String message = getMessage(msgID, config.dn().toString(), |
| | | stackTraceToSingleLineString(e)); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | | FileBasedErrorLogPublisherCfg config = |
| | | (FileBasedErrorLogPublisherCfg) configuration; |
| | | |
| | | // Validate retention and rotation policies. |
| | | for(DN dn : config.getRotationPolicyDN()) |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FileBasedErrorLogPublisherCfg config, List<String> unacceptableReasons) |
| | | { |
| | | // Make sure the permission is valid. |
| | | try |
| | | { |
| | | if(!currentConfig.getLogFileMode().equalsIgnoreCase( |
| | | config.getLogFileMode())) |
| | | { |
| | | FilePermission.decodeUNIXMode(config.getLogFileMode()); |
| | | } |
| | | if(!currentConfig.getLogFile().equalsIgnoreCase(config.getLogFile())) |
| | | { |
| | | File logFile = getFileForPath(config.getLogFile()); |
| | | if(logFile.createNewFile()) |
| | | { |
| | | logFile.delete(); |
| | | } |
| | | } |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | int msgID = MSGID_CONFIG_LOGGING_CANNOT_CREATE_WRITER; |
| | | String message = getMessage(msgID, config.dn().toString(), |
| | | stackTraceToSingleLineString(e)); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | | |
| | | return isConfigurationAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | FileBasedErrorLogPublisherCfg config) |
| | | { |
| | |
| | | ClassPropertyDefinition pd = |
| | | d.getJavaImplementationClassPropertyDefinition(); |
| | | // Load the class and cast it to a DebugLogPublisher. |
| | | DebugLogPublisher publisher = null; |
| | | Class<? extends DebugLogPublisher> theClass; |
| | | try { |
| | | theClass = pd.loadClass(className, DebugLogPublisher.class); |
| | | theClass.newInstance(); |
| | | publisher = theClass.newInstance(); |
| | | } catch (Exception e) { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_DEBUG_LOGGER_CLASS; |
| | | String message = getMessage(msgID, className, |
| | |
| | | // Determine the initialization method to use: it must take a |
| | | // single parameter which is the exact type of the configuration |
| | | // object. |
| | | theClass.getMethod("initializeDebugLogPublisher", config.definition() |
| | | .getServerConfigurationClass()); |
| | | Method method = theClass.getMethod("isConfigurationAcceptable", |
| | | DebugLogPublisherCfg.class, |
| | | List.class); |
| | | Boolean acceptable = (Boolean) method.invoke(publisher, config, |
| | | unacceptableReasons); |
| | | |
| | | if (! acceptable) |
| | | { |
| | | return false; |
| | | } |
| | | } catch (Exception e) { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_DEBUG_LOGGER_CLASS; |
| | | String message = getMessage(msgID, className, |
| | |
| | | import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString; |
| | | import static org.opends.server.util.StaticUtils.getFileForPath; |
| | | import static org.opends.server.util.ServerConstants.PROPERTY_DEBUG_TARGET; |
| | | import org.opends.server.admin.std.server.DebugLogPublisherCfg; |
| | | import org.opends.server.admin.std.server.DebugTargetCfg; |
| | | import org.opends.server.admin.std.server.FileBasedDebugLogPublisherCfg; |
| | | import org.opends.server.admin.std.meta.DebugLogPublisherCfgDefn; |
| | |
| | | config.addFileBasedDebugChangeListener(this); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(DebugLogPublisherCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | FileBasedDebugLogPublisherCfg config = |
| | | (FileBasedDebugLogPublisherCfg) configuration; |
| | | |
| | | // Validate retention and rotation policies. |
| | | for(DN dn : config.getRotationPolicyDN()) |
| | | { |
| | | RotationPolicy policy = DirectoryServer.getRotationPolicy(dn); |
| | | if(policy == null) |
| | | { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_ROTATION_POLICY; |
| | | String message = getMessage(msgID, dn.toString(), |
| | | config.dn().toString()); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | | } |
| | | for(DN dn: config.getRetentionPolicyDN()) |
| | | { |
| | | RetentionPolicy policy = DirectoryServer.getRetentionPolicy(dn); |
| | | if(policy != null) |
| | | { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_RETENTION_POLICY; |
| | | String message = getMessage(msgID, dn.toString(), |
| | | config.dn().toString()); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | |
| | | return false; |
| | | } |
| | | |
| | | // Validate retention and rotation policies. |
| | | for(DN dn : config.getRotationPolicyDN()) |
| | | { |
| | | RotationPolicy policy = DirectoryServer.getRotationPolicy(dn); |
| | | if(policy == null) |
| | | { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_ROTATION_POLICY; |
| | | String message = getMessage(msgID, dn.toString(), |
| | | config.dn().toString()); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | | } |
| | | for(DN dn: config.getRetentionPolicyDN()) |
| | | { |
| | | RetentionPolicy policy = DirectoryServer.getRetentionPolicy(dn); |
| | | if(policy != null) |
| | | { |
| | | int msgID = MSGID_CONFIG_LOGGER_INVALID_RETENTION_POLICY; |
| | | String message = getMessage(msgID, dn.toString(), |
| | | config.dn().toString()); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | return isConfigurationAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_KEYMANAGER_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 679; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_TRUSTMANAGER_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 680; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_AUTHZ_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 681; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_ACCTNOTHANDLER_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 682; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_SCHEMA_SYNTAX_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 683; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_CERTMAPPER_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 684; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_ENTRYCACHE_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 685; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_GROUP_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 686; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_IDMAPPER_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 687; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_SCHEMA_MR_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 688; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_PWGENERATOR_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 689; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_PWSCHEME_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 690; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_PWVALIDATOR_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 691; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_PLUGIN_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 692; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_SASL_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 693; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a proposed |
| | | * configuration is not acceptable. This takes two arguments, which are the |
| | | * DN of the configuration entry and a message explaining why the |
| | | * configuration is not acceptable. |
| | | */ |
| | | public static final int MSGID_CONFIG_VATTR_CONFIG_NOT_ACCEPTABLE = |
| | | CATEGORY_MASK_CONFIG | SEVERITY_MASK_MILD_ERROR | 694; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Associates a set of generic messages with the message IDs defined in this |
| | |
| | | registerMessage(MSGID_CONFIG_SCHEMA_CANNOT_DISABLE_MR_IN_USE_BY_MRU, |
| | | "Matching rule %s cannot be disabled because it is in " + |
| | | "use by matching rule use %s"); |
| | | registerMessage(MSGID_CONFIG_SCHEMA_MR_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the matching rule defined in " + |
| | | "configuration entry %s was not acceptable: %s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_SCHEMA_CANNOT_GET_SYNTAX_BASE, |
| | |
| | | registerMessage(MSGID_CONFIG_SCHEMA_CANNOT_DISABLE_SYNTAX_IN_USE, |
| | | "Attribute syntax %s cannot be disabled because it is in " + |
| | | "use by attribute type %s"); |
| | | registerMessage(MSGID_CONFIG_SCHEMA_SYNTAX_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the attribute syntax defined in " + |
| | | "configuration entry %s was not acceptable: %s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_SCHEMA_NO_SCHEMA_DIR, |
| | |
| | | "an instance of class %s for use as the Directory Server " + |
| | | "entry cache: %s. As a result, the entry cache will be " + |
| | | "disabled"); |
| | | registerMessage(MSGID_CONFIG_ENTRYCACHE_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the entry cache defined in " + |
| | | "configuration entry %s was not acceptable: %s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_LOGGER_NO_ROTATION_POLICY, |
| | |
| | | "applied. This change will not take effect until the " + |
| | | "plugin is disabled and re-enabled or the Directory " + |
| | | "Server is restarted"); |
| | | registerMessage(MSGID_CONFIG_PLUGIN_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the plugin defined in " + |
| | | "configuration entry %s was not acceptable: %s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_EXTOP_INVALID_CLASS, |
| | |
| | | "according to its internal validation. However, no " + |
| | | "specific information is available regarding the " + |
| | | "problem(s) with the entry"); |
| | | registerMessage(MSGID_CONFIG_SASL_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the SASL mechanism handler " + |
| | | "defined in configuration entry %s was not acceptable: " + |
| | | "%s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_LOGGER_INVALID_SUPPRESS_INT_OPERATION_VALUE, |
| | | "Invalid value specified for attribute %s. " + |
| | | "Allowed values are true or false"); |
| | |
| | | "to its internal validation. However, no specific " + |
| | | "information is available regarding the problem(s) with " + |
| | | "the entry"); |
| | | registerMessage(MSGID_CONFIG_KEYMANAGER_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the key manager provider defined " + |
| | | "in configuration entry %s was not acceptable: %s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_TRUSTMANAGER_CANNOT_GET_BASE, |
| | |
| | | "according to its internal validation. However, no " + |
| | | "specific information is available regarding the " + |
| | | "problem(s) with the entry"); |
| | | registerMessage(MSGID_CONFIG_TRUSTMANAGER_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the trust manager provider " + |
| | | "defined in configuration entry %s was not acceptable: " + |
| | | "%s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_CERTMAPPER_CANNOT_GET_BASE, |
| | |
| | | "its internal validation. However, no specific " + |
| | | "information is available regarding the problem(s) with " + |
| | | "the entry"); |
| | | registerMessage(MSGID_CONFIG_CERTMAPPER_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the certificate mapper defined in " + |
| | | "configuration entry %s was not acceptable: %s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_PWSCHEME_CANNOT_GET_BASE, |
| | |
| | | "according to its internal validation. However, no " + |
| | | "specific information is available regarding the " + |
| | | "problem(s) with the entry"); |
| | | registerMessage(MSGID_CONFIG_PWSCHEME_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the password storage scheme " + |
| | | "defined in configuration entry %s was not acceptable: " + |
| | | "%s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_BACKUP_CANNOT_GET_MAC, |
| | |
| | | "its internal validation. However, no specific " + |
| | | "information is available regarding the problem(s) with " + |
| | | "the entry"); |
| | | registerMessage(MSGID_CONFIG_IDMAPPER_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the identity mapper defined in " + |
| | | "configuration entry %s was not acceptable: %s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_SYNCH_CANNOT_GET_CONFIG_BASE, |
| | |
| | | "its internal validation. However, no specific " + |
| | | "information is available regarding the problem(s) with " + |
| | | "the entry"); |
| | | registerMessage(MSGID_CONFIG_PWVALIDATOR_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the password validator defined in " + |
| | | "configuration entry %s was not acceptable: %s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_PWGENERATOR_CANNOT_GET_BASE, |
| | |
| | | "its internal validation. However, no specific " + |
| | | "information is available regarding the problem(s) with " + |
| | | "the entry"); |
| | | registerMessage(MSGID_CONFIG_PWGENERATOR_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the password generator defined in " + |
| | | "configuration entry %s was not acceptable: %s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_PWPOLICY_CANNOT_GET_BASE, |
| | |
| | | + "Directory Server access control implementation referenced " |
| | | + "in configuration entry %s: %s"); |
| | | |
| | | registerMessage(MSGID_CONFIG_AUTHZ_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the trust manager provider defined in " |
| | | + "configuration entry %s was not acceptable: %s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_ROOTDN_CANNOT_GET_BASE, |
| | | "An error occurred while attempting to retrieve the " + |
| | |
| | | "acceptable according to its internal validation. " + |
| | | "However, no specific information is available regarding " + |
| | | "the problem(s) with the entry"); |
| | | registerMessage(MSGID_CONFIG_ACCTNOTHANDLER_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the account status notification " + |
| | | "handler defined in configuration entry %s was not " + |
| | | "acceptable: %s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_CORE_DESCRIPTION_LOOKTHROUGH_LIMIT, |
| | | "Specifies the default maximum number of candidate " + |
| | | "entries checked for matches when processing a search " + |
| | |
| | | "to its internal validation. However, no specific " + |
| | | "information is available regarding the problem(s) with " + |
| | | "the entry"); |
| | | registerMessage(MSGID_CONFIG_GROUP_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the group implementation defined " + |
| | | "in configuration entry %s was not acceptable: %s"); |
| | | |
| | | |
| | | registerMessage( |
| | |
| | | "An error occurred while trying to load an instance " + |
| | | "of class %s referenced in configuration entry %s as a " + |
| | | "virtual attribute provider: %s"); |
| | | registerMessage(MSGID_CONFIG_VATTR_CONFIG_NOT_ACCEPTABLE, |
| | | "The configuration for the virtual attribute provider " + |
| | | "defined in configuration entry %s was not acceptable: " + |
| | | "%s"); |
| | | |
| | | |
| | | registerMessage(MSGID_CONFIG_ROTATION_POLICY_INVALID_CLASS, |
| | | "Class %s specified in attribute " + ATTR_LOGGER_CLASS + |
| | | " of configuration entry %s cannot be instantiated as " + |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | return isConfigurationChangeAcceptable(configuration, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable(PluginCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | return isConfigurationChangeAcceptable(configuration, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable(PluginCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | return isConfigurationChangeAcceptable(configuration, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable(PluginCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.meta.PluginCfgDefn; |
| | | import org.opends.server.admin.std.server.PasswordPolicyImportPluginCfg; |
| | | import org.opends.server.admin.std.server.PluginCfg; |
| | | import org.opends.server.api.Backend; |
| | | import org.opends.server.api.ImportTaskListener; |
| | | import org.opends.server.api.PasswordStorageScheme; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | PasswordPolicyImportPluginCfg config = |
| | | (PasswordPolicyImportPluginCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | PasswordPolicyImportPluginCfg configuration, |
| | | List<String> unacceptableReasons) |
| | |
| | | } |
| | | } |
| | | |
| | | if (resultCode == ResultCode.SUCCESS) |
| | | { |
| | | defaultAuthPasswordSchemes = defaultAuthSchemes; |
| | | defaultUserPasswordSchemes = defaultUserSchemes; |
| | | } |
| | | |
| | | return new ConfigChangeResult(resultCode, adminActionRequired, messages); |
| | | } |
| | | } |
| | |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.meta.PluginCfgDefn; |
| | | import org.opends.server.admin.std.server.PluginCfg; |
| | | import org.opends.server.admin.std.server.ProfilerPluginCfg; |
| | | import org.opends.server.api.plugin.DirectoryServerPlugin; |
| | | import org.opends.server.api.plugin.PluginType; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | ProfilerPluginCfg config = (ProfilerPluginCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ProfilerPluginCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | DN configEntryDN = configuration.dn(); |
| | | |
| | | // Make sure that the plugin is only registered as a startup plugin. |
| | | if (configuration.getPluginType().isEmpty()) |
| | |
| | | return new ConfigChangeResult(resultCode, adminActionRequired, messages); |
| | | } |
| | | } |
| | | |
| | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.ConnectionHandlerCfg; |
| | | import org.opends.server.admin.std.server.JMXConnectionHandlerCfg; |
| | | import org.opends.server.api.AlertGenerator; |
| | | import org.opends.server.api.ClientConnection; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(ConnectionHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | JMXConnectionHandlerCfg config = (JMXConnectionHandlerCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | JMXConnectionHandlerCfg config, |
| | | List<String> unacceptableReasons) { |
| | |
| | | import java.util.Set; |
| | | |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.ConnectionHandlerCfg; |
| | | import org.opends.server.admin.std.server.LDAPConnectionHandlerCfg; |
| | | import org.opends.server.api.AlertGenerator; |
| | | import org.opends.server.api.ClientConnection; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(ConnectionHandlerCfg configuration, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | LDAPConnectionHandlerCfg config = (LDAPConnectionHandlerCfg) configuration; |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | LDAPConnectionHandlerCfg config, |
| | | List<String> unacceptableReasons) { |
| | |
| | | sigList.add("void"); |
| | | expectedPublicMethods.add(sigList); |
| | | |
| | | sigList = new LinkedList<String>(); |
| | | sigList.add("isConfigurationAcceptable"); |
| | | sigList.add("boolean"); |
| | | sigList.add("org.opends.server.admin.std.server.PluginCfg"); |
| | | sigList.add("java.util.List"); |
| | | expectedPublicMethods.add(sigList); |
| | | |
| | | |
| | | LinkedList<LinkedList<String>> newPublicMethods = |
| | | new LinkedList<LinkedList<String>>(); |