Class AuditManagerImpl

    • Constructor Detail

      • AuditManagerImpl

        public AuditManagerImpl()
    • Method Detail

      • isEnabled

        public boolean isEnabled()
        Description copied from interface: AuditManager
        Determines if auditing is enabled at all.
        Specified by:
        isEnabled in interface AuditManager
        Returns:
        true if auditing is enabled, false indicates no auditing will occur
      • setEnabled

        public void setEnabled​(boolean enabled)
        Description copied from interface: AuditManager
        Turns auditing off or on for the manager as a whole.
        Specified by:
        setEnabled in interface AuditManager
        Parameters:
        enabled - true if auditing is enabled, false indicates no auditing will occur.
      • getAuditor

        public Auditor getAuditor()
        Description copied from interface: AuditManager
        Factory method for creating auditors that are configured by this audit manager.
        Specified by:
        getAuditor in interface AuditManager
        Returns:
        a new auditor that will obey the configuration of the audit manager.
      • getMaxTotalSize

        public int getMaxTotalSize()
        Description copied from interface: AuditManager
        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.
        Specified by:
        getMaxTotalSize in interface AuditManager
        Returns:
        the maximum size of all audit logs in megabytes.
      • setMaxTotalSize

        public void setMaxTotalSize​(int size)
        Description copied from interface: AuditManager
        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.
        Specified by:
        setMaxTotalSize in interface AuditManager
        Parameters:
        size - the maximum size of all audit logs in megabytes.
      • getMaxFileSize

        public int getMaxFileSize()
        Description copied from interface: AuditManager
        Obtain the maximum size of audit log files in megabytes. Logs that exceed the max size will be rolled over to another file.
        Specified by:
        getMaxFileSize in interface AuditManager
        Returns:
        the maximum size of an audit log in megabytes.
      • setMaxFileSize

        public void setMaxFileSize​(int size)
        Description copied from interface: AuditManager
        Set the maximum size of audit log files in megabytes.
        Specified by:
        setMaxFileSize in interface AuditManager
        Parameters:
        size - the maximum audit log file size in megabytes.
      • getRetention

        public Duration getRetention()
        Description copied from interface: AuditManager
        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.
        Specified by:
        getRetention in interface AuditManager
        Returns:
        the maximum duration to keep audit information, negative value for unlimited.
      • setRetention

        public void setRetention​(Duration duration)
        Description copied from interface: AuditManager
        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.
        Specified by:
        setRetention in interface AuditManager
        Parameters:
        duration - the maximum duration to keep audit information or a negative value for unlimited
      • getLogTimeout

        public Duration getLogTimeout()
        Description copied from interface: AuditManager
        Returns the time between successive executions of the task that will save the queued audited packets to a permanent store.
        Specified by:
        getLogTimeout in interface AuditManager
        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: AuditManager
        Sets the time between successive executions of the task that will save the queued audited packets to a permanent store.
        Specified by:
        setLogTimeout in interface AuditManager
        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: AuditManager
        Returns the absolute path to the directory where the audit log files will be saved.
        Specified by:
        getLogDir in interface AuditManager
        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: AuditManager
        Sets the absolute path to the directory where the audit log files will be saved.
        Specified by:
        setLogDir in interface AuditManager
        Parameters:
        logDir - the absolute path to the directory where the audit log files will be saved.
      • isAuditMessage

        public boolean isAuditMessage()
        Description copied from interface: AuditManager

        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.

        Specified by:
        isAuditMessage in interface AuditManager
        Returns:
        true if all messages are to be audited
      • setAuditMessage

        public void setAuditMessage​(boolean auditMessage)
        Description copied from interface: AuditManager

        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.

        Specified by:
        setAuditMessage in interface AuditManager
        Parameters:
        auditMessage - True if all messages are to be audited
      • isAuditPresence

        public boolean isAuditPresence()
        Description copied from interface: AuditManager

        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.

        Specified by:
        isAuditPresence in interface AuditManager
        Returns:
        True if all presence are to be audited
      • setAuditPresence

        public void setAuditPresence​(boolean auditPresence)
        Description copied from interface: AuditManager

        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.

        Specified by:
        setAuditPresence in interface AuditManager
        Parameters:
        auditPresence - True if all presence are to be audited
      • isAuditIQ

        public boolean isAuditIQ()
        Description copied from interface: AuditManager

        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.

        Specified by:
        isAuditIQ in interface AuditManager
        Returns:
        True if all iq are to be audited
      • setAuditIQ

        public void setAuditIQ​(boolean auditIQ)
        Description copied from interface: AuditManager
        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.
        Specified by:
        setAuditIQ in interface AuditManager
        Parameters:
        auditIQ - true if all iq are to be audited.
      • isAuditXPath

        public boolean isAuditXPath()
        Description copied from interface: AuditManager
        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).
        Specified by:
        isAuditXPath in interface AuditManager
        Returns:
        true if XPath expressions should be audited.
      • setAuditXPath

        public void setAuditXPath​(boolean auditXPath)
        Description copied from interface: AuditManager

        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).

        Specified by:
        setAuditXPath in interface AuditManager
        Parameters:
        auditXPath - true if XPath expressions should be audited
      • addXPath

        public void addXPath​(String xpathExpression)
        Description copied from interface: AuditManager
        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.
        Specified by:
        addXPath in interface AuditManager
        Parameters:
        xpathExpression - the xpath expression to add to the list of auditing filters.
      • removeXPath

        public void removeXPath​(String xpathExpression)
        Description copied from interface: AuditManager

        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.

        Specified by:
        removeXPath in interface AuditManager
        Parameters:
        xpathExpression - The xpath expression to remove from the list of auditing filters
      • getXPathFilters

        public Iterator<String> getXPathFilters()
        Description copied from interface: AuditManager

        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.

        Specified by:
        getXPathFilters in interface AuditManager
        Returns:
        An iterator of all XPath expressions the audit manager is using
      • setIgnoreList

        public void setIgnoreList​(Collection<String> usernames)
        Description copied from interface: AuditManager
        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.
        Specified by:
        setIgnoreList in interface AuditManager
        Parameters:
        usernames - the list of usernames that won't be audited.
      • getIgnoreList

        public Collection<String> getIgnoreList()
        Description copied from interface: AuditManager
        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.
        Specified by:
        getIgnoreList in interface AuditManager
        Returns:
        the list of usernames that won't be audited.
      • initialize

        public void initialize​(XMPPServer server)
        Description copied from class: BasicModule

        Initializes the basic module.

        Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.

        Specified by:
        initialize in interface Module
        Overrides:
        initialize in class BasicModule
        Parameters:
        server - the server hosting this module.
      • stop

        public void stop()
        Description copied from class: BasicModule

        Stops the basic module.

        Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.

        Specified by:
        stop in interface Module
        Overrides:
        stop in class BasicModule
      • propertySet

        public void propertySet​(String property,
                                Map<String,​Object> params)
        Description copied from interface: PropertyEventListener
        A property was set. The parameter map params will contain the the value of the property under the key value.
        Specified by:
        propertySet in interface PropertyEventListener
        Parameters:
        property - the name of the property.
        params - event parameters.
      • xmlPropertySet

        public void xmlPropertySet​(String property,
                                   Map<String,​Object> params)
        Description copied from interface: PropertyEventListener
        An XML property was set. The parameter map params will contain the the value of the property under the key value.
        Specified by:
        xmlPropertySet in interface PropertyEventListener
        Parameters:
        property - the name of the property.
        params - event parameters.