1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sf.dexterim.msn.message;
20
21 import net.sf.dexterim.msn.MsnConnection;
22
23 /***
24 *
25 * @author Christoph Walcher
26 */
27 public class NewServerMessage extends SingleLineMessage {
28 private String host;
29 private int port;
30
31 /*** Creates a new instance of NewServerMessage */
32 public NewServerMessage() {
33 }
34
35 /*** Parses New Server Messages of the form XFR 2 NS 207.46.106.145:1863 0 207.46.104.20:1863
36 *
37 */
38 public net.sf.dexterim.msn.message.MsnMessage addLine(String line)
39 throws net.sf.dexterim.msn.message.MessageFormatException {
40 java.util.StringTokenizer st = new java.util.StringTokenizer(line);
41
42
43 for (int i = 0; i < 3; i++) {
44 st.nextToken();
45 }
46
47 String temp = st.nextToken();
48 int i = temp.indexOf(":");
49
50 if (i < 0) {
51 throw new net.sf.dexterim.msn.message.MessageFormatException(
52 "No new Host:Port combination received!");
53 }
54 else {
55 host = temp.substring(0, i);
56 port = Integer.parseInt(temp.substring(i + 1));
57 }
58
59 return this;
60 }
61
62 /*** Getter for property host.
63 * @return Value of property host.
64 *
65 */
66 public java.lang.String getHost() {
67 return host;
68 }
69
70 /*** Getter for property port.
71 * @return Value of property port.
72 *
73 */
74 public int getPort() {
75 return port;
76 }
77
78
79
80
81 public void process(MsnConnection connection) {
82
83
84 }
85 }