public class ManagedAuditLoggerImpl extends Object implements ManagedAuditLogger, ManagedAuditLogger.AuditLogHandlerUpdater
ManagedAuditLogger.AuditLogHandlerUpdater
AuditLogger.Status
NO_OP_LOGGER
Constructor and Description |
---|
ManagedAuditLoggerImpl(String asVersion,
boolean server) |
Modifier and Type | Method and Description |
---|---|
void |
addFormatter(AuditLogItemFormatter formatter)
Add a formatter
|
void |
addHandler(org.jboss.as.controller.audit.AuditLogHandler handler)
Adds a new handler, this handler will be used when logging the current operation
|
void |
addHandlerReference(PathAddress referenceAddress)
Add a handler reference.
|
void |
applyChanges()
Apply the changes.
|
void |
bootDone()
Callback for the controller to call when the controller has been booted
|
ManagedAuditLoggerImpl |
createNewConfiguration(boolean manualCommit)
Create another audit logger configuration, e.g.
|
boolean |
getHandlerDisabledDueToFailure(String name)
Get whether a handler was disabled due to failures
|
int |
getHandlerFailureCount(String name)
Get the current failure count of a handler
|
JsonAuditLogItemFormatter |
getJsonFormatter(String name)
Gets a formatter by its name
|
AuditLogger.Status |
getLoggerStatus()
Gets the status of the audit logger
|
ManagedAuditLogger.AuditLogHandlerUpdater |
getUpdater()
Gets the handler updater used to schedule updates to the handlers
|
boolean |
isLogBoot()
Get whether this audit logger logs operations on boot
|
boolean |
isLogReadOnly()
Get whether this audit logger logs read-only operations
|
List<org.jboss.dmr.ModelNode> |
listLastEntries(String name)
Gets the last log entries
|
void |
log(boolean readOnly,
OperationContext.ResultAction resultAction,
String userId,
String domainUUID,
AccessMechanism accessMechanism,
InetAddress remoteAddress,
Resource resultantModel,
List<org.jboss.dmr.ModelNode> operations) |
void |
logJmxMethodAccess(boolean readOnly,
String userId,
String domainUUID,
AccessMechanism accessMechanism,
InetAddress remoteAddress,
String methodName,
String[] methodSignature,
Object[] methodParams,
Throwable error) |
void |
recycleHandler(String name)
Recycles a handler.
|
void |
removeFormatter(String name)
Remove a formatter
|
void |
removeHandler(String name)
Remove a handler.
|
void |
removeHandlerReference(PathAddress referenceAddress)
Add a handler reference.
|
void |
rollbackChanges()
Roll back changes made as part of the current operation.
|
void |
setLogBoot(boolean logBoot)
Set whether to log operations on boot
|
void |
setLoggerStatus(AuditLogger.Status newStatus)
Sets the status of the audit logger
|
void |
setLogReadOnly(boolean logReadOnly)
Set whether to log read-only operations
|
void |
startBoot()
Callback for the controller to call before the controller is booted
|
void |
updateHandler(org.jboss.as.controller.audit.AuditLogHandler handler)
Update a handler.
|
void |
updateHandlerFormatter(String name,
String formatterName)
Update the handler formatter.
|
void |
updateHandlerMaxFailureCount(String name,
int count)
Update the handler max failure count.
|
void |
updateInMemoryHandlerMaxHistory(String name,
int maxHistory)
Update the handler history size.
|
void |
updateSyslogHandlerAppName(String name,
String appName)
Update the handler app-name.
|
void |
updateSyslogHandlerFacility(String name,
SyslogAuditLogHandler.Facility facility)
Update the syslog handler facility.
|
void |
updateSyslogHandlerReconnectTimeout(String name,
int reconnectTimeout)
Update the handler reconnect timeout.
|
public ManagedAuditLoggerImpl(String asVersion, boolean server)
public void log(boolean readOnly, OperationContext.ResultAction resultAction, String userId, String domainUUID, AccessMechanism accessMechanism, InetAddress remoteAddress, Resource resultantModel, List<org.jboss.dmr.ModelNode> operations)
log
in interface AuditLogger
public void logJmxMethodAccess(boolean readOnly, String userId, String domainUUID, AccessMechanism accessMechanism, InetAddress remoteAddress, String methodName, String[] methodSignature, Object[] methodParams, Throwable error)
logJmxMethodAccess
in interface AuditLogger
public ManagedAuditLoggerImpl createNewConfiguration(boolean manualCommit)
ManagedAuditLogger
createNewConfiguration
in interface ManagedAuditLogger
manualCommit
- if true
the caller is responsible for applying the changes themselves, if false
the changes will be committed after the next log records has been writtenpublic boolean isLogReadOnly()
ManagedAuditLogger
isLogReadOnly
in interface ManagedAuditLogger
public void setLogReadOnly(boolean logReadOnly)
ManagedAuditLogger
setLogReadOnly
in interface ManagedAuditLogger
logReadOnly
- wheter to log read-only operationspublic boolean isLogBoot()
ManagedAuditLogger
isLogBoot
in interface ManagedAuditLogger
public void setLogBoot(boolean logBoot)
ManagedAuditLogger
setLogBoot
in interface ManagedAuditLogger
logBoot
- whether to log operations on bootpublic AuditLogger.Status getLoggerStatus()
ManagedAuditLogger
getLoggerStatus
in interface ManagedAuditLogger
public void recycleHandler(String name)
ManagedAuditLogger
recycleHandler
in interface ManagedAuditLogger
name
- the name of the handlerpublic void setLoggerStatus(AuditLogger.Status newStatus)
ManagedAuditLogger
setLoggerStatus
in interface ManagedAuditLogger
newStatus
- the statuspublic ManagedAuditLogger.AuditLogHandlerUpdater getUpdater()
ManagedAuditLogger
getUpdater
in interface ManagedAuditLogger
public void addHandler(org.jboss.as.controller.audit.AuditLogHandler handler)
ManagedAuditLogger.AuditLogHandlerUpdater
addHandler
in interface ManagedAuditLogger.AuditLogHandlerUpdater
handler
- the handlerpublic void updateHandler(org.jboss.as.controller.audit.AuditLogHandler handler)
ManagedAuditLogger.AuditLogHandlerUpdater
updateHandler
in interface ManagedAuditLogger.AuditLogHandlerUpdater
handler
- the updated handlerpublic void removeHandler(String name)
ManagedAuditLogger.AuditLogHandlerUpdater
removeHandler
in interface ManagedAuditLogger.AuditLogHandlerUpdater
name
- the name of the handler to be removedpublic void addHandlerReference(PathAddress referenceAddress)
ManagedAuditLogger.AuditLogHandlerUpdater
addHandlerReference
in interface ManagedAuditLogger.AuditLogHandlerUpdater
referenceAddress
- the address of the handler reference (the value of the last element is the name of
the referenced handler)public void removeHandlerReference(PathAddress referenceAddress)
ManagedAuditLogger.AuditLogHandlerUpdater
removeHandlerReference
in interface ManagedAuditLogger.AuditLogHandlerUpdater
referenceAddress
- the address of the handler reference (the value of the last element is the name of
the referenced handler)public void rollbackChanges()
ManagedAuditLogger.AuditLogHandlerUpdater
rollbackChanges
in interface ManagedAuditLogger.AuditLogHandlerUpdater
public void applyChanges()
ManagedAuditLogger.AuditLogHandlerUpdater
applyChanges
in interface ManagedAuditLogger.AuditLogHandlerUpdater
public void removeFormatter(String name)
ManagedAuditLogger
removeFormatter
in interface ManagedAuditLogger
name
- the formatter namepublic void addFormatter(AuditLogItemFormatter formatter)
ManagedAuditLogger
addFormatter
in interface ManagedAuditLogger
formatter
- the formatterpublic void updateHandlerFormatter(String name, String formatterName)
ManagedAuditLogger
updateHandlerFormatter
in interface ManagedAuditLogger
name
- the name of the handlerformatterName
- the name of the formatterpublic void updateHandlerMaxFailureCount(String name, int count)
ManagedAuditLogger
updateHandlerMaxFailureCount
in interface ManagedAuditLogger
name
- the name of the handlercount
- the max failure countpublic int getHandlerFailureCount(String name)
ManagedAuditLogger
getHandlerFailureCount
in interface ManagedAuditLogger
name
- the name of the handlerpublic void updateSyslogHandlerFacility(String name, SyslogAuditLogHandler.Facility facility)
ManagedAuditLogger
updateSyslogHandlerFacility
in interface ManagedAuditLogger
name
- the name of the syslog handlerfacility
- the facilitypublic void updateSyslogHandlerAppName(String name, String appName)
ManagedAuditLogger
updateSyslogHandlerAppName
in interface ManagedAuditLogger
name
- the name of the handlerappName
- the app namepublic void updateSyslogHandlerReconnectTimeout(String name, int reconnectTimeout)
ManagedAuditLogger
updateSyslogHandlerReconnectTimeout
in interface ManagedAuditLogger
name
- the name of the handlerreconnectTimeout
- the app namepublic boolean getHandlerDisabledDueToFailure(String name)
ManagedAuditLogger
getHandlerDisabledDueToFailure
in interface ManagedAuditLogger
name
- the name of the handlerpublic JsonAuditLogItemFormatter getJsonFormatter(String name)
ManagedAuditLogger
getJsonFormatter
in interface ManagedAuditLogger
name
- the name of the formatterpublic List<org.jboss.dmr.ModelNode> listLastEntries(String name)
ManagedAuditLogger
listLastEntries
in interface ManagedAuditLogger
name
- the name of the handlerpublic void updateInMemoryHandlerMaxHistory(String name, int maxHistory)
ManagedAuditLogger
updateInMemoryHandlerMaxHistory
in interface ManagedAuditLogger
name
- the name of the handlermaxHistory
- the history size of the handlerpublic void bootDone()
ManagedAuditLogger
bootDone
in interface ManagedAuditLogger
public void startBoot()
ManagedAuditLogger
startBoot
in interface ManagedAuditLogger
Copyright © 2023 JBoss by Red Hat. All rights reserved.