01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software
10: * distributed under the License is distributed on an "AS IS" BASIS,
11: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: * See the License for the specific language governing permissions and
13: * limitations under the License.
14: */
15:
16: package org.acegisecurity.event.authorization;
17:
18: import org.acegisecurity.AuthenticationCredentialsNotFoundException;
19: import org.acegisecurity.ConfigAttributeDefinition;
20:
21: /**
22: * Indicates a secure object invocation failed because the <code>Authentication</code> could not be obtained from
23: * the <code>SecurityContextHolder</code>.
24: *
25: * @author Ben Alex
26: * @version $Id: AuthenticationCredentialsNotFoundEvent.java 1496 2006-05-23 13:38:33Z benalex $
27: */
28: public class AuthenticationCredentialsNotFoundEvent extends
29: AbstractAuthorizationEvent {
30: //~ Instance fields ================================================================================================
31:
32: private AuthenticationCredentialsNotFoundException credentialsNotFoundException;
33: private ConfigAttributeDefinition configAttributeDefinition;
34:
35: //~ Constructors ===================================================================================================
36:
37: /**
38: * Construct the event.
39: *
40: * @param secureObject the secure object
41: * @param configAttribs that apply to the secure object
42: * @param credentialsNotFoundException exception returned to the caller
43: * (contains reason)
44: *
45: * @throws IllegalArgumentException DOCUMENT ME!
46: */
47: public AuthenticationCredentialsNotFoundEvent(
48: Object secureObject,
49: ConfigAttributeDefinition configAttribs,
50: AuthenticationCredentialsNotFoundException credentialsNotFoundException) {
51: super (secureObject);
52:
53: if ((configAttribs == null)
54: || (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: //~ Methods ========================================================================================================
64:
65: public ConfigAttributeDefinition getConfigAttributeDefinition() {
66: return configAttributeDefinition;
67: }
68:
69: public AuthenticationCredentialsNotFoundException getCredentialsNotFoundException() {
70: return credentialsNotFoundException;
71: }
72: }
|