]> git.somenet.org - irc/pjirc-ng.git/blob - src/main/java/irc/Server.java
Pjirc 2.2.1 as available on the net, reformatted and made it compile.
[irc/pjirc-ng.git] / src / main / java / irc / Server.java
1 /*****************************************************/\r
2 /*          This java file is a part of the          */\r
3 /*                                                   */\r
4 /*           -  Plouf's Java IRC Client  -           */\r
5 /*                                                   */\r
6 /*   Copyright (C)  2002 - 2005 Philippe Detournay   */\r
7 /*                                                   */\r
8 /*         All contacts : theplouf@yahoo.com         */\r
9 /*                                                   */\r
10 /*  PJIRC is free software; you can redistribute     */\r
11 /*  it and/or modify it under the terms of the GNU   */\r
12 /*  General Public License as published by the       */\r
13 /*  Free Software Foundation; version 2 or later of  */\r
14 /*  the License.                                     */\r
15 /*                                                   */\r
16 /*  PJIRC is distributed in the hope that it will    */\r
17 /*  be useful, but WITHOUT ANY WARRANTY; without     */\r
18 /*  even the implied warranty of MERCHANTABILITY or  */\r
19 /*  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU   */\r
20 /*  General Public License for more details.         */\r
21 /*                                                   */\r
22 /*  You should have received a copy of the GNU       */\r
23 /*  General Public License along with PJIRC; if      */\r
24 /*  not, write to the Free Software Foundation,      */\r
25 /*  Inc., 59 Temple Place, Suite 330, Boston,        */\r
26 /*  MA  02111-1307  USA                              */\r
27 /*                                                   */\r
28 /*****************************************************/\r
29 package irc;\r
30 \r
31 import java.util.Enumeration;\r
32 \r
33 /**\r
34  * The server class.\r
35  */\r
36 public interface Server {\r
37         /**\r
38          * Say the specified string. This string is sent as it to the remote server.\r
39          * \r
40          * @param destination\r
41          *          message destination.\r
42          * @param str\r
43          *          message itself.\r
44          */\r
45         public void say(String destination, String str);\r
46 \r
47         /**\r
48          * Execute the given command on the remote server.\r
49          * \r
50          * @param str\r
51          *          the command to execute.\r
52          */\r
53         public void execute(String str);\r
54 \r
55         /**\r
56          * Send the given message to the server's status.\r
57          * \r
58          * @param str\r
59          *          string to send to the status.\r
60          */\r
61         public void sendStatusMessage(String str);\r
62 \r
63         /**\r
64          * Get the nickname on this server.\r
65          * \r
66          * @return the nickname on the server.\r
67          */\r
68         public String getNick();\r
69 \r
70         /**\r
71          * Get the username on this server.\r
72          * \r
73          * @return the username on this server.\r
74          */\r
75         public String getUserName();\r
76 \r
77         /**\r
78          * Get the server name.\r
79          * \r
80          * @return the server name.\r
81          */\r
82         public String getServerName();\r
83 \r
84         /**\r
85          * Try to connect to the server, using default configuration.\r
86          */\r
87         public void connect();\r
88 \r
89         /**\r
90          * Disconnect from the server.\r
91          */\r
92         public void disconnect();\r
93 \r
94         /**\r
95          * Test whether the server is connected.\r
96          * \r
97          * @return true if server is connected, false otherwise.\r
98          */\r
99         public boolean isConnected();\r
100 \r
101         /**\r
102          * Get an enumeration of all the sources associated with this server.\r
103          * \r
104          * @return an enumeration of Source.\r
105          */\r
106         public Enumeration getSources();\r
107 \r
108         /**\r
109          * Enumerate all sources, as if they were created and notified to the given\r
110          * listener.\r
111          * \r
112          * @param l\r
113          *          listener to call.\r
114          */\r
115         public void enumerateSourcesAsCreated(ServerListener l);\r
116 \r
117         /**\r
118          * Enumerate all sources, as if they were removed and notified to the given\r
119          * listener.\r
120          * \r
121          * @param l\r
122          *          listener to call.\r
123          */\r
124         public void enumerateSourcesAsRemoved(ServerListener l);\r
125 \r
126         /**\r
127          * Set the default output source this server should use if the destination\r
128          * source is undefined.\r
129          * \r
130          * @param source\r
131          *          default source.\r
132          */\r
133         public void setDefaultSource(Source source);\r
134 \r
135         /**\r
136          * Add a server listener.\r
137          * \r
138          * @param l\r
139          *          listener to add.\r
140          */\r
141         public void addServerListener(ServerListener l);\r
142 \r
143         /**\r
144          * Remove a listener.\r
145          * \r
146          * @param l\r
147          *          listener to remove.\r
148          */\r
149         public void removeServerListener(ServerListener l);\r
150 \r
151         /**\r
152          * Leave all sources, then leave the server.\r
153          */\r
154         public void leave();\r
155 }\r