1 /*****************************************************/
\r
2 /* This java file is a part of the */
\r
4 /* - Plouf's Java IRC Client - */
\r
6 /* Copyright (C) 2002 - 2005 Philippe Detournay */
\r
8 /* All contacts : theplouf@yahoo.com */
\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
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
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
28 /*****************************************************/
\r
31 import java.util.Enumeration;
\r
36 public interface Server {
\r
38 * Say the specified string. This string is sent as it to the remote server.
\r
40 * @param destination
\r
41 * message destination.
\r
45 public void say(String destination, String str);
\r
48 * Execute the given command on the remote server.
\r
51 * the command to execute.
\r
53 public void execute(String str);
\r
56 * Send the given message to the server's status.
\r
59 * string to send to the status.
\r
61 public void sendStatusMessage(String str);
\r
64 * Get the nickname on this server.
\r
66 * @return the nickname on the server.
\r
68 public String getNick();
\r
71 * Get the username on this server.
\r
73 * @return the username on this server.
\r
75 public String getUserName();
\r
78 * Get the server name.
\r
80 * @return the server name.
\r
82 public String getServerName();
\r
85 * Try to connect to the server, using default configuration.
\r
87 public void connect();
\r
90 * Disconnect from the server.
\r
92 public void disconnect();
\r
95 * Test whether the server is connected.
\r
97 * @return true if server is connected, false otherwise.
\r
99 public boolean isConnected();
\r
102 * Get an enumeration of all the sources associated with this server.
\r
104 * @return an enumeration of Source.
\r
106 public Enumeration getSources();
\r
109 * Enumerate all sources, as if they were created and notified to the given
\r
113 * listener to call.
\r
115 public void enumerateSourcesAsCreated(ServerListener l);
\r
118 * Enumerate all sources, as if they were removed and notified to the given
\r
122 * listener to call.
\r
124 public void enumerateSourcesAsRemoved(ServerListener l);
\r
127 * Set the default output source this server should use if the destination
\r
128 * source is undefined.
\r
133 public void setDefaultSource(Source source);
\r
136 * Add a server listener.
\r
141 public void addServerListener(ServerListener l);
\r
144 * Remove a listener.
\r
147 * listener to remove.
\r
149 public void removeServerListener(ServerListener l);
\r
152 * Leave all sources, then leave the server.
\r
154 public void leave();
\r