You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ServerInfo.java 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /*
  2. * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack, Gregory Holmes
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5. * of this software and associated documentation files (the "Software"), to deal
  6. * in the Software without restriction, including without limitation the rights
  7. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. * copies of the Software, and to permit persons to whom the Software is
  9. * furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  20. * SOFTWARE.
  21. *
  22. * SVN: $Id$
  23. */
  24. package com.dmdirc.parser;
  25. /**
  26. * Contains Server information.
  27. *
  28. * @author Shane Mc Cormack
  29. * @author Chris Smith
  30. * @version $Id$
  31. * @see IRCParser
  32. */
  33. public class ServerInfo {
  34. /**
  35. * A version number for this class. It should be changed whenever the class
  36. * structure is changed (or anything else that would prevent serialized
  37. * objects being unserialized with the new class).
  38. */
  39. private static final long serialVersionUID = 1;
  40. /** Server to connect to (Default: "irc.quakenet.org"). */
  41. private String host = "irc.quakenet.org";
  42. /** Port server listens on for client connections (Default: 6667). */
  43. private int port = 6667;
  44. /** Optional password needed to connect to server (Default: ""). */
  45. private String password = "";
  46. /** Is this an ssl-enabled server (Default: false). */
  47. private boolean isSSL = false;
  48. // /** Do we need to wait for input before sending Nick/User/Pass (Default: false). */
  49. // private boolean waitForFirst = false;
  50. /** Are we using a socks proxy (Default: false). */
  51. private boolean useSocksProxy = false;
  52. /** Proxy server to connect to (Default: "127.0.0.1"). */
  53. private String proxyHost = "127.0.0.1";
  54. /** Port server listens on for client connections (Default: 8080). */
  55. private int proxyPort = 8080;
  56. /** Constructor using Default values. */
  57. public ServerInfo () { }
  58. /** Constructor using specifed host, port and password, SSL/Proxy must be specifed separately. */
  59. public ServerInfo (String serverHost, int serverPort, String serverPass) {
  60. host = serverHost;
  61. port = serverPort;
  62. password = serverPass;
  63. }
  64. /**
  65. * Set the hostname.
  66. *
  67. * @param newValue Value to set to.
  68. */
  69. public void setHost(final String newValue) { host = newValue; }
  70. /**
  71. * Get the hostname.
  72. *
  73. * @return Current hostname
  74. */
  75. public String getHost() { return host; }
  76. /**
  77. * Set the port.
  78. *
  79. * @param newValue Value to set to.
  80. */
  81. public void setPort(final int newValue) { port = newValue; }
  82. /**
  83. * Get the port.
  84. *
  85. * @return Current port
  86. */
  87. public int getPort() { return port; }
  88. /**
  89. * Set the password.
  90. *
  91. * @param newValue Value to set to.
  92. */
  93. public void setPassword(final String newValue) { password = newValue; }
  94. /**
  95. * Get the password.
  96. *
  97. * @return Current Password
  98. */
  99. public String getPassword() { return password; }
  100. /**
  101. * Set if the server uses ssl.
  102. *
  103. * @param newValue true if server uses ssl, else false
  104. */
  105. public void setSSL(final boolean newValue) { isSSL = newValue; }
  106. /**
  107. * Get if the server uses ssl.
  108. *
  109. * @return true if server uses ssl, else false
  110. */
  111. public boolean getSSL() { return isSSL; }
  112. /**
  113. * Set if we are connecting via a socks proxy.
  114. *
  115. * @param newValue true if we are using socks, else false
  116. */
  117. public void setUseSocks(final boolean newValue) { useSocksProxy = newValue; }
  118. /**
  119. * Get if we are connecting via a socks proxy.
  120. *
  121. * @return true if we are using socks, else false
  122. */
  123. public boolean getUseSocks() { return useSocksProxy; }
  124. /**
  125. * Set the Proxy hostname.
  126. *
  127. * @param newValue Value to set to.
  128. */
  129. public void setProxyHost(final String newValue) { proxyHost = newValue; }
  130. /**
  131. * Get the Proxy hostname.
  132. *
  133. * @return Current Proxy hostname
  134. */
  135. public String getProxyHost() { return proxyHost; }
  136. /**
  137. * Set the Proxy port.
  138. *
  139. * @param newValue Value to set to.
  140. */
  141. public void setProxyPort(final int newValue) { proxyPort = newValue; }
  142. /**
  143. * Get the Proxy port.
  144. *
  145. * @return Current Proxy port
  146. */
  147. public int getProxyPort() { return proxyPort; }
  148. /**
  149. * Get SVN Version information
  150. *
  151. * @return SVN Version String
  152. */
  153. public static String getSvnInfo () { return "$Id$"; }
  154. }