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.Authentication;
19: import org.acegisecurity.ConfigAttributeDefinition;
20:
21: /**
22: * Event indicating a secure object was invoked successfully.<P>Published just before the secure object attempts to
23: * proceed.</p>
24: *
25: * @author Ben Alex
26: * @version $Id: AuthorizedEvent.java 1496 2006-05-23 13:38:33Z benalex $
27: */
28: public class AuthorizedEvent extends AbstractAuthorizationEvent {
29: //~ Instance fields ================================================================================================
30:
31: private Authentication authentication;
32: private ConfigAttributeDefinition configAttributeDefinition;
33:
34: //~ Constructors ===================================================================================================
35:
36: /**
37: * Construct the event.
38: *
39: * @param secureObject the secure object
40: * @param configAttribs that apply to the secure object
41: * @param authentication that successfully called the secure object
42: *
43: * @throws IllegalArgumentException DOCUMENT ME!
44: */
45: public AuthorizedEvent(Object secureObject,
46: ConfigAttributeDefinition configAttribs,
47: Authentication authentication) {
48: super (secureObject);
49:
50: if ((configAttribs == null) || (authentication == null)) {
51: throw new IllegalArgumentException(
52: "All parameters are required and cannot be null");
53: }
54:
55: this .configAttributeDefinition = configAttribs;
56: this .authentication = authentication;
57: }
58:
59: //~ Methods ========================================================================================================
60:
61: public Authentication getAuthentication() {
62: return authentication;
63: }
64:
65: public ConfigAttributeDefinition getConfigAttributeDefinition() {
66: return configAttributeDefinition;
67: }
68: }
|