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  import java.util.StringTokenizer;
22  
23  import net.sf.dexterim.msn.MsnConnection;
24  import net.sf.dexterim.msn.util.SpecialCharacters;
25  
26  /***
27   *@author     christoph
28   */
29  public class JoiningMessage extends SingleLineMessage {
30    private String account;
31    private String nick;
32  
33    /***
34     *  Creates a new instance of JoiningMessage
35     */
36    public JoiningMessage() {
37    }
38  
39    /***
40     *  Gets the messageCommand attribute of the JoiningMessage object
41     *
42     *@return    The messageCommand value
43     */
44    public String getMessageCommand() {
45      return "";
46    }
47  
48    /***
49     *  Getter for property account.
50     *
51     *@return    Value of property account.
52     */
53    public java.lang.String getAccount() {
54      return account;
55    }
56  
57    /***
58     *  Getter for property nick.
59     *
60     *@return    Value of property nick.
61     */
62    public java.lang.String getNick() {
63      return nick;
64    }
65  
66    /***
67     *  Adds a feature to the Line attribute of the JoiningMessage object
68     *
69     *@param  line                        The feature to be added to the Line
70     *      attribute
71     *@return                             Description of the Return Value
72     *@exception  MessageFormatException  Description of the Exception
73     */
74    public MsnMessage addLine(String line) throws MessageFormatException {
75      try {
76        StringTokenizer strtok = new StringTokenizer(line);
77  
78        strtok.nextToken();
79  
80        // Skip Literal "IRO"
81        strtok.nextToken();
82  
83        // Skip TransactionId
84        strtok.nextToken();
85  
86        // Skip Participant#
87        strtok.nextToken();
88  
89        // Skip TotalParticipants
90        account = strtok.nextToken();
91        nick = SpecialCharacters.getInstance().decode(strtok.nextToken(), true);
92  
93        return this;
94      }
95      catch (Exception ex) {
96        throw new MessageFormatException(ex);
97      }
98    }
99  
100   /* (non-Javadoc)
101    * @see net.sf.dexterim.msn.message.MsnMessage#process(net.sf.dexterim.msn.MsnConnection)
102    */
103   public void process(MsnConnection connection) {
104     // TODO Auto-generated method stub
105     
106   }
107 }