@Extensible @DirectoryServerExtension @DirectoryProxyServerExtension(appliesToLocalContent=true, appliesToRemoteContent=true) @MetricsEngineExtension @BrokerExtension @ThreadSafety(level=INTERFACE_THREADSAFE) public abstract class HTTPTraceLogger extends java.lang.Object implements UnboundIDExtension, Reconfigurable<HTTPTraceLoggerConfig>, ExampleUsageProvider
dsconfig create-log-publisher \ --publisher-name "{logger-name}" \ --type third-party-http-trace \ --set enabled:true \ --set "extension-class:{class-name}" \ --set "extension-argument:{name=value}"where "{logger-name}" is the name to use for the trace logger instance, "{class-name}" is the fully-qualified name of the Java class that extends
com.unboundid.directory.sdk.common.api.TraceLogger
,
and "{name=value}" represents name-value pairs for any arguments to
provide to the logger. If multiple arguments should be provided to the
logger, then the "--set extension-argument:{name=value}
"
option should be provided multiple times.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTRIBUTE_KEY_CREATE_REQUEST_RESOURCE
The servlet request key that will be used to hold the request resource
for SCIM create requests (messageCategory = "SCIM",
messageType = "REQUEST", keyValues["op"] = "CREATE").
|
static java.lang.String |
ATTRIBUTE_KEY_CREATE_RESULT_RESOURCE
The servlet request key that will be used to hold the request resource
for SCIM create requests (messageCategory = "SCIM", messageType = "RESULT",
keyValues["op"] = "CREATE").
|
static java.lang.String |
ATTRIBUTE_KEY_MODIFY_RESULT_RESOURCE
The servlet request key that will be used to hold the result resource
for SCIM modify requests (messageCategory = "SCIM", messageType = "RESULT",
keyValues["op"] = "MODIFY").
|
static java.lang.String |
ATTRIBUTE_KEY_PATCH_REQUEST_RESOURCE
The servlet request key that will be used to hold the request resource
for SCIM modify requests using PATCH (messageCategory = "SCIM",
messageType = "REQUEST", keyValues["op"] = "MODIFY").
|
static java.lang.String |
ATTRIBUTE_KEY_REPLACE_REQUEST_RESOURCE
The servlet request key that will be used to hold the request resource
for SCIM modify requests using PUT (messageCategory = "SCIM",
messageType = "REQUEST", keyValues["op"] = "MODIFY").
|
Constructor and Description |
---|
HTTPTraceLogger()
Creates a new instance of this trace logger.
|
Modifier and Type | Method and Description |
---|---|
com.unboundid.ldap.sdk.ResultCode |
applyConfiguration(HTTPTraceLoggerConfig config,
com.unboundid.util.args.ArgumentParser parser,
java.util.List<java.lang.String> adminActionsRequired,
java.util.List<java.lang.String> messages)
Attempts to apply the configuration from the provided argument parser to
this extension.
|
void |
defineConfigArguments(com.unboundid.util.args.ArgumentParser parser)
Updates the provided argument parser to define any configuration arguments
which may be used by this extension.
|
void |
finalizeTraceLogger()
Performs any cleanup which may be necessary when this trace logger is to
be taken out of service.
|
java.util.Map<java.util.List<java.lang.String>,java.lang.String> |
getExamplesArgumentSets()
Retrieves a map containing examples of configurations that may be used for
this extension.
|
abstract java.lang.String[] |
getExtensionDescription()
Retrieves a human-readable description for this extension.
|
abstract java.lang.String |
getExtensionName()
Retrieves a human-readable name for this extension.
|
void |
initializeTraceLogger(ServerContext serverContext,
HTTPTraceLoggerConfig config,
com.unboundid.util.args.ArgumentParser parser)
Initializes this trace logger.
|
boolean |
isConfigurationAcceptable(HTTPTraceLoggerConfig config,
com.unboundid.util.args.ArgumentParser parser,
java.util.List<java.lang.String> unacceptableReasons)
Indicates whether the configuration represented by the provided argument
parser is acceptable for use by this extension.
|
abstract void |
log(javax.servlet.http.HttpServletRequest request,
java.lang.String messageCategory,
java.lang.String messageType,
java.lang.String message,
java.util.Map<java.lang.String,java.lang.String> keyValues)
Writes a message to the trace log using the provided information.
|
public static final java.lang.String ATTRIBUTE_KEY_CREATE_REQUEST_RESOURCE
com.unboundid.scim2.common.GenericScimResource
or
null
if this is not a SCIM create request.public static final java.lang.String ATTRIBUTE_KEY_CREATE_RESULT_RESOURCE
com.unboundid.scim2.common.GenericScimResource
or null
if this is not a SCIM create result.public static final java.lang.String ATTRIBUTE_KEY_REPLACE_REQUEST_RESOURCE
com.unboundid.scim2.common.GenericScimResource
or
null
if this is not a SCIM modify request using PUT.public static final java.lang.String ATTRIBUTE_KEY_PATCH_REQUEST_RESOURCE
com.unboundid.scim2.common.messages.PatchRequest
or
null
if this is not a SCIM modify request using PATCH.public static final java.lang.String ATTRIBUTE_KEY_MODIFY_RESULT_RESOURCE
com.unboundid.scim2.common.GenericScimResource
or null
if this is not a SCIM modify result.public HTTPTraceLogger()
initializeTraceLogger
method.public abstract java.lang.String getExtensionName()
getExtensionName
in interface UnboundIDExtension
public abstract java.lang.String[] getExtensionDescription()
getExtensionDescription
in interface UnboundIDExtension
null
or an empty array if no description should be available.public void defineConfigArguments(com.unboundid.util.args.ArgumentParser parser) throws com.unboundid.util.args.ArgumentException
defineConfigArguments
in interface Configurable
parser
- The argument parser to be updated with the configuration
arguments which may be used by this extension.com.unboundid.util.args.ArgumentException
- If a problem is encountered while updating the
provided argument parser.public void initializeTraceLogger(ServerContext serverContext, HTTPTraceLoggerConfig config, com.unboundid.util.args.ArgumentParser parser) throws com.unboundid.ldap.sdk.LDAPException
serverContext
- A handle to the server context for the server in
which this extension is running.config
- The general configuration for this trace logger.parser
- The argument parser which has been initialized from
the configuration for this trace logger.com.unboundid.ldap.sdk.LDAPException
- If a problem occurs while initializing this trace
logger.public boolean isConfigurationAcceptable(HTTPTraceLoggerConfig config, com.unboundid.util.args.ArgumentParser parser, java.util.List<java.lang.String> unacceptableReasons)
isConfigurationAcceptable
in interface Reconfigurable<HTTPTraceLoggerConfig>
config
- The general configuration for this extension.parser
- The argument parser that has been used to
parse the proposed configuration for this
extension.unacceptableReasons
- A list to which messages may be added to
provide additional information about why the
provided configuration is not acceptable.true
if the configuration in the provided argument parser
appears to be acceptable, or false
if not.public com.unboundid.ldap.sdk.ResultCode applyConfiguration(HTTPTraceLoggerConfig config, com.unboundid.util.args.ArgumentParser parser, java.util.List<java.lang.String> adminActionsRequired, java.util.List<java.lang.String> messages)
applyConfiguration
in interface Reconfigurable<HTTPTraceLoggerConfig>
config
- The general configuration for this extension.parser
- The argument parser that has been used to
parse the new configuration for this
extension.adminActionsRequired
- A list to which messages may be added to
provide additional information about any
additional administrative actions that may
be required to apply some of the
configuration changes.messages
- A list to which messages may be added to
provide additional information about the
processing performed by this method.SUCCESS
should be
used to indicate that all processing completed successfully. Any
other result will indicate that a problem occurred during
processing.public void finalizeTraceLogger()
public abstract void log(javax.servlet.http.HttpServletRequest request, java.lang.String messageCategory, java.lang.String messageType, java.lang.String message, java.util.Map<java.lang.String,java.lang.String> keyValues)
request
- An object with information about the request received from the
client.messageCategory
- The category of the logged message; never null
.
The set of categories corresponds with the Trace Log Publisher
configuration object properties ending in -message-type, without
the suffix in all upper case with no dashes, for example
'XACMLPOLICY'. See dsconfig or the Console for the set of defined
properties.messageType
- The type of message; never null
.
The set of type values corresponds with the Trace Log Publisher
-message-type property values, for example 'REQUEST' for category
'HTTP'.message
- The message to be logged; never null
.keyValues
- Keys and values that are to be logged with key=value. May be
empty, but never null
.public java.util.Map<java.util.List<java.lang.String>,java.lang.String> getExamplesArgumentSets()
getExamplesArgumentSets
in interface ExampleUsageProvider
null
or empty if there should
not be any example argument sets.