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   *
25   * @author  Christoph Walcher
26   */
27  public class LoginReplyMessage extends SingleLineMessage {
28    private boolean ok;
29    private String loginName;
30    private String friendlyName;
31    private boolean loginVerified;
32  
33    /*** Creates a new instance of LoginReplyMessage */
34    public LoginReplyMessage() {
35    }
36  
37    /*** Parses loginin replies of the form: USR 6 OK example@passport.com My%20Screen%20Name 1
38    *
39    */
40    public net.sf.dexterim.msn.message.MsnMessage addLine(String line) {
41      java.util.StringTokenizer st = new java.util.StringTokenizer(line);
42  
43      st.nextToken();
44      st.nextToken();
45      ok = "OK".equals(st.nextToken());
46  
47      loginName = st.nextToken();
48      friendlyName =
49        net.sf.dexterim.msn.util.SpecialCharacters.getInstance().decode(
50          st.nextToken(),
51          true);
52  
53      return this;
54    }
55  
56    /*** Getter for property friendlyName.
57    * @return Value of property friendlyName.
58    *
59    */
60    public java.lang.String getFriendlyName() {
61      return friendlyName;
62    }
63  
64    /*** Getter for property loginName.
65    * @return Value of property loginName.
66    *
67    */
68    public java.lang.String getLoginName() {
69      return loginName;
70    }
71  
72    /*** Getter for property loginVerified.
73    * @return Value of property loginVerified.
74    *
75    */
76    public boolean isLoginVerified() {
77      return loginVerified;
78    }
79  
80    /*** Getter for property ok.
81    * @return Value of property ok.
82    *
83    */
84    public boolean isOk() {
85      return ok;
86    }
87  
88    /* (non-Javadoc)
89     * @see net.sf.dexterim.msn.message.MsnMessage#process(net.sf.dexterim.msn.MsnConnection)
90     */
91    public void process(MsnConnection connection) {
92      // TODO Auto-generated method stub
93      
94    }
95  }