public final class TextAccessLogPublisher extends AccessLogPublisher<T> implements ConfigurationChangeListener<FileBasedAccessLogPublisherCfg>
Modifier and Type | Field and Description |
---|---|
protected static LocalizedLogger |
logger |
Constructor and Description |
---|
TextAccessLogPublisher() |
Modifier and Type | Method and Description |
---|---|
ConfigChangeResult |
applyConfigurationChange(FileBasedAccessLogPublisherCfg config)
Applies the configuration changes to this change listener.
|
protected void |
buildFilters(boolean suppressInternal)
For startup access logger.
|
void |
close()
Close this publisher.
|
protected void |
close0()
Release any resources owned by the sub-implementation.
|
Dn |
getDN()
Gets the DN of the configuration entry for this log publisher.
|
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.
|
protected String |
getTransactionId(RequestContext context) |
protected void |
initializeFilters(T config)
Initializes the filter configuration.
|
void |
initializeLogPublisher(FileBasedAccessLogPublisherCfg cfg,
ServerContext serverContext)
Initializes this publisher provider based on the information in the provided debug publisher configuration.
|
boolean |
isConfigurationAcceptable(FileBasedAccessLogPublisherCfg configuration,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this log publisher.
|
boolean |
isConfigurationChangeAcceptable(FileBasedAccessLogPublisherCfg config,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable
to this change listener.
|
protected boolean |
isConnectLoggable(ClientConnection c)
Returns
true if the provided client connect should be logged. |
protected boolean |
isDisconnectLoggable(ClientConnection c)
Returns
true if the provided client disconnect should be logged. |
protected boolean |
isFilterConfigurationAcceptable(T config,
List<LocalizableMessage> unacceptableReasons)
Perform any initialization required by the sub-implementation.
|
protected boolean |
isRequestLoggable(RequestContext context,
Request request)
Returns
true if the provided request should be logged. |
protected boolean |
isResponseLoggable(RequestContext context,
Request request,
Response response)
Returns
true if the provided response should be logged. |
void |
logAbandonRequest(RequestContext context,
AbandonRequest request)
Writes a message to the access logger with information about the provided abandon request.
|
void |
logAbandonResult(RequestContext context,
AbandonRequest request,
Result result)
Writes a message to the access logger with information about the provided result.
|
void |
logAddRequest(RequestContext context,
AddRequest request)
Writes a message to the access logger with information about the add request.
|
void |
logAddResult(RequestContext context,
AddRequest request,
Result result)
Writes a message to the access logger with information about the add result.
|
void |
logBindRequest(RequestContext context,
BindRequest request)
Writes a message to the access logger with information about the bind request.
|
void |
logBindResult(RequestContext context,
BindRequest request,
Result result)
Writes a message to the access logger with information about the bind result.
|
void |
logCompareRequest(RequestContext context,
CompareRequest request)
Writes a message to the access logger with information about the compare request.
|
void |
logCompareResult(RequestContext context,
CompareRequest request,
Result result)
Writes a message to the access logger with information about the compare result.
|
void |
logConnect(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.
|
void |
logDeleteRequest(RequestContext context,
DeleteRequest request)
Writes a message to the access logger with information about the delete request.
|
void |
logDeleteResult(RequestContext context,
DeleteRequest request,
Result result)
Writes a message to the access logger with information about the delete result.
|
void |
logDisconnect(ClientConnection clientConnection,
DisconnectReason disconnectReason,
LocalizableMessage message)
Writes a message to the access logger with information about the termination of an existing client connection.
|
void |
logExtendedRequest(RequestContext context,
ExtendedRequest<?> request)
Writes a message to the access logger with information about the extended request.
|
void |
logExtendedResult(RequestContext context,
ExtendedRequest<?> request,
Result result)
Writes a message to the access logger with information about the extended result.
|
void |
logInvalidRequest(RequestContext context,
InvalidRequest request)
Writes a message to the access logger with information about an invalid request.
|
void |
logInvalidResult(RequestContext context,
InvalidRequest request,
Result result)
Writes a message to the access logger with information about the result.
|
void |
logModifyDnRequest(RequestContext context,
ModifyDnRequest request)
Writes a message to the access logger with information about the modifyDN request.
|
void |
logModifyDnResult(RequestContext context,
ModifyDnRequest request,
Result result)
Writes a message to the access logger with information about the modifyDN result.
|
void |
logModifyRequest(RequestContext context,
ModifyRequest request)
Writes a message to the access logger with information about the modify request.
|
void |
logModifyResult(RequestContext context,
ModifyRequest request,
Result result)
Writes a message to the access logger with information about the modify result.
|
void |
logSearchRequest(RequestContext context,
SearchRequest request)
Writes a message to the access logger with information about the search request.
|
void |
logSearchResult(RequestContext context,
SearchRequest request,
Result result)
Writes a message to the access logger with information about the search result.
|
void |
logUnbind(RequestContext context,
UnbindRequest request)
Writes a message to the access logger with information about the provided unbind request.
|
protected static final LocalizedLogger logger
public static TextAccessLogPublisher getStartupTextAccessPublisher(TextWriter writer, boolean suppressInternal)
writer
- The text writer where the message will be written to.suppressInternal
- Indicates whether to suppress internal operations.public ConfigChangeResult applyConfigurationChange(FileBasedAccessLogPublisherCfg config)
ConfigurationChangeListener
applyConfigurationChange
in interface ConfigurationChangeListener<FileBasedAccessLogPublisherCfg>
config
- The new configuration containing the changes.public void initializeLogPublisher(FileBasedAccessLogPublisherCfg cfg, ServerContext serverContext) throws ConfigException, InitializationException
LogPublisher
initializeLogPublisher
in interface LogPublisher<FileBasedAccessLogPublisherCfg>
cfg
- The publisher configuration that contains the information to use to initialize this publisher.serverContext
- The server context.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 isConfigurationAcceptable(FileBasedAccessLogPublisherCfg configuration, List<LocalizableMessage> unacceptableReasons)
LogPublisher
isConfigurationAcceptable
in interface LogPublisher<FileBasedAccessLogPublisherCfg>
isConfigurationAcceptable
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
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.true
if the provided configuration is acceptable for this log publisher, or false
if not.public boolean isConfigurationChangeAcceptable(FileBasedAccessLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons)
ConfigurationChangeListener
isConfigurationChangeAcceptable
in interface ConfigurationChangeListener<FileBasedAccessLogPublisherCfg>
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 void logAbandonRequest(RequestContext context, AbandonRequest request)
AccessLogPublisher
The default implementation is to not log anything.
logAbandonRequest
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the abandon request to logpublic void logAbandonResult(RequestContext context, AbandonRequest request, Result result)
AccessLogPublisher
logAbandonResult
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the context for the requestrequest
- the original abandon requestresult
- the Result
to the abandon requestpublic void logAddRequest(RequestContext context, AddRequest request)
AccessLogPublisher
The default implementation is to not log anything.
logAddRequest
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the add request to logpublic void logAddResult(RequestContext context, AddRequest request, Result result)
AccessLogPublisher
The default implementation is to not log anything.
logAddResult
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original add requestresult
- the result to logpublic void logBindRequest(RequestContext context, BindRequest request)
AccessLogPublisher
The default implementation is to not log anything.
logBindRequest
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the bind request to logpublic void logBindResult(RequestContext context, BindRequest request, Result result)
AccessLogPublisher
The default implementation is to not log anything.
logBindResult
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original bind requestresult
- the result to logpublic void logCompareRequest(RequestContext context, CompareRequest request)
AccessLogPublisher
The default implementation is to not log anything.
logCompareRequest
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the compare request to logpublic void logCompareResult(RequestContext context, CompareRequest request, Result result)
AccessLogPublisher
The default implementation is to not log anything.
logCompareResult
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original compare requestresult
- the result to logpublic void logConnect(ClientConnection clientConnection)
AccessLogPublisher
The default implementation is to not log anything.
logConnect
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
clientConnection
- The client connection that has been established.public void logDeleteRequest(RequestContext context, DeleteRequest request)
AccessLogPublisher
The default implementation is to not log anything.
logDeleteRequest
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original delete requestpublic void logDeleteResult(RequestContext context, DeleteRequest request, Result result)
AccessLogPublisher
The default implementation is to not log anything.
logDeleteResult
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original delete requestresult
- the result to logpublic void logDisconnect(ClientConnection clientConnection, DisconnectReason disconnectReason, LocalizableMessage message)
AccessLogPublisher
The default implementation is to not log anything.
logDisconnect
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
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.public void logExtendedRequest(RequestContext context, ExtendedRequest<?> request)
AccessLogPublisher
The default implementation is to not log anything.
logExtendedRequest
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original extended requestpublic void logExtendedResult(RequestContext context, ExtendedRequest<?> request, Result result)
AccessLogPublisher
The default implementation is to not log anything.
logExtendedResult
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original extended requestresult
- the result to logpublic void logInvalidRequest(RequestContext context, InvalidRequest request)
AccessLogPublisher
logInvalidRequest
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the context for this requestrequest
- the description of the invalid request to logpublic void logInvalidResult(RequestContext context, InvalidRequest request, Result result)
AccessLogPublisher
The default implementation is to not log anything.
logInvalidResult
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original description of the invalid requestresult
- the result to logpublic void logModifyDnRequest(RequestContext context, ModifyDnRequest request)
AccessLogPublisher
The default implementation is to not log anything.
logModifyDnRequest
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original modifyDN requestpublic void logModifyDnResult(RequestContext context, ModifyDnRequest request, Result result)
AccessLogPublisher
The default implementation is to not log anything.
logModifyDnResult
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original modifyDN requestresult
- the result to logpublic void logModifyRequest(RequestContext context, ModifyRequest request)
AccessLogPublisher
The default implementation is to not log anything.
logModifyRequest
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original modify requestpublic void logModifyResult(RequestContext context, ModifyRequest request, Result result)
AccessLogPublisher
The default implementation is to not log anything.
logModifyResult
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original modify requestresult
- the result to logpublic void logSearchRequest(RequestContext context, SearchRequest request)
AccessLogPublisher
The default implementation is to not log anything.
logSearchRequest
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original search requestpublic void logSearchResult(RequestContext context, SearchRequest request, Result result)
AccessLogPublisher
The default implementation is to not log anything.
logSearchResult
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the original search requestresult
- the result to logpublic void logUnbind(RequestContext context, UnbindRequest request)
AccessLogPublisher
The default implementation is to not log anything.
logUnbind
in class AccessLogPublisher<FileBasedAccessLogPublisherCfg>
context
- the logging context for the requestrequest
- the unbind request to logprotected void close0()
protected String getTransactionId(RequestContext context)
public final void close()
LogPublisher
public final Dn getDN()
LogPublisher
protected void buildFilters(boolean suppressInternal)
suppressInternal
- true
if internal operations should be suppressed.protected final void initializeFilters(T config) throws ConfigException
config
- The access publisher configuration that contains the information to use to initialize this access
publisher.ConfigException
- If an unrecoverable problem arises in the process of performing the initialization as a result of the
server configuration.protected final boolean isConnectLoggable(ClientConnection c)
true
if the provided client connect should be logged.c
- The client connection.true
if the provided client connect should be logged.protected final boolean isDisconnectLoggable(ClientConnection c)
true
if the provided client disconnect should be logged.c
- The client connection.true
if the provided client disconnect should be logged.protected final boolean isFilterConfigurationAcceptable(T config, List<LocalizableMessage> unacceptableReasons)
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.true
if the provided configuration is acceptable for this access log publisher, or false
if not.protected final boolean isRequestLoggable(RequestContext context, Request request)
true
if the provided request should be logged.context
- the log contextrequest
- the request to logtrue
if the provided request should be logged.protected final boolean isResponseLoggable(RequestContext context, Request request, Response response)
true
if the provided response should be logged.context
- the log contextrequest
- the request to which the response correspondsresponse
- the response to logtrue
if the provided response should be logged.Copyright 2010-2022 ForgeRock AS.