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   *  Description of the Class
28   *
29   *@author     christoph
30   */
31  public class ChangeStatusMessage extends SingleLineMessage {
32    private String account;
33    private String nick;
34    private String status;
35  
36    /***
37     *  Constructor for the ChangeStatusMessage object
38     */
39    public ChangeStatusMessage() {
40    }
41  
42    /***
43     *  Gets the messageCommand attribute of the ChangeStatusMessage object
44     *
45     *@return    The messageCommand value
46     */
47    public String getMessageCommand() {
48      return MsnMessageFactory.CMD_STATUS_CHANGE;
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 nick.
62     *
63     *@return    Value of property nick.
64     */
65    public java.lang.String getNick() {
66      return nick;
67    }
68  
69    /***
70     *  Getter for property status.
71     *
72     *@return    Value of property status.
73     */
74    public java.lang.String getStatus() {
75      return status;
76    }
77  
78    /***
79     *  Adds a feature to the Line attribute of the ChangeStatusMessage object
80     *
81     *@param  line                        The feature to be added to the Line
82     *      attribute
83     *@return                             Description of the Return Value
84     *@exception  MessageFormatException  Description of the Exception
85     */
86    public MsnMessage addLine(String line) throws MessageFormatException {
87      try {
88        StringTokenizer st = new StringTokenizer(line);
89  
90        st.nextToken();
91  
92        // skip ILN
93        st.nextToken();
94  
95        // skip ID
96        this.status = st.nextToken();
97  
98        this.account = st.nextToken();
99  
100       this.nick = SpecialCharacters.getInstance().decode(st.nextToken(), true);
101 
102       return this;
103     }
104     catch (Exception ex) {
105       throw new MessageFormatException(ex);
106     }
107   }
108 
109   /* (non-Javadoc)
110    * @see net.sf.dexterim.msn.message.MsnMessage#process(net.sf.dexterim.msn.MsnConnection)
111    */
112   public void process(MsnConnection connection) {
113     // TODO Auto-generated method stub
114     
115   }
116 }