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 java.util.StringTokenizer;
22
23 import net.sf.dexterim.msn.MsnConnection;
24 import net.sf.dexterim.msn.entity.SwitchBoardServer;
25
26 /***
27 * Description of the Class
28 *
29 *@author christoph
30 */
31 public class InviteMessage extends SingleLineMessage {
32 private String account;
33 private SwitchBoardServer server;
34 private String conversationID;
35
36 /***
37 * Constructor for the StartConversationMessage object
38 */
39 public InviteMessage() {
40 }
41
42 /***
43 * Gets the messageCommand attribute of the StartConversationMessage object
44 *
45 *@return The messageCommand value
46 */
47 public String getMessageCommand() {
48 return MsnMessageFactory.CMD_RING;
49 }
50
51 /***
52 * Getter for property account.
53 *
54 *@return Value of property account.
55 */
56 public java.lang.String getAccount() {
57 return account;
58 }
59
60 /***
61 * Getter for property conversationID.
62 *
63 *@return Value of property conversationID.
64 */
65 public java.lang.String getConversationID() {
66 return conversationID;
67 }
68
69 /***
70 * Adds a feature to the Line attribute of the StartConversationMessage
71 * object
72 *
73 *@param line The feature to be added to the Line attribute
74 *@return Description of the Return Value
75 */
76 public MsnMessage addLine(String line)
77 throws net.sf.dexterim.msn.message.MessageFormatException {
78 StringTokenizer st = new StringTokenizer(line);
79
80 st.nextToken();
81
82 conversationID = st.nextToken();
83
84 String temp = st.nextToken();
85
86 int i = temp.indexOf(":");
87
88 if (i < 0) {
89 throw new net.sf.dexterim.msn.message.MessageFormatException(
90 "IP and port not found in message");
91 }
92
93 String ip = temp.substring(0, i);
94 int port = Integer.parseInt(temp.substring(i + 1));
95
96 st.nextToken();
97
98 String cki = st.nextToken();
99
100 this.server = new SwitchBoardServer(ip, port, cki);
101
102 account = st.nextToken();
103
104 return this;
105 }
106
107 /*** Getter for property server.
108 * @return Value of property server.
109 *
110 */
111 public SwitchBoardServer getServer() {
112 return server;
113 }
114
115
116
117
118 public void process(MsnConnection connection) {
119
120
121 }
122 }