1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package net.sf.asterisk.manager.action;
18
19 /***
20 * The ChallengeAction requests a challenge from the server to use when logging
21 * in using challenge/response. Sending this action to the asterisk server
22 * results in a ChallengeResponse being received from the server.
23 *
24 * @see net.sf.asterisk.manager.action.LoginAction
25 * @see net.sf.asterisk.manager.response.ChallengeResponse
26 * @author srt
27 * @version $Id: ChallengeAction.java,v 1.4 2005/08/07 00:09:42 srt Exp $
28 */
29 public class ChallengeAction extends AbstractManagerAction
30 {
31 /***
32 * Serializable version identifier
33 */
34 static final long serialVersionUID = 7240516124871953971L;
35 private String authType;
36
37 /***
38 * Creates a new empty ChallengeAction.
39 */
40 public ChallengeAction()
41 {
42
43 }
44
45 /***
46 * Creates a new ChallengeAction that requests a new login challenge for use
47 * with the given digest algorithm.
48 *
49 * @param authType the digest alogrithm to use.
50 * @since 0.2
51 */
52 public ChallengeAction(String authType)
53 {
54 this.authType = authType;
55 }
56
57 /***
58 * Returns Returns the name of this action, i.e. "Challenge".
59 */
60 public String getAction()
61 {
62 return "Challenge";
63 }
64
65 /***
66 * Returns the digest alogrithm to use.
67 */
68 public String getAuthType()
69 {
70 return authType;
71 }
72
73 /***
74 * Sets the digest alogrithm to use. Currently asterisk only supports "MD5".
75 */
76 public void setAuthType(String authType)
77 {
78 this.authType = authType;
79 }
80 }