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 ReferMessage extends SingleLineMessage {
28 /*** Creates a new instance of ReferMessage */
29 public ReferMessage() {
30 }
31
32 /*** Parses Refer Messages. Two types of Refer Messages are used in MSN Messenger
33 * <ul>
34 * <li> <b>For Switchboard: </b> XFR 10 SB 64.4.12.193:1863 CKI 16925950.1016955577.17693
35 * <li> <b>For Connecting:</b> XFR 2 NS 207.46.106.145:1863 0 207.46.104.20:1863
36 * </ul>
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 st.nextToken();
44 st.nextToken();
45
46 String command = st.nextToken();
47
48 if ("SB".equals(command)) {
49 SwitchBoardMessage sbMessage = new SwitchBoardMessage();
50
51 return sbMessage.addLine(line);
52 }
53 else if ("NS".equals(command)) {
54 NewServerMessage nsMessage = new NewServerMessage();
55
56 return nsMessage.addLine(line);
57 }
58
59 throw new net.sf.dexterim.msn.message.MessageFormatException(
60 "Not a Switchboard nor a NewServerMessage!");
61 }
62
63
64
65
66 public void process(MsnConnection connection) {
67
68
69 }
70 }