1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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.MD5;
25
26 /***
27 * Description of the Class
28 *
29 *@author christoph
30 */
31 public class ChallengeMessage extends SingleLineMessage {
32 private MD5 md5Hash;
33
34 /***
35 * Constructor for the CheckMessage object
36 */
37 public ChallengeMessage() {
38 }
39
40 /***
41 * Gets the messageCommand attribute of the CheckMessage object
42 *
43 *@return The messageCommand value
44 */
45 public String getMessageCommand() {
46 return MsnMessageFactory.CMD_CHECK;
47 }
48
49 /***
50 * Getter for property md5Hash.
51 *
52 *@return Value of property md5Hash.
53 */
54 public MD5 getMd5Hash() {
55 return md5Hash;
56 }
57
58 /***
59 * Adds a feature to the Line attribute of the CheckMessage object
60 *
61 *@param line The feature to be added to the Line attribute
62 *@return Description of the Return Value
63 */
64 public MsnMessage addLine(String line) {
65 StringTokenizer st = new StringTokenizer(line);
66
67 st.nextToken();
68
69 st.nextToken();
70
71 String s = st.nextToken() + MsnMessageFactory.MAGIC_STRING;
72
73 md5Hash = new MD5(s);
74
75 return this;
76 }
77
78
79
80
81 public void process(MsnConnection connection) {
82 connection.challengeReceived(this);
83 }
84 }