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()Default constructor.TextAccessLogPublisher(TextWriter writer, ServerContext serverContext)Prints all messages to the provided writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigChangeResultapplyConfigurationChange(FileBasedAccessLogPublisherCfg config)Applies the configuration changes to this change listener.protected voidbuildFilters()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.protected StringgetTransactionId(RequestContext context)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<LocalizableMessage> unacceptableReasons)Indicates whether the provided configuration is acceptable for this log publisher.booleanisConfigurationChangeAcceptable(FileBasedAccessLogPublisherCfg config, List<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<LocalizableMessage> unacceptableReasons)Perform any initialization required by the sub-implementation.protected booleanisRequestLoggable(RequestContext context, Request request)Returnstrueif the provided request should be logged.protected booleanisResponseLoggable(RequestContext context, Request request, Response response)Returnstrueif the provided response should be logged.protected booleanisTlsHandshakeLoggable(ConnectionContext c)Returnstrueif the provided TLS handshake should be logged.voidlogAbandonRequest(RequestContext context, AbandonRequest request)Writes a message to the access logger with information about the provided abandon request.voidlogAbandonResult(RequestContext context, AbandonRequest request, Result result)Writes a message to the access logger with information about the provided result.voidlogAddRequest(RequestContext context, AddRequest request)Writes a message to the access logger with information about the add request.voidlogAddResult(RequestContext context, AddRequest request, Result result)Writes a message to the access logger with information about the add result.voidlogBindRequest(RequestContext context, BindRequest request)Writes a message to the access logger with information about the bind request.voidlogBindResult(RequestContext context, BindRequest request, Result result)Writes a message to the access logger with information about the bind result.voidlogCompareRequest(RequestContext context, CompareRequest request)Writes a message to the access logger with information about the compare request.voidlogCompareResult(RequestContext context, CompareRequest request, Result result)Writes a message to the access logger with information about the compare result.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(RequestContext context, DeleteRequest request)Writes a message to the access logger with information about the delete request.voidlogDeleteResult(RequestContext context, DeleteRequest request, Result result)Writes a message to the access logger with information about the delete result.voidlogDisconnect(ClientConnection clientConnection, DisconnectReason disconnectReason, LocalizableMessage message)Writes a message to the access logger with information about the termination of an existing client connection.voidlogExtendedRequest(RequestContext context, ExtendedRequest<?> request)Writes a message to the access logger with information about the extended request.voidlogExtendedResult(RequestContext context, ExtendedRequest<?> request, Result result)Writes a message to the access logger with information about the extended result.voidlogInvalidRequest(RequestContext context, InvalidRequest request)Writes a message to the access logger with information about an invalid request.voidlogInvalidResult(RequestContext context, InvalidRequest request, Result result)Writes a message to the access logger with information about the result.voidlogModifyDnRequest(RequestContext context, ModifyDnRequest request)Writes a message to the access logger with information about the modifyDN request.voidlogModifyDnResult(RequestContext context, ModifyDnRequest request, Result result)Writes a message to the access logger with information about the modifyDN result.voidlogModifyRequest(RequestContext context, ModifyRequest request)Writes a message to the access logger with information about the modify request.voidlogModifyResult(RequestContext context, ModifyRequest request, Result result)Writes a message to the access logger with information about the modify result.voidlogSearchRequest(RequestContext context, SearchRequest request)Writes a message to the access logger with information about the search request.voidlogSearchResult(RequestContext context, SearchRequest request, Result result)Writes a message to the access logger with information about the search result.voidlogUnbind(RequestContext context, UnbindRequest request)Writes a message to the access logger with information about the provided unbind request.-
Methods inherited from class org.opends.server.loggers.AccessLogPublisher
logTlsHandshake
-
-
-
-
Constructor Detail
-
TextAccessLogPublisher
public TextAccessLogPublisher()
Default constructor.
-
TextAccessLogPublisher
public TextAccessLogPublisher(TextWriter writer, ServerContext serverContext)
Prints all messages to the provided writer.- Parameters:
writer- The text writer where the message will be written to.serverContext- the server context
-
-
Method Detail
-
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<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<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<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(RequestContext context, AbandonRequest request)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the provided abandon request.The default implementation is to not log anything.
- Overrides:
logAbandonRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the abandon request to log
-
logAbandonResult
public void logAbandonResult(RequestContext context, AbandonRequest request, Result result)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the provided result. Note there is no LDAP result sent back to client, it is for logging purposes only.- Overrides:
logAbandonResultin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the context for the requestrequest- the original abandon requestresult- theResultto the abandon request
-
logAddRequest
public void logAddRequest(RequestContext context, AddRequest request)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the add request.The default implementation is to not log anything.
- Overrides:
logAddRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the add request to log
-
logAddResult
public void logAddResult(RequestContext context, AddRequest request, Result result)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the add result.The default implementation is to not log anything.
- Overrides:
logAddResultin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original add requestresult- the result to log
-
logBindRequest
public void logBindRequest(RequestContext context, BindRequest request)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the bind request.The default implementation is to not log anything.
- Overrides:
logBindRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the bind request to log
-
logBindResult
public void logBindResult(RequestContext context, BindRequest request, Result result)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the bind result.The default implementation is to not log anything.
- Overrides:
logBindResultin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original bind requestresult- the result to log
-
logCompareRequest
public void logCompareRequest(RequestContext context, CompareRequest request)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the compare request.The default implementation is to not log anything.
- Overrides:
logCompareRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the compare request to log
-
logCompareResult
public void logCompareResult(RequestContext context, CompareRequest request, Result result)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the compare result.The default implementation is to not log anything.
- Overrides:
logCompareResultin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original compare requestresult- the result to log
-
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(RequestContext context, DeleteRequest request)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the delete request.The default implementation is to not log anything.
- Overrides:
logDeleteRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original delete request
-
logDeleteResult
public void logDeleteResult(RequestContext context, DeleteRequest request, Result result)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the delete result.The default implementation is to not log anything.
- Overrides:
logDeleteResultin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original delete requestresult- the result to log
-
logDisconnect
public void logDisconnect(ClientConnection clientConnection, DisconnectReason disconnectReason, 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(RequestContext context, ExtendedRequest<?> request)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the extended request.The default implementation is to not log anything.
- Overrides:
logExtendedRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original extended request
-
logExtendedResult
public void logExtendedResult(RequestContext context, ExtendedRequest<?> request, Result result)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the extended result.The default implementation is to not log anything.
- Overrides:
logExtendedResultin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original extended requestresult- the result to log
-
logInvalidRequest
public void logInvalidRequest(RequestContext context, InvalidRequest request)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about an invalid request.- Overrides:
logInvalidRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the context for this requestrequest- the description of the invalid request to log
-
logInvalidResult
public void logInvalidResult(RequestContext context, InvalidRequest request, Result result)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the result.The default implementation is to not log anything.
- Overrides:
logInvalidResultin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original description of the invalid requestresult- the result to log
-
logModifyDnRequest
public void logModifyDnRequest(RequestContext context, ModifyDnRequest request)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the modifyDN request.The default implementation is to not log anything.
- Overrides:
logModifyDnRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original modifyDN request
-
logModifyDnResult
public void logModifyDnResult(RequestContext context, ModifyDnRequest request, Result result)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the modifyDN result.The default implementation is to not log anything.
- Overrides:
logModifyDnResultin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original modifyDN requestresult- the result to log
-
logModifyRequest
public void logModifyRequest(RequestContext context, ModifyRequest request)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the modify request.The default implementation is to not log anything.
- Overrides:
logModifyRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original modify request
-
logModifyResult
public void logModifyResult(RequestContext context, ModifyRequest request, Result result)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the modify result.The default implementation is to not log anything.
- Overrides:
logModifyResultin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original modify requestresult- the result to log
-
logSearchRequest
public void logSearchRequest(RequestContext context, SearchRequest request)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the search request.The default implementation is to not log anything.
- Overrides:
logSearchRequestin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original search request
-
logSearchResult
public void logSearchResult(RequestContext context, SearchRequest request, Result result)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the search result.The default implementation is to not log anything.
- Overrides:
logSearchResultin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the original search requestresult- the result to log
-
logUnbind
public void logUnbind(RequestContext context, UnbindRequest request)
Description copied from class:AccessLogPublisherWrites a message to the access logger with information about the provided unbind request.The default implementation is to not log anything.
- Overrides:
logUnbindin classAccessLogPublisher<FileBasedAccessLogPublisherCfg>- Parameters:
context- the logging context for the requestrequest- the unbind request to log
-
close0
protected void close0()
Release any resources owned by the sub-implementation.
-
getTransactionId
protected String getTransactionId(RequestContext context)
-
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.
-
initializeFilters
protected final void initializeFilters(T config) throws ConfigException
Initializes 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.
-
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.
-
isTlsHandshakeLoggable
protected final boolean isTlsHandshakeLoggable(ConnectionContext c)
Returnstrueif the provided TLS handshake should be logged.- Parameters:
c- the connection context- Returns:
trueif the provided TLS handshake should be logged.
-
isFilterConfigurationAcceptable
protected final boolean isFilterConfigurationAcceptable(T config, List<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(RequestContext context, Request request)
Returnstrueif the provided request should be logged.- Parameters:
context- the log contextrequest- the request to log- Returns:
trueif the provided request should be logged.
-
isResponseLoggable
protected final boolean isResponseLoggable(RequestContext context, Request request, Response response)
Returnstrueif the provided response should be logged.- Parameters:
context- the log contextrequest- the request to which the response correspondsresponse- the response to log- Returns:
trueif the provided response should be logged.
-
buildFilters
protected void buildFilters()
For startup access logger.
-
-