1 /** 2 * $RCSfile: Auditor.java,v $ 3 * $Revision: 1.5 $ 4 * $Date: 2004/12/20 16:16:01 $ 5 * 6 * Copyright (C) 2004 Jive Software. All rights reserved. 7 * 8 * This software is published under the terms of the GNU Public License (GPL), 9 * a copy of which is included in this distribution. 10 */ 11 12 package org.jivesoftware.messenger.audit; 13 14 import org.xmpp.packet.Packet; 15 import org.jivesoftware.messenger.Session; 16 17 /** 18 * <p>Use auditors to audit events and messages on the server.</p> 19 * <p/> 20 * <p>All events and messages are sent to the auditor for recording. 21 * The auditor will determine if auditing should take place, and what 22 * to do with the data.</p> 23 * 24 * @author Iain Shigeoka 25 */ 26 public interface Auditor { 27 28 /** 29 * Audit an XMPP packet. 30 * 31 * @param packet the packet being audited 32 * @param session the session used for sending or receiving the packet 33 */ 34 void audit(Packet packet, Session session); 35 36 /** 37 * Audit any packet that was dropped (undeliverables, etc). 38 * 39 * @param packet the packet that was dropped. 40 */ 41 //void auditDroppedPacket(XMPPPacket packet); 42 43 /** 44 * Audit a non-packet event. 45 * 46 * @param event the event being audited. 47 */ 48 //void audit(AuditEvent event); 49 50 /** 51 * Prepares the auditor for system shutdown. 52 */ 53 void stop(); 54 55 /** 56 * Returns the number of queued packets that are still in memory and need to be saved to a 57 * permanent store. 58 * 59 * @return the number of queued packets that are still in memory. 60 */ 61 int getQueuedPacketsNumber(); 62 }