P
- The type of the LogPublisher corresponding to this loggerC
- The type of the LogPublisherCfg corresponding to this loggerpublic abstract class AbstractLogger<P extends LogPublisher<C>,C extends LogPublisherCfg> extends Object implements ConfigurationAddListener<C>, ConfigurationDeleteListener<C>, ConfigurationChangeListener<C>
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractLogger.LoggerStorage<P extends LogPublisher<C>,C extends LogPublisherCfg>
The storage designed to store log publishers.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
addLogPublisher(P publisher)
Add a log publisher to the logger.
|
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationAdd(C config)
Adds a new configuration to this add listener.
|
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationChange(C config)
Applies the configuration changes to this change listener.
|
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationDelete(C config)
Deletes an existing configuration from this delete listener.
|
protected abstract ClassPropertyDefinition |
getJavaClassPropertyDefinition()
Returns the java
ClassPropertyDefinition for the current logger. |
protected abstract Collection<P> |
getLogPublishers()
Returns the log publishers.
|
void |
initializeLogger(List<C> configs,
ServerContext serverContext)
Initializes all the log publishers.
|
boolean |
isConfigurationAddAcceptable(C config,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed addition of a new configuration is
acceptable to this add listener.
|
boolean |
isConfigurationChangeAcceptable(C config,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed change to the configuration is
acceptable to this change listener.
|
boolean |
isConfigurationDeleteAcceptable(C config,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed deletion of an existing
configuration is acceptable to this delete listener.
|
abstract void |
removeAllLogPublishers()
Removes all existing log publishers from the logger.
|
abstract boolean |
removeLogPublisher(P publisher)
Remove a log publisher from the logger.
|
protected abstract Collection<P> getLogPublishers()
LogPublisher
spublic abstract void addLogPublisher(P publisher)
publisher
- The log publisher to add.public abstract boolean removeLogPublisher(P publisher)
publisher
- The log publisher to remove.public abstract void removeAllLogPublishers()
protected abstract ClassPropertyDefinition getJavaClassPropertyDefinition()
ClassPropertyDefinition
for the current logger.ClassPropertyDefinition
for the current logger.public void initializeLogger(List<C> configs, ServerContext serverContext) throws org.forgerock.opendj.config.server.ConfigException, InitializationException
configs
- The log publisher configurations.serverContext
- The server context.org.forgerock.opendj.config.server.ConfigException
- If an unrecoverable problem arises in the process of
performing the initialization as a result of the server
configuration.InitializationException
- If a problem occurs during initialization that is not
related to the server configuration.public boolean isConfigurationAddAcceptable(C config, List<LocalizableMessage> unacceptableReasons)
ConfigurationAddListener
isConfigurationAddAcceptable
in interface ConfigurationAddListener<C extends LogPublisherCfg>
config
- The configuration that will be added.unacceptableReasons
- A list that can be used to hold messages about why the
provided configuration is not acceptable.true
if the proposed addition is
acceptable, or false
if it is not.public boolean isConfigurationChangeAcceptable(C config, List<LocalizableMessage> unacceptableReasons)
ConfigurationChangeListener
isConfigurationChangeAcceptable
in interface ConfigurationChangeListener<C extends LogPublisherCfg>
config
- The new configuration containing the changes.unacceptableReasons
- A list that can be used to hold messages about why the
provided configuration is not acceptable.true
if the proposed change is
acceptable, or false
if it is not.public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationAdd(C config)
ConfigurationAddListener
applyConfigurationAdd
in interface ConfigurationAddListener<C extends LogPublisherCfg>
config
- The configuration that will be added.public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationChange(C config)
ConfigurationChangeListener
applyConfigurationChange
in interface ConfigurationChangeListener<C extends LogPublisherCfg>
config
- The new configuration containing the changes.public boolean isConfigurationDeleteAcceptable(C config, List<LocalizableMessage> unacceptableReasons)
ConfigurationDeleteListener
isConfigurationDeleteAcceptable
in interface ConfigurationDeleteListener<C extends LogPublisherCfg>
config
- The configuration that will be deleted.unacceptableReasons
- A list that can be used to hold messages about why the
provided configuration is not acceptable.true
if the proposed deletion is
acceptable, or false
if it is not.public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationDelete(C config)
ConfigurationDeleteListener
applyConfigurationDelete
in interface ConfigurationDeleteListener<C extends LogPublisherCfg>
config
- The existing configuration that will be deleted.Copyright © 2010-2016 ForgeRock AS. All Rights Reserved.