Package org.opends.server.loggers
Class TextDebugLogPublisher
- java.lang.Object
-
- org.opends.server.loggers.DebugLogPublisher<FileBasedDebugLogPublisherCfg>
-
- org.opends.server.loggers.TextDebugLogPublisher
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ConfigurationAddListener<DebugTargetCfg>,ConfigurationChangeListener<FileBasedDebugLogPublisherCfg>,ConfigurationDeleteListener<DebugTargetCfg>,LogPublisher<FileBasedDebugLogPublisherCfg>
public final class TextDebugLogPublisher extends DebugLogPublisher<FileBasedDebugLogPublisherCfg> implements ConfigurationChangeListener<FileBasedDebugLogPublisherCfg>, ConfigurationAddListener<DebugTargetCfg>, ConfigurationDeleteListener<DebugTargetCfg>
The debug log publisher implementation that writes debug messages to files on disk. It also maintains the rotation and retention polices of the log files.
-
-
Constructor Summary
Constructors Constructor Description TextDebugLogPublisher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigChangeResultapplyConfigurationAdd(DebugTargetCfg config)Adds a new configuration to this add listener.ConfigChangeResultapplyConfigurationChange(FileBasedDebugLogPublisherCfg config)Applies the configuration changes to this change listener.ConfigChangeResultapplyConfigurationDelete(DebugTargetCfg config)Deletes an existing configuration from this delete listener.voidclose()Close this publisher.DngetDN()Gets the DN of the configuration entry for this log publisher.voidinitializeLogPublisher(FileBasedDebugLogPublisherCfg cfg, ServerContext serverContext)Initializes this publisher provider based on the information in the provided debug publisher configuration.booleanisConfigurationAcceptable(FileBasedDebugLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons)Indicates whether the provided configuration is acceptable for this log publisher.booleanisConfigurationAddAcceptable(DebugTargetCfg config, List<LocalizableMessage> unacceptableReasons)Indicates whether the proposed addition of a new configuration is acceptable to this add listener.booleanisConfigurationChangeAcceptable(FileBasedDebugLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons)Indicates whether the proposed change to the configuration is acceptable to this change listener.booleanisConfigurationDeleteAcceptable(DebugTargetCfg config, List<LocalizableMessage> unacceptableReasons)Indicates whether the proposed deletion of an existing configuration is acceptable to this delete listener.voidtrace(TraceSettings settings, String signature, String sourceLocation, String msg, Throwable exception, StackTraceElement[] stackTrace)
-
-
-
Method Detail
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(FileBasedDebugLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons)
Description copied from interface:LogPublisherIndicates whether the provided configuration is acceptable for this log publisher. It should be possible to call this method on an uninitialized log publisher instance in order to determine whether the log publisher would be able to use the provided configuration.- Specified by:
isConfigurationAcceptablein interfaceLogPublisher<FileBasedDebugLogPublisherCfg>- Overrides:
isConfigurationAcceptablein classDebugLogPublisher<FileBasedDebugLogPublisherCfg>- Parameters:
config- The log publisher configuration for which to make the determination.unacceptableReasons- A list that may be used to hold the reasons that the provided configuration is not acceptable.- Returns:
trueif the provided configuration is acceptable for this log publisher, orfalseif not.
-
initializeLogPublisher
public void initializeLogPublisher(FileBasedDebugLogPublisherCfg cfg, ServerContext serverContext) throws ConfigException, InitializationException
Description copied from interface:LogPublisherInitializes this publisher provider based on the information in the provided debug publisher configuration.- Specified by:
initializeLogPublisherin interfaceLogPublisher<FileBasedDebugLogPublisherCfg>- Parameters:
cfg- The publisher configuration that contains the information to use to initialize this publisher.serverContext- The server context.- Throws:
ConfigException- If an unrecoverable problem arises in the process of performing the initialization as a result of the server configuration.InitializationException- If a problem occurs during initialization that is not related to the server configuration.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(FileBasedDebugLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons)
Description copied from interface:ConfigurationChangeListenerIndicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptablein interfaceConfigurationChangeListener<FileBasedDebugLogPublisherCfg>- Parameters:
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.- Returns:
- Returns
trueif the proposed change is acceptable, orfalseif it is not.
-
applyConfigurationChange
public ConfigChangeResult applyConfigurationChange(FileBasedDebugLogPublisherCfg config)
Description copied from interface:ConfigurationChangeListenerApplies the configuration changes to this change listener.- Specified by:
applyConfigurationChangein interfaceConfigurationChangeListener<FileBasedDebugLogPublisherCfg>- Parameters:
config- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
isConfigurationAddAcceptable
public boolean isConfigurationAddAcceptable(DebugTargetCfg config, List<LocalizableMessage> unacceptableReasons)
Description copied from interface:ConfigurationAddListenerIndicates whether the proposed addition of a new configuration is acceptable to this add listener.- Specified by:
isConfigurationAddAcceptablein interfaceConfigurationAddListener<DebugTargetCfg>- Parameters:
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.- Returns:
- Returns
trueif the proposed addition is acceptable, orfalseif it is not.
-
isConfigurationDeleteAcceptable
public boolean isConfigurationDeleteAcceptable(DebugTargetCfg config, List<LocalizableMessage> unacceptableReasons)
Description copied from interface:ConfigurationDeleteListenerIndicates whether the proposed deletion of an existing configuration is acceptable to this delete listener.- Specified by:
isConfigurationDeleteAcceptablein interfaceConfigurationDeleteListener<DebugTargetCfg>- Parameters:
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.- Returns:
- Returns
trueif the proposed deletion is acceptable, orfalseif it is not.
-
applyConfigurationAdd
public ConfigChangeResult applyConfigurationAdd(DebugTargetCfg config)
Description copied from interface:ConfigurationAddListenerAdds a new configuration to this add listener.- Specified by:
applyConfigurationAddin interfaceConfigurationAddListener<DebugTargetCfg>- Parameters:
config- The configuration that will be added.- Returns:
- Returns information about the result of adding the configuration.
-
applyConfigurationDelete
public ConfigChangeResult applyConfigurationDelete(DebugTargetCfg config)
Description copied from interface:ConfigurationDeleteListenerDeletes an existing configuration from this delete listener.- Specified by:
applyConfigurationDeletein interfaceConfigurationDeleteListener<DebugTargetCfg>- Parameters:
config- The existing configuration that will be deleted.- Returns:
- Returns information about the result of deleting the configuration.
-
trace
public void trace(TraceSettings settings, String signature, String sourceLocation, String msg, Throwable exception, StackTraceElement[] stackTrace)
-
close
public void close()
Description copied from interface:LogPublisherClose this publisher.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceLogPublisher<FileBasedDebugLogPublisherCfg>
-
getDN
public Dn getDN()
Description copied from interface:LogPublisherGets the DN of the configuration entry for this log publisher.- Specified by:
getDNin interfaceLogPublisher<FileBasedDebugLogPublisherCfg>- Returns:
- The configuration entry DN.
-
-