KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jivesoftware > smack > debugger > SmackDebugger


1 /**
2  * $RCSfile$
3  * $Revision: 2730 $
4  * $Date: 2005-08-26 23:23:36 -0300 (Fri, 26 Aug 2005) $
5  *
6  * Copyright 2003-2004 Jive Software.
7  *
8  * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */

20
21 package org.jivesoftware.smack.debugger;
22
23 import java.io.*;
24
25 import org.jivesoftware.smack.*;
26
27 /**
28  * Interface that allows for implementing classes to debug XML traffic. That is a GUI window that
29  * displays XML traffic.<p>
30  *
31  * Every implementation of this interface <b>must</b> have a public constructor with the following
32  * arguments: XMPPConnection, Writer, Reader.
33  *
34  * @author Gaston Dombiak
35  */

36 public interface SmackDebugger {
37
38     /**
39      * Called when a user has logged in to the server. The user could be an anonymous user, this
40      * means that the user would be of the form host/resource instead of the form
41      * user@host/resource.
42      *
43      * @param user the user@host/resource that has just logged in
44      */

45     public abstract void userHasLogged(String JavaDoc user);
46
47     /**
48      * Returns the special Reader that wraps the main Reader and logs data to the GUI.
49      *
50      * @return the special Reader that wraps the main Reader and logs data to the GUI.
51      */

52     public abstract Reader getReader();
53
54     /**
55      * Returns the special Writer that wraps the main Writer and logs data to the GUI.
56      *
57      * @return the special Writer that wraps the main Writer and logs data to the GUI.
58      */

59     public abstract Writer getWriter();
60
61     /**
62      * Returns a new special Reader that wraps the new connection Reader. The connection
63      * has been secured so he now have a new reader and writer.
64      *
65      * @return a new special Reader that wraps the new connection Reader.
66      */

67     public abstract Reader newConnectionReader(Reader reader);
68
69     /**
70      * Returns a new special Writer that wraps the new connection Writer. The connection
71      * has been secured so he now have a new reader and writer.
72      *
73      * @return a new special Writer that wraps the new connection Writer.
74      */

75     public abstract Writer newConnectionWriter(Writer writer);
76
77     /**
78      * Returns the thread that will listen for all incoming packets and write them to the GUI.
79      * This is what we call "interpreted" packet data, since it's the packet data as Smack sees
80      * it and not as it's coming in as raw XML.
81      *
82      * @return the PacketListener that will listen for all incoming packets and write them to
83      * the GUI
84      */

85     public abstract PacketListener getReaderListener();
86
87     /**
88      * Returns the thread that will listen for all outgoing packets and write them to the GUI.
89      *
90      * @return the PacketListener that will listen for all sent packets and write them to
91      * the GUI
92      */

93     public abstract PacketListener getWriterListener();
94 }
Popular Tags