View Javadoc
1   //////////////////////////////////////////////////////////////////////////////
2   // dexterIM - Instant Messaging Framework
3   // Copyright (C) 2003  Christoph Walcher
4   //
5   // This program is free software; you can redistribute it and/or modify
6   // it under the terms of the GNU General Public License as published by
7   // the Free Software Foundation; either version 2 of the License, or
8   // (at your option) any later version.
9   //
10  // This program is distributed in the hope that it will be useful,
11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  // GNU General Public License for more details.
14  //
15  // You should have received a copy of the GNU General Public License
16  // along with this program; if not, write to the Free Software
17  // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  //////////////////////////////////////////////////////////////////////////////
19  package net.sf.dexterim.msn.message;
20  
21  
22  import java.util.StringTokenizer;
23  
24  import net.sf.dexterim.msn.MsnConnection;
25  
26  /***
27   *  Description of the Class
28   *
29   *@author     christoph
30   */
31  public class StartConversationMessage extends SingleLineMessage {
32    private String account;
33    private String switchBoardCKI;
34    private String conversationID;
35    private String switchBoardIP;
36    private int switchBoardPort;
37  
38    /***
39     *  Constructor for the StartConversationMessage object
40     */
41    public StartConversationMessage() {
42    }
43  
44    /***
45     *  Gets the messageCommand attribute of the StartConversationMessage object
46     *
47     *@return    The messageCommand value
48     */
49    public String getMessageCommand() {
50      return MsnMessageFactory.CMD_RING;
51    }
52  
53    /***
54     *  Getter for property account.
55     *
56     *@return    Value of property account.
57     */
58    public java.lang.String getAccount() {
59      return account;
60    }
61  
62    /***
63     *  Getter for property switchBoardCKI.
64     *
65     *@return    Value of property switchBoardCKI.
66     */
67    public java.lang.String getSwitchBoardCKI() {
68      return switchBoardCKI;
69    }
70  
71    /***
72     *  Getter for property conversationID.
73     *
74     *@return    Value of property conversationID.
75     */
76    public java.lang.String getConversationID() {
77      return conversationID;
78    }
79  
80    /***
81     *  Getter for property switchBoardIP.
82     *
83     *@return    Value of property switchBoardIP.
84     */
85    public java.lang.String getSwitchBoardIP() {
86      return switchBoardIP;
87    }
88  
89    /***
90     *  Getter for property switchBoardPort.
91     *
92     *@return    Value of property switchBoardPort.
93     */
94    public int getSwitchBoardPort() {
95      return switchBoardPort;
96    }
97  
98    /***
99     *  Adds a feature to the Line attribute of the StartConversationMessage
100    *  object
101    *
102    *@param  line  The feature to be added to the Line attribute
103    *@return       Description of the Return Value
104    */
105   public MsnMessage addLine(String line) {
106     StringTokenizer st = new StringTokenizer(line);
107 
108     st.nextToken();
109 
110     //skip CMD_RING
111     conversationID = st.nextToken();
112 
113     String temp = st.nextToken();
114 
115     /*
116      *  find ip and port
117      */
118     int i = temp.indexOf(":");
119 
120     switchBoardIP = temp.substring(0, i);
121 
122     switchBoardPort = Integer.parseInt(temp.substring(i + 1));
123 
124     st.nextToken();
125 
126     //skip literal "CKI"
127     /*
128      *  find CKI #
129      */
130     switchBoardCKI = st.nextToken();
131 
132     account = st.nextToken();
133 
134     // slip email
135     return this;
136   }
137 
138   /* (non-Javadoc)
139    * @see net.sf.dexterim.msn.message.MsnMessage#process(net.sf.dexterim.msn.MsnConnection)
140    */
141   public void process(MsnConnection connection) {
142     // TODO Auto-generated method stub
143     
144   }
145 }