[Cherbot-commit] SF.net SVN: cherbot: [73] trunk/src/net/sf/cherbot/IRCConnection.java
Status: Alpha
Brought to you by:
christianhujer
|
From: <chr...@us...> - 2007-06-17 13:07:56
|
Revision: 73
http://svn.sourceforge.net/cherbot/?rev=73&view=rev
Author: christianhujer
Date: 2007-06-17 06:07:49 -0700 (Sun, 17 Jun 2007)
Log Message:
-----------
Changed symbol names to more standard names for later extraction of common super classes for different connection implementations.
Modified Paths:
--------------
trunk/src/net/sf/cherbot/IRCConnection.java
Modified: trunk/src/net/sf/cherbot/IRCConnection.java
===================================================================
--- trunk/src/net/sf/cherbot/IRCConnection.java 2007-06-17 10:22:10 UTC (rev 72)
+++ trunk/src/net/sf/cherbot/IRCConnection.java 2007-06-17 13:07:49 UTC (rev 73)
@@ -27,6 +27,9 @@
*/
public class IRCConnection extends BasicCommand {
+ /** The default IRC port. */
+ public static final int DEFAULT_IRC_PORT = 6667;
+
/** The username to use for IRC authentication.
* This is the IRC username, not the IRC nick.
*/
@@ -44,10 +47,10 @@
@Nullable private String nickPassword;
/** The IRC server host to connect to. */
- @NotNull private String ircHost;
+ @NotNull private String host;
/** The IRC server port to connect to. */
- private int ircPort = 6667;
+ private int port = DEFAULT_IRC_PORT;
/** The Socket for communication. */
@Nullable private Socket socket;
@@ -75,7 +78,7 @@
* @throws IOException In case of connection problems.
*/
private void connect() throws IOException {
- final Socket socket = new Socket(ircHost, ircPort);
+ final Socket socket = new Socket(host, port);
this.socket = socket;
final PrintWriter out = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), "utf-8"));
this.out = out;
@@ -176,19 +179,19 @@
}
/** Sets the host of the IRC server to connect to.
- * @param ircHost Host of the IRC server.
+ * @param host Host of the IRC server.
*/
- @Option(type = OptionType.REQUIRED, value = {"ircHost"})
- public void setIrcHost(@NotNull final String ircHost) {
- this.ircHost = ircHost;
+ @Option(type = OptionType.REQUIRED, value = {"host"})
+ public void setHost(@NotNull final String host) {
+ this.host = host;
}
/** Sets the port of the IRC server to connect to.
- * @param ircPort Port of the IRC server.
+ * @param port Port of the IRC server.
*/
- @Option({"ircPort"})
- public void setIrcPort(@NotNull final Integer ircPort) {
- this.ircPort = ircPort;
+ @Option({"port"})
+ public void setPort(@NotNull final Integer port) {
+ this.port = port;
}
} // class IRCConnection
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|