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 net.sf.dexterim.msn.MsnConnection;
22  
23  /***
24   *@author     Christoph Walcher
25   */
26  public class AddToListMessage extends SingleLineMessage {
27    private String list;
28    private String account;
29  
30    /***
31     *  Creates a new instance of RemoveFromListMessage
32     */
33    public AddToListMessage() {
34    }
35  
36    /***
37     *  Gets the messageCommand attribute of the AddToListMessage object
38     *
39     *@return    The messageCommand value
40     */
41    public String getMessageCommand() {
42      return net.sf.dexterim.msn.message.MsnMessageFactory.CMD_ADD_TO_LIST;
43    }
44  
45    /***
46     *  Getter for property list.
47     *
48     *@return    Value of property list.
49     */
50    public java.lang.String getList() {
51      return list;
52    }
53  
54    /***
55     *  Getter for property account.
56     *
57     *@return    Value of property account.
58     */
59    public java.lang.String getAccount() {
60      return account;
61    }
62  
63    /***
64     *  Adds a feature to the Line attribute of the AddToListMessage object
65     *
66     *@param  line  The feature to be added to the Line attribute
67     *@return       Description of the Return Value
68     */
69    public net.sf.dexterim.msn.message.MsnMessage addLine(String line) {
70      // Parse Messages like
71      // ADD 14 AL 107 example@passport.com
72      java.util.StringTokenizer st = new java.util.StringTokenizer(line);
73  
74      st.nextToken();
75  
76      //skip CMD_ADD_TO_LIST
77      st.nextToken();
78  
79      // skip TransactionID
80      list = st.nextToken();
81  
82      // List - AL, FL...
83      st.nextToken();
84  
85      // Version number of ContactList
86      account = st.nextToken();
87  
88      return this;
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  
96    }
97  }