1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.asteriskjava.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 org.asteriskjava.manager.action.LoginAction
25 * @see org.asteriskjava.manager.response.ChallengeResponse
26 * @author srt
27 * @version $Id: ChallengeAction.java 729 2007-05-26 05:16:57Z sprior $
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 @Override
61 public String getAction()
62 {
63 return "Challenge";
64 }
65
66 /***
67 * Returns the digest alogrithm to use.
68 */
69 public String getAuthType()
70 {
71 return authType;
72 }
73
74 /***
75 * Sets the digest alogrithm to use. Currently asterisk only supports "MD5".
76 */
77 public void setAuthType(String authType)
78 {
79 this.authType = authType;
80 }
81 }