Interface AuditManager
-
- All Known Implementing Classes:
AuditManagerImpl
public interface AuditManager
Manages and directs server message auditing behavior. Turning on all auditing options can produce copious amounts of data and significantly slow the server as it saves the data to persistent storage.Auditing currently saves audit data to a raw XML file which can later be processed and mined for information.
- Author:
- Iain Shigeoka
-
-
Field Summary
Fields Modifier and Type Field Description static int
PRESENCE_AVAILABLE_AVAILABLE
static int
PRESENCE_AVAILABLE_UNAVAILABLE
static int
PRESENCE_UNAVAILABLE_AVAILABLE
static int
PRESENCE_UNAVAILABLE_UNAVAILABLE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addXPath(String xpathExpression)
Adds an XPath expression to be used for filtering packets to be audited.Auditor
getAuditor()
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.String
getLogDir()
Returns the absolute path to the directory where the audit log files will be saved.Duration
getLogTimeout()
Returns the time between successive executions of the task that will save the queued audited packets to a permanent store.int
getMaxFileSize()
Obtain the maximum size of audit log files in megabytes.int
getMaxTotalSize()
Returns the maximum size in megabytes that all audit log files may have.Duration
getRetention()
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.boolean
isAuditIQ()
Determines if the server will audit all iq packets.boolean
isAuditMessage()
Determines if the server will audit all message packets.boolean
isAuditPresence()
Determines if the server will audit all presence packets.boolean
isAuditXPath()
Determines if the server will audit packets using XPath expressions.boolean
isEnabled()
Determines if auditing is enabled at all.void
removeXPath(String xpathExpression)
Removes the XPath expression from the set being used for filtering packets to be audited.void
setAuditIQ(boolean enabled)
Enables or disables the server auditing of all iq packets.void
setAuditMessage(boolean enabled)
Enables or disables the server auditing of all message packets.void
setAuditPresence(boolean enabled)
Enables or disables the server auditing of all presence packets.void
setAuditXPath(boolean enabled)
Enables/disables server auditing of packets using XPath expressions.void
setEnabled(boolean enabled)
Turns auditing off or on for the manager as a whole.void
setIgnoreList(Collection<String> usernames)
Sets the list of usernames that won't be audited.void
setLogDir(String logDir)
Sets the absolute path to the directory where the audit log files will be saved.void
setLogTimeout(Duration logTimeout)
Sets the time between successive executions of the task that will save the queued audited packets to a permanent store.void
setMaxFileSize(int size)
Set the maximum size of audit log files in megabytes.void
setMaxTotalSize(int size)
Sets the maximum size in megabytes that all audit log files may have.void
setRetention(Duration duration)
Set the duration to keep audit information.
-
-
-
Field Detail
-
PRESENCE_UNAVAILABLE_AVAILABLE
static final int PRESENCE_UNAVAILABLE_AVAILABLE
- See Also:
- Constant Field Values
-
PRESENCE_AVAILABLE_AVAILABLE
static final int PRESENCE_AVAILABLE_AVAILABLE
- See Also:
- Constant Field Values
-
PRESENCE_AVAILABLE_UNAVAILABLE
static final int PRESENCE_AVAILABLE_UNAVAILABLE
- See Also:
- Constant Field Values
-
PRESENCE_UNAVAILABLE_UNAVAILABLE
static final int PRESENCE_UNAVAILABLE_UNAVAILABLE
- See Also:
- Constant Field Values
-
-
Method Detail
-
isEnabled
boolean isEnabled()
Determines if auditing is enabled at all.- Returns:
- true if auditing is enabled, false indicates no auditing will occur
-
setEnabled
void setEnabled(boolean enabled)
Turns auditing off or on for the manager as a whole.- Parameters:
enabled
- true if auditing is enabled, false indicates no auditing will occur.
-
getAuditor
Auditor getAuditor()
Factory method for creating auditors that are configured by this audit manager.- Returns:
- a new auditor that will obey the configuration of the audit manager.
-
getMaxTotalSize
int getMaxTotalSize()
Returns 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.- Returns:
- the maximum size of all audit logs in megabytes.
-
setMaxTotalSize
void setMaxTotalSize(int size)
Sets 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.- Parameters:
size
- the maximum size of all audit logs in megabytes.
-
getMaxFileSize
int getMaxFileSize()
Obtain the maximum size of audit log files in megabytes. Logs that exceed the max size will be rolled over to another file.- Returns:
- the maximum size of an audit log in megabytes.
-
setMaxFileSize
void setMaxFileSize(int size)
Set the maximum size of audit log files in megabytes.- Parameters:
size
- the maximum audit log file size in megabytes.
-
getRetention
Duration getRetention()
Returns 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.- Returns:
- the maximum duration to keep audit information, negative value for unlimited.
-
setRetention
void setRetention(Duration duration)
Set the duration to keep audit information. Once the limit has been reached audit files that contain information that exceed the limit will be deleted.- Parameters:
duration
- the maximum duration to keep audit information or a negative value for unlimited
-
getLogTimeout
Duration getLogTimeout()
Returns the time between successive executions of the task that will save the queued audited packets to a permanent store.- Returns:
- the time between successive executions of the task that will save the queued audited packets to a permanent store.
-
setLogTimeout
void setLogTimeout(Duration logTimeout)
Sets the time between successive executions of the task that will save the queued audited packets to a permanent store.- Parameters:
logTimeout
- the time between successive executions of the task that will save the queued audited packets to a permanent store.
-
getLogDir
String getLogDir()
Returns the absolute path to the directory where the audit log files will be saved.- Returns:
- the absolute path to the directory where the audit log files will be saved.
-
setLogDir
void setLogDir(String logDir)
Sets the absolute path to the directory where the audit log files will be saved.- Parameters:
logDir
- the absolute path to the directory where the audit log files will be saved.
-
isAuditMessage
boolean isAuditMessage()
Determines 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.
- Returns:
- true if all messages are to be audited
-
setAuditMessage
void setAuditMessage(boolean enabled)
Enables 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.
- Parameters:
enabled
- True if all messages are to be audited
-
isAuditPresence
boolean isAuditPresence()
Determines 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.
- Returns:
- True if all presence are to be audited
-
setAuditPresence
void setAuditPresence(boolean enabled)
Enables 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.
- Parameters:
enabled
- True if all presence are to be audited
-
isAuditIQ
boolean isAuditIQ()
Determines 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.
- Returns:
- True if all iq are to be audited
-
setAuditIQ
void setAuditIQ(boolean enabled)
Enables 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.- Parameters:
enabled
- true if all iq are to be audited.
-
isAuditXPath
boolean isAuditXPath()
Determines 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).- Returns:
- true if XPath expressions should be audited.
-
setAuditXPath
void setAuditXPath(boolean enabled)
Enables/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).
- Parameters:
enabled
- true if XPath expressions should be audited
-
addXPath
void addXPath(String xpathExpression)
Adds 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.- Parameters:
xpathExpression
- the xpath expression to add to the list of auditing filters.
-
removeXPath
void removeXPath(String xpathExpression)
Removes 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.
- Parameters:
xpathExpression
- The xpath expression to remove from the list of auditing filters
-
getXPathFilters
Iterator<String> getXPathFilters()
Obtain 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.
- Returns:
- An iterator of all XPath expressions the audit manager is using
-
setIgnoreList
void setIgnoreList(Collection<String> usernames)
Sets the list of usernames that won't be audited. Packets sent or received by any of these users will be ignored by the auditor.- Parameters:
usernames
- the list of usernames that won't be audited.
-
getIgnoreList
Collection<String> getIgnoreList()
Returns the list of usernames that won't be audited. Packets sent or received by any of these users will be ignored by the auditor.- Returns:
- the list of usernames that won't be audited.
-
-