Class AuditManagerImpl
- java.lang.Object
-
- org.jivesoftware.openfire.container.BasicModule
-
- org.jivesoftware.openfire.audit.spi.AuditManagerImpl
-
- All Implemented Interfaces:
AuditManager,Module,PropertyEventListener
public class AuditManagerImpl extends BasicModule implements AuditManager, PropertyEventListener
Implementation of the AuditManager interface.
-
-
Field Summary
-
Fields inherited from interface org.jivesoftware.openfire.audit.AuditManager
PRESENCE_AVAILABLE_AVAILABLE, PRESENCE_AVAILABLE_UNAVAILABLE, PRESENCE_UNAVAILABLE_AVAILABLE, PRESENCE_UNAVAILABLE_UNAVAILABLE
-
-
Constructor Summary
Constructors Constructor Description AuditManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddXPath(String xpathExpression)Adds an XPath expression to be used for filtering packets to be audited.AuditorgetAuditor()Factory method for creating auditors that are configured by this audit manager.Collection<String>getIgnoreList()Returns the list of usernames that won't be audited.StringgetLogDir()Returns the absolute path to the directory where the audit log files will be saved.DurationgetLogTimeout()Returns the time between successive executions of the task that will save the queued audited packets to a permanent store.intgetMaxFileSize()Obtain the maximum size of audit log files in megabytes.intgetMaxTotalSize()Returns the maximum size in megabytes that all audit log files may have.DurationgetRetention()Returns the maximum duration to keep audit information.Iterator<String>getXPathFilters()Obtain an iterator over the XPath expressions (Strings) currently registered with the audit manager.voidinitialize(XMPPServer server)Initializes the basic module.booleanisAuditIQ()Determines if the server will audit all iq packets.booleanisAuditMessage()Determines if the server will audit all message packets.booleanisAuditPresence()Determines if the server will audit all presence packets.booleanisAuditXPath()Determines if the server will audit packets using XPath expressions.booleanisEnabled()Determines if auditing is enabled at all.voidpropertyDeleted(String property, Map<String,Object> params)A property was deleted.voidpropertySet(String property, Map<String,Object> params)A property was set.voidremoveXPath(String xpathExpression)Removes the XPath expression from the set being used for filtering packets to be audited.voidsetAuditIQ(boolean auditIQ)Enables or disables the server auditing of all iq packets.voidsetAuditMessage(boolean auditMessage)Enables or disables the server auditing of all message packets.voidsetAuditPresence(boolean auditPresence)Enables or disables the server auditing of all presence packets.voidsetAuditXPath(boolean auditXPath)Enables/disables server auditing of packets using XPath expressions.voidsetEnabled(boolean enabled)Turns auditing off or on for the manager as a whole.voidsetIgnoreList(Collection<String> usernames)Sets the list of usernames that won't be audited.voidsetLogDir(String logDir)Sets the absolute path to the directory where the audit log files will be saved.voidsetLogTimeout(Duration logTimeout)Sets the time between successive executions of the task that will save the queued audited packets to a permanent store.voidsetMaxFileSize(int size)Set the maximum size of audit log files in megabytes.voidsetMaxTotalSize(int size)Sets the maximum size in megabytes that all audit log files may have.voidsetRetention(Duration duration)Set the duration to keep audit information.voidstop()Stops the basic module.voidxmlPropertyDeleted(String property, Map<String,Object> params)An XML property was deleted.voidxmlPropertySet(String property, Map<String,Object> params)An XML property was set.-
Methods inherited from class org.jivesoftware.openfire.container.BasicModule
destroy, getName, start
-
-
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
Description copied from interface:AuditManagerDetermines if auditing is enabled at all.- Specified by:
isEnabledin interfaceAuditManager- Returns:
- true if auditing is enabled, false indicates no auditing will occur
-
setEnabled
public void setEnabled(boolean enabled)
Description copied from interface:AuditManagerTurns auditing off or on for the manager as a whole.- Specified by:
setEnabledin interfaceAuditManager- Parameters:
enabled- true if auditing is enabled, false indicates no auditing will occur.
-
getAuditor
public Auditor getAuditor()
Description copied from interface:AuditManagerFactory method for creating auditors that are configured by this audit manager.- Specified by:
getAuditorin interfaceAuditManager- Returns:
- a new auditor that will obey the configuration of the audit manager.
-
getMaxTotalSize
public int getMaxTotalSize()
Description copied from interface:AuditManagerReturns the maximum size in megabytes that all audit log files may have. When the limit is reached oldest audit log files will be removed until total size is under the limit.- Specified by:
getMaxTotalSizein interfaceAuditManager- Returns:
- the maximum size of all audit logs in megabytes.
-
setMaxTotalSize
public void setMaxTotalSize(int size)
Description copied from interface:AuditManagerSets the maximum size in megabytes that all audit log files may have. When the limit is reached oldest audit log files will be removed until total size is under the limit.- Specified by:
setMaxTotalSizein interfaceAuditManager- Parameters:
size- the maximum size of all audit logs in megabytes.
-
getMaxFileSize
public int getMaxFileSize()
Description copied from interface:AuditManagerObtain the maximum size of audit log files in megabytes. Logs that exceed the max size will be rolled over to another file.- Specified by:
getMaxFileSizein interfaceAuditManager- Returns:
- the maximum size of an audit log in megabytes.
-
setMaxFileSize
public void setMaxFileSize(int size)
Description copied from interface:AuditManagerSet the maximum size of audit log files in megabytes.- Specified by:
setMaxFileSizein interfaceAuditManager- Parameters:
size- the maximum audit log file size in megabytes.
-
getRetention
public Duration getRetention()
Description copied from interface:AuditManagerReturns the maximum duration to keep audit information. Once the limit has been reached audit files that contain information that exceed the limit will be deleted.- Specified by:
getRetentionin interfaceAuditManager- Returns:
- the maximum duration to keep audit information, negative value for unlimited.
-
setRetention
public void setRetention(Duration duration)
Description copied from interface:AuditManagerSet the duration to keep audit information. Once the limit has been reached audit files that contain information that exceed the limit will be deleted.- Specified by:
setRetentionin interfaceAuditManager- Parameters:
duration- the maximum duration to keep audit information or a negative value for unlimited
-
getLogTimeout
public Duration getLogTimeout()
Description copied from interface:AuditManagerReturns the time between successive executions of the task that will save the queued audited packets to a permanent store.- Specified by:
getLogTimeoutin interfaceAuditManager- Returns:
- the time between successive executions of the task that will save the queued audited packets to a permanent store.
-
setLogTimeout
public void setLogTimeout(Duration logTimeout)
Description copied from interface:AuditManagerSets the time between successive executions of the task that will save the queued audited packets to a permanent store.- Specified by:
setLogTimeoutin interfaceAuditManager- Parameters:
logTimeout- the time between successive executions of the task that will save the queued audited packets to a permanent store.
-
getLogDir
public String getLogDir()
Description copied from interface:AuditManagerReturns the absolute path to the directory where the audit log files will be saved.- Specified by:
getLogDirin interfaceAuditManager- Returns:
- the absolute path to the directory where the audit log files will be saved.
-
setLogDir
public void setLogDir(String logDir)
Description copied from interface:AuditManagerSets the absolute path to the directory where the audit log files will be saved.- Specified by:
setLogDirin interfaceAuditManager- Parameters:
logDir- the absolute path to the directory where the audit log files will be saved.
-
isAuditMessage
public boolean isAuditMessage()
Description copied from interface:AuditManagerDetermines if the server will audit all message packets.
This is a speed optimization and convenience for logging all message packets rather than using an XPath expression.
- Specified by:
isAuditMessagein interfaceAuditManager- Returns:
- true if all messages are to be audited
-
setAuditMessage
public void setAuditMessage(boolean auditMessage)
Description copied from interface:AuditManagerEnables or disables the server auditing of all message packets.
This is a speed optimization and convenience for logging all message packets rather than using an XPath expression.
- Specified by:
setAuditMessagein interfaceAuditManager- Parameters:
auditMessage- True if all messages are to be audited
-
isAuditPresence
public boolean isAuditPresence()
Description copied from interface:AuditManagerDetermines if the server will audit all presence packets.
This is a speed optimization and convenience for logging all presence packets rather than using an XPath expression.
- Specified by:
isAuditPresencein interfaceAuditManager- Returns:
- True if all presence are to be audited
-
setAuditPresence
public void setAuditPresence(boolean auditPresence)
Description copied from interface:AuditManagerEnables or disables the server auditing of all presence packets.
This is a speed optimization and convenience for logging all presence packets rather than using an XPath expression.
- Specified by:
setAuditPresencein interfaceAuditManager- Parameters:
auditPresence- True if all presence are to be audited
-
isAuditIQ
public boolean isAuditIQ()
Description copied from interface:AuditManagerDetermines if the server will audit all iq packets.
This is a speed optimization and convenience for logging all iq packets rather than using an XPath expression.
- Specified by:
isAuditIQin interfaceAuditManager- Returns:
- True if all iq are to be audited
-
setAuditIQ
public void setAuditIQ(boolean auditIQ)
Description copied from interface:AuditManagerEnables or disables the server auditing of all iq packets. This is a speed optimization and convenience for logging all iq packets rather than using an XPath expression.- Specified by:
setAuditIQin interfaceAuditManager- Parameters:
auditIQ- true if all iq are to be audited.
-
isAuditXPath
public boolean isAuditXPath()
Description copied from interface:AuditManagerDetermines if the server will audit packets using XPath expressions. XPath expressions provide a lot of power in specifying what is logged. However, it is much more compute intensive than other techniques and requires all packets be transformed into DOM objects (which can be computationally expensive).- Specified by:
isAuditXPathin interfaceAuditManager- Returns:
- true if XPath expressions should be audited.
-
setAuditXPath
public void setAuditXPath(boolean auditXPath)
Description copied from interface:AuditManagerEnables/disables server auditing of packets using XPath expressions.
XPath expressions provide a lot of power in specifying what is logged. However, it is much more compute intensive than other techniques and requires all packets be transformed into DOM objects (which can be computationally expensive).
- Specified by:
setAuditXPathin interfaceAuditManager- Parameters:
auditXPath- true if XPath expressions should be audited
-
addXPath
public void addXPath(String xpathExpression)
Description copied from interface:AuditManagerAdds an XPath expression to be used for filtering packets to be audited. XPath expressions aren't evaluated or used for filtering unless isAuditXPath() returns true.- Specified by:
addXPathin interfaceAuditManager- Parameters:
xpathExpression- the xpath expression to add to the list of auditing filters.
-
removeXPath
public void removeXPath(String xpathExpression)
Description copied from interface:AuditManagerRemoves the XPath expression from the set being used for filtering packets to be audited.
XPath expressions aren't evaluated or used for filtering unless isAuditXPath() returns true.
- Specified by:
removeXPathin interfaceAuditManager- Parameters:
xpathExpression- The xpath expression to remove from the list of auditing filters
-
getXPathFilters
public Iterator<String> getXPathFilters()
Description copied from interface:AuditManagerObtain an iterator over the XPath expressions (Strings) currently registered with the audit manager.
XPath expressions aren't evaluated or used for filtering unless isAuditXPath() returns true.
- Specified by:
getXPathFiltersin interfaceAuditManager- Returns:
- An iterator of all XPath expressions the audit manager is using
-
setIgnoreList
public void setIgnoreList(Collection<String> usernames)
Description copied from interface:AuditManagerSets the list of usernames that won't be audited. Packets sent or received by any of these users will be ignored by the auditor.- Specified by:
setIgnoreListin interfaceAuditManager- Parameters:
usernames- the list of usernames that won't be audited.
-
getIgnoreList
public Collection<String> getIgnoreList()
Description copied from interface:AuditManagerReturns the list of usernames that won't be audited. Packets sent or received by any of these users will be ignored by the auditor.- Specified by:
getIgnoreListin interfaceAuditManager- Returns:
- the list of usernames that won't be audited.
-
initialize
public void initialize(XMPPServer server)
Description copied from class:BasicModuleInitializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
- Specified by:
initializein interfaceModule- Overrides:
initializein classBasicModule- Parameters:
server- the server hosting this module.
-
stop
public void stop()
Description copied from class:BasicModuleStops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
- Specified by:
stopin interfaceModule- Overrides:
stopin classBasicModule
-
propertySet
public void propertySet(String property, Map<String,Object> params)
Description copied from interface:PropertyEventListenerA property was set. The parameter mapparamswill contain the the value of the property under the keyvalue.- Specified by:
propertySetin interfacePropertyEventListener- Parameters:
property- the name of the property.params- event parameters.
-
propertyDeleted
public void propertyDeleted(String property, Map<String,Object> params)
Description copied from interface:PropertyEventListenerA property was deleted.- Specified by:
propertyDeletedin interfacePropertyEventListener- Parameters:
property- the name of the property deleted.params- event parameters.
-
xmlPropertySet
public void xmlPropertySet(String property, Map<String,Object> params)
Description copied from interface:PropertyEventListenerAn XML property was set. The parameter mapparamswill contain the the value of the property under the keyvalue.- Specified by:
xmlPropertySetin interfacePropertyEventListener- Parameters:
property- the name of the property.params- event parameters.
-
xmlPropertyDeleted
public void xmlPropertyDeleted(String property, Map<String,Object> params)
Description copied from interface:PropertyEventListenerAn XML property was deleted.- Specified by:
xmlPropertyDeletedin interfacePropertyEventListener- Parameters:
property- the name of the property.params- event parameters.
-
-