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 HotmailProfileMessage extends MimeMessage {
27    private net.sf.dexterim.msn.entity.HotmailProfile hotmailProfile;
28  
29    /***
30     *  Creates a new instance of HotmailProfileMessage
31     */
32    public HotmailProfileMessage() {
33      super();
34  
35      hotmailProfile = new net.sf.dexterim.msn.entity.HotmailProfile();
36    }
37  
38    /***
39     *  Gets the messageCommand attribute of the HotmailProfileMessage object
40     *
41     *@return    The messageCommand value
42     */
43    public String getMessageCommand() {
44      return null;
45    }
46  
47    /***
48     *  Description of the Method
49     *
50     *@param  account   Description of the Parameter
51     *@param  nick      Description of the Parameter
52     *@param  lineList  Description of the Parameter
53     */
54    public void processMessage(
55      String account,
56      String nick,
57      java.util.List lineList) {
58      java.util.Iterator lineIter = lineList.iterator();
59  
60      while (lineIter.hasNext()) {
61        TokenizedLine tokenLine = new TokenizedLine((String)lineIter.next());
62  
63        if (tokenLine.getTokenCount() > 1) {
64          if ("LoginTime:".equals(tokenLine.getToken(0))) {
65            hotmailProfile.setLoginTime(tokenLine.getToken(1));
66          }
67          else if ("EmailEnabled:".equals(tokenLine.getToken(0))) {
68            if ("1".equals(tokenLine.getToken(1))) {
69              hotmailProfile.setEmailEnabled(true);
70            }
71            else {
72              hotmailProfile.setEmailEnabled(false);
73            }
74          }
75          else if ("MemberIdHigh:".equals(tokenLine.getToken(0))) {
76            hotmailProfile.setMemberIDHigh(tokenLine.getToken(1));
77          }
78          else if ("MemberIdLow:".equals(tokenLine.getToken(0))) {
79            hotmailProfile.setMemberIDLow(tokenLine.getToken(1));
80          }
81          else if ("lang_preference:".equals(tokenLine.getToken(0))) {
82            hotmailProfile.setPreferredLanguage(tokenLine.getToken(1));
83          }
84          else if ("preferredEmail:".equals(tokenLine.getToken(0))) {
85            hotmailProfile.setPreferredEmail(tokenLine.getToken(1));
86          }
87          else if ("country:".equals(tokenLine.getToken(0))) {
88            hotmailProfile.setCountry(tokenLine.getToken(1));
89          }
90          else if ("PostalCode:".equals(tokenLine.getToken(0))) {
91            hotmailProfile.setPostal(tokenLine.getToken(1));
92          }
93          else if ("Gender:".equals(tokenLine.getToken(0))) {
94            hotmailProfile.setGender(tokenLine.getToken(1));
95          }
96          else if ("Kid:".equals(tokenLine.getToken(0))) {
97            if ("1".equals(tokenLine.getToken(1))) {
98              hotmailProfile.setKid(true);
99            }
100           else {
101             hotmailProfile.setKid(false);
102           }
103         }
104         else if ("Age:".equals(tokenLine.getToken(0))) {
105           hotmailProfile.setAge(tokenLine.getToken(1));
106         }
107         else if ("sid:".equals(tokenLine.getToken(0))) {
108           hotmailProfile.setSid(tokenLine.getToken(1));
109         }
110         else if ("kv:".equals(tokenLine.getToken(0))) {
111           hotmailProfile.setKv(tokenLine.getToken(1));
112         }
113         else if ("MSPAuth:".equals(tokenLine.getToken(0))) {
114           hotmailProfile.setMspAuth(tokenLine.getToken(1));
115         }
116       }
117     }
118   }
119 
120   /***
121    *  Getter for property hotmailProfile.
122    *
123    *@return    Value of property hotmailProfile.
124    */
125   public net.sf.dexterim.msn.entity.HotmailProfile getHotmailProfile() {
126     return hotmailProfile;
127   }
128 
129   /* (non-Javadoc)
130    * @see net.sf.dexterim.msn.message.MsnMessage#process(net.sf.dexterim.msn.MsnConnection)
131    */
132   public void process(MsnConnection connection) {
133 
134   }
135 }