Class TextAccessLogPublisher
- java.lang.Object
-
- org.opends.server.loggers.AccessLogPublisher<T>
-
- org.opends.server.loggers.TextAccessLogPublisher
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ConfigurationChangeListener<FileBasedAccessLogPublisherCfg>,LogPublisher<FileBasedAccessLogPublisherCfg>
public final class TextAccessLogPublisher extends AccessLogPublisher<T> implements ConfigurationChangeListener<FileBasedAccessLogPublisherCfg>
This class provides the implementation of the access logger used by the directory server.
-
-
Constructor Summary
Constructors Constructor Description TextAccessLogPublisher()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigChangeResultapplyConfigurationChange(FileBasedAccessLogPublisherCfg config)Applies the configuration changes to this change listener.protected voidbuildFilters(boolean suppressInternal)For startup access logger.voidclose()Close this publisher.protected voidclose0()Release any resources owned by the sub-implementation.DNgetDN()Gets the DN of the configuration entry for this log publisher.static TextAccessLogPublishergetStartupTextAccessPublisher(TextWriter writer, boolean suppressInternal)Returns an instance of the text access log publisher that will print all messages to the provided writer.protected voidinitializeFilters(T config)Initializes the filter configuration.voidinitializeLogPublisher(FileBasedAccessLogPublisherCfg cfg, ServerContext serverContext)Initializes this publisher provider based on the information in the provided debug publisher configuration.booleanisConfigurationAcceptable(FileBasedAccessLogPublisherCfg configuration, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)Indicates whether the provided configuration is acceptable for this log publisher.booleanisConfigurationChangeAcceptable(FileBasedAccessLogPublisherCfg config, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)Indicates whether the proposed change to the configuration is acceptable to this change listener.protected booleanisConnectLoggable(ClientConnection c)Returnstrueif the provided client connect should be logged.protected booleanisDisconnectLoggable(ClientConnection c)Returnstrueif the provided client disconnect should be logged.protected booleanisFilterConfigurationAcceptable(T config, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)Perform any initialization required by the sub-implementation.protected booleanisRequestLoggable(Operation o)Returnstrueif the provided request should be logged.protected booleanisResponseLoggable(Operation o)Returnstrueif the provided response should be logged.voidlogAbandonRequest(AbandonOperation abandonOperation)Writes a message to the access logger with information about the abandon request associated with the provided abandon operation.voidlogAbandonResult(AbandonOperation abandonOperation)Writes a message to the access logger with information about the result of the provided abandon operation.voidlogAddRequest(AddOperation addOperation)Writes a message to the access logger with information about the add request associated with the provided add operation.voidlogAddResponse(AddOperation addOperation)Writes a message to the access logger with information about the add response associated with the provided add operation.voidlogBindRequest(BindOperation bindOperation)Writes a message to the access logger with information about the bind request associated with the provided bind operation.voidlogBindResponse(BindOperation bindOperation)Writes a message to the access logger with information about the bind response associated with the provided bind operation.voidlogCompareRequest(CompareOperation compareOperation)Writes a message to the access logger with information about the compare request associated with the provided compare operation.voidlogCompareResponse(CompareOperation compareOperation)Writes a message to the access logger with information about the compare response associated with the provided compare operation.voidlogConnect(ClientConnection clientConnection)Writes a message to the access logger with information about a new client connection that has been established, regardless of whether it will be immediately terminated.voidlogDeleteRequest(DeleteOperation deleteOperation)Writes a message to the access logger with information about the delete request associated with the provided delete operation.voidlogDeleteResponse(DeleteOperation deleteOperation)Writes a message to the access logger with information about the delete response associated with the provided delete operation.voidlogDisconnect(ClientConnection clientConnection, DisconnectReason disconnectReason, org.forgerock.i18n.LocalizableMessage message)Writes a message to the access logger with information about the termination of an existing client connection.voidlogExtendedRequest(ExtendedOperation extendedOperation)Writes a message to the access logger with information about the extended request associated with the provided extended operation.voidlogExtendedResponse(ExtendedOperation extendedOperation)Writes a message to the access logger with information about the extended response associated with the provided extended operation.voidlogModifyDNRequest(ModifyDNOperation modifyDNOperation)Writes a message to the access logger with information about the modify DN request associated with the provided modify DN operation.voidlogModifyDNResponse(ModifyDNOperation modifyDNOperation)Writes a message to the access logger with information about the modify DN response associated with the provided modify DN operation.voidlogModifyRequest(ModifyOperation modifyOperation)Writes a message to the access logger with information about the modify request associated with the provided modify operation.voidlogModifyResponse(ModifyOperation modifyOperation)Writes a message to the access logger with information about the modify response associated with the provided modify operation.voidlogSearchRequest(SearchOperation searchOperation)Writes a message to the access logger with information about the search request associated with the provided search operation.voidlogSearchResultDone(SearchOperation searchOperation)Writes a message to the access logger with information about the completion of the provided search operation.voidlogUnbind(UnbindOperation unbindOperation)Writes a message to the access logger with information about the unbind request associated with the provided unbind operation.
-
-
-
Method Detail
-
getStartupTextAccessPublisher
public static TextAccessLogPublisher getStartupTextAccessPublisher(TextWriter writer, boolean suppressInternal)
Returns an instance of the text access log publisher that will print all messages to the provided writer. This is used to print the messages to the console when the server starts up.- Parameters:
writer- The text writer where the message will be written to.suppressInternal- Indicates whether to suppress internal operations.- Returns:
- The instance of the text error log publisher that will print all messages to standard out.
-
applyConfigurationChange
public ConfigChangeResult applyConfigurationChange(FileBasedAccessLogPublisherCfg config)
Description copied from interface:ConfigurationChangeListenerApplies the configuration changes to this change listener.- Specified by:
applyConfigurationChangein interfaceConfigurationChangeListener<FileBasedAccessLogPublisherCfg>- Parameters:
config- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
initializeLogPublisher
public void initializeLogPublisher(FileBasedAccessLogPublisherCfg 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<FileBasedAccessLogPublisherCfg>- 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.
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(FileBasedAccessLogPublisherCfg configuration, List<org.forgerock.i18n.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.
Note that implementations which use a subclass of the provided configuration class will likely need to cast the configuration to the appropriate subclass type.- Specified by:
isConfigurationAcceptablein interfaceLogPublisher<FileBasedAccessLogPublisherCfg>- Overrides:
isConfigurationAcceptablein classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
configuration- 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.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(FileBasedAccessLogPublisherCfg config, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)
Description copied from interface:ConfigurationChangeListenerIndicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptablein interfaceConfigurationChangeListener<FileBasedAccessLogPublisherCfg>- 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.
-
logAbandonRequest
public void logAbandonRequest(AbandonOperation abandonOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the abandon request associated with the provided abandon operation.The default implementation is to not log anything.
- Overrides:
logAbandonRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
abandonOperation- The abandon operation containing the information to use to log the abandon request.
-
logAbandonResult
public void logAbandonResult(AbandonOperation abandonOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the result of the provided abandon operation.The default implementation is to not log anything.
- Overrides:
logAbandonResultin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
abandonOperation- The abandon operation containing the information to use to log the abandon request.
-
logAddRequest
public void logAddRequest(AddOperation addOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the add request associated with the provided add operation.The default implementation is to not log anything.
- Overrides:
logAddRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
addOperation- The add operation containing the information to use to log the add request.
-
logAddResponse
public void logAddResponse(AddOperation addOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the add response associated with the provided add operation.The default implementation is to not log anything.
- Overrides:
logAddResponsein classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
addOperation- The add operation containing the information to use to log the add response.
-
logBindRequest
public void logBindRequest(BindOperation bindOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the bind request associated with the provided bind operation.The default implementation is to not log anything.
- Overrides:
logBindRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
bindOperation- The bind operation containing the information to use to log the bind request.
-
logBindResponse
public void logBindResponse(BindOperation bindOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the bind response associated with the provided bind operation.The default implementation is to not log anything.
- Overrides:
logBindResponsein classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
bindOperation- The bind operation containing the information to use to log the bind response.
-
logCompareRequest
public void logCompareRequest(CompareOperation compareOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the compare request associated with the provided compare operation.The default implementation is to not log anything.
- Overrides:
logCompareRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
compareOperation- The compare operation containing the information to use to log the compare request.
-
logCompareResponse
public void logCompareResponse(CompareOperation compareOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the compare response associated with the provided compare operation.The default implementation is to not log anything.
- Overrides:
logCompareResponsein classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
compareOperation- The compare operation containing the information to use to log the compare response.
-
logConnect
public void logConnect(ClientConnection clientConnection)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about a new client connection that has been established, regardless of whether it will be immediately terminated.The default implementation is to not log anything.
- Overrides:
logConnectin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
clientConnection- The client connection that has been established.
-
logDeleteRequest
public void logDeleteRequest(DeleteOperation deleteOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the delete request associated with the provided delete operation.The default implementation is to not log anything.
- Overrides:
logDeleteRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
deleteOperation- The delete operation containing the information to use to log the delete request.
-
logDeleteResponse
public void logDeleteResponse(DeleteOperation deleteOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the delete response associated with the provided delete operation.The default implementation is to not log anything.
- Overrides:
logDeleteResponsein classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
deleteOperation- The delete operation containing the information to use to log the delete response.
-
logDisconnect
public void logDisconnect(ClientConnection clientConnection, DisconnectReason disconnectReason, org.forgerock.i18n.LocalizableMessage message)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the termination of an existing client connection.The default implementation is to not log anything.
- Overrides:
logDisconnectin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
clientConnection- The client connection that has been terminated.disconnectReason- A generic disconnect reason for the connection termination.message- A human-readable message that can provide additional information about the disconnect.
-
logExtendedRequest
public void logExtendedRequest(ExtendedOperation extendedOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the extended request associated with the provided extended operation.The default implementation is to not log anything.
- Overrides:
logExtendedRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
extendedOperation- The extended operation containing the information to use to log the extended request.
-
logExtendedResponse
public void logExtendedResponse(ExtendedOperation extendedOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the extended response associated with the provided extended operation.The default implementation is to not log anything.
- Overrides:
logExtendedResponsein classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
extendedOperation- The extended operation containing the information to use to log the extended response.
-
logModifyDNRequest
public void logModifyDNRequest(ModifyDNOperation modifyDNOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the modify DN request associated with the provided modify DN operation.The default implementation is to not log anything.
- Overrides:
logModifyDNRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
modifyDNOperation- The modify DN operation containing the information to use to log the modify DN request.
-
logModifyDNResponse
public void logModifyDNResponse(ModifyDNOperation modifyDNOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the modify DN response associated with the provided modify DN operation.The default implementation is to not log anything.
- Overrides:
logModifyDNResponsein classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
modifyDNOperation- The modify DN operation containing the information to use to log the modify DN response.
-
logModifyRequest
public void logModifyRequest(ModifyOperation modifyOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the modify request associated with the provided modify operation.The default implementation is to not log anything.
- Overrides:
logModifyRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
modifyOperation- The modify operation containing the information to use to log the modify request.
-
logModifyResponse
public void logModifyResponse(ModifyOperation modifyOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the modify response associated with the provided modify operation.The default implementation is to not log anything.
- Overrides:
logModifyResponsein classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
modifyOperation- The modify operation containing the information to use to log the modify response.
-
logSearchRequest
public void logSearchRequest(SearchOperation searchOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the search request associated with the provided search operation.The default implementation is to not log anything.
- Overrides:
logSearchRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
searchOperation- The search operation containing the information to use to log the search request.
-
logSearchResultDone
public void logSearchResultDone(SearchOperation searchOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the completion of the provided search operation.The default implementation is to not log anything.
- Overrides:
logSearchResultDonein classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
searchOperation- The search operation containing the information to use to log the search result done message.
-
logUnbind
public void logUnbind(UnbindOperation unbindOperation)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the unbind request associated with the provided unbind operation.The default implementation is to not log anything.
- Overrides:
logUnbindin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
unbindOperation- The unbind operation containing the information to use to log the unbind request.
-
close0
protected void close0()
Release any resources owned by the sub-implementation.
-
close
public final void close()
Description copied from interface:LogPublisherClose this publisher.
-
getDN
public final DN getDN()
Description copied from interface:LogPublisherGets the DN of the configuration entry for this log publisher.- Returns:
- The configuration entry DN.
-
buildFilters
protected void buildFilters(boolean suppressInternal)
For startup access logger.- Parameters:
suppressInternal-trueif internal operations should be suppressed.
-
initializeFilters
protected final void initializeFilters(T config) throws ConfigException, InitializationExceptionInitializes the filter configuration. This method must be called by sub-classes during initialization.- Parameters:
config- The access publisher configuration that contains the information to use to initialize this access publisher.- 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.
-
isConnectLoggable
protected final boolean isConnectLoggable(ClientConnection c)
Returnstrueif the provided client connect should be logged.- Parameters:
c- The client connection.- Returns:
trueif the provided client connect should be logged.
-
isDisconnectLoggable
protected final boolean isDisconnectLoggable(ClientConnection c)
Returnstrueif the provided client disconnect should be logged.- Parameters:
c- The client connection.- Returns:
trueif the provided client disconnect should be logged.
-
isFilterConfigurationAcceptable
protected final boolean isFilterConfigurationAcceptable(T config, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)Perform any initialization required by the sub-implementation.- Parameters:
config- The access publisher configuration that contains the information to use to initialize this access publisher.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 access log publisher, orfalseif not.
-
isRequestLoggable
protected final boolean isRequestLoggable(Operation o)
Returnstrueif the provided request should be logged.- Parameters:
o- The request.- Returns:
trueif the provided request should be logged.
-
isResponseLoggable
protected final boolean isResponseLoggable(Operation o)
Returnstrueif the provided response should be logged.- Parameters:
o- The response.- Returns:
trueif the provided response should be logged.
-
-