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 JoinMessage extends SingleLineMessage {
30    private String account;
31    private String nick;
32  
33    /***
34     *  Creates a new instance of JoinMessage
35     */
36    public JoinMessage() {
37    }
38  
39    /***
40     *  Gets the messageCommand attribute of the JoinMessage 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 JoinMessage 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 JOI Literal
81        account = strtok.nextToken();
82        nick = SpecialCharacters.getInstance().decode(strtok.nextToken(), true);
83  
84        return this;
85      }
86      catch (Exception ex) {
87        throw new MessageFormatException(ex);
88      }
89    }
90  
91    /* (non-Javadoc)
92     * @see net.sf.dexterim.msn.message.MsnMessage#process(net.sf.dexterim.msn.MsnConnection)
93     */
94    public void process(MsnConnection connection) {
95      // TODO Auto-generated method stub
96      
97    }
98  }