1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.acegisecurity.event.authorization;
17
18 import org.acegisecurity.AuthenticationCredentialsNotFoundException;
19 import org.acegisecurity.ConfigAttributeDefinition;
20
21
22 /***
23 * Indicates a secure object invocation failed because the
24 * <code>Authentication</code> could not be obtained from the
25 * <code>SecurityContextHolder</code>.
26 *
27 * @author Ben Alex
28 * @version $Id: AuthenticationCredentialsNotFoundEvent.java,v 1.3 2005/11/17 00:56:09 benalex Exp $
29 */
30 public class AuthenticationCredentialsNotFoundEvent
31 extends AbstractAuthorizationEvent {
32
33
34 private AuthenticationCredentialsNotFoundException credentialsNotFoundException;
35 private ConfigAttributeDefinition configAttributeDefinition;
36
37
38
39 /***
40 * Construct the event.
41 *
42 * @param secureObject the secure object
43 * @param configAttribs that apply to the secure object
44 * @param credentialsNotFoundException exception returned to the caller
45 * (contains reason)
46 *
47 * @throws IllegalArgumentException DOCUMENT ME!
48 */
49 public AuthenticationCredentialsNotFoundEvent(Object secureObject,
50 ConfigAttributeDefinition configAttribs,
51 AuthenticationCredentialsNotFoundException credentialsNotFoundException) {
52 super(secureObject);
53
54 if ((configAttribs == null) || (credentialsNotFoundException == null)) {
55 throw new IllegalArgumentException(
56 "All parameters are required and cannot be null");
57 }
58
59 this.configAttributeDefinition = configAttribs;
60 this.credentialsNotFoundException = credentialsNotFoundException;
61 }
62
63
64
65 public ConfigAttributeDefinition getConfigAttributeDefinition() {
66 return configAttributeDefinition;
67 }
68
69 public AuthenticationCredentialsNotFoundException getCredentialsNotFoundException() {
70 return credentialsNotFoundException;
71 }
72 }