01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.geronimo.security.deployment;
17:
18: import java.util.Map;
19:
20: import org.apache.geronimo.security.deploy.SubjectInfo;
21:
22: /**
23: * @version $Rev: 545781 $ $Date: 2007-06-09 10:44:02 -0700 (Sat, 09 Jun 2007) $
24: */
25: public class SecurityConfiguration {
26:
27: private final Map principalRoleMap;
28: private final Map<String, SubjectInfo> roleDesignates;
29: private final SubjectInfo defaultSubjectInfo;
30: private final String defaultRole;
31: private final boolean doAsCurrentCaller;
32: private final boolean isUseContextHandler;
33:
34: public SecurityConfiguration(Map principalRoleMap,
35: Map<String, SubjectInfo> roleDesignates,
36: SubjectInfo defaultSubjectInfo, String defaultRole,
37: boolean doAsCurrentCaller, boolean useContextHandler) {
38: this .principalRoleMap = principalRoleMap;
39: this .roleDesignates = roleDesignates;
40: this .defaultSubjectInfo = defaultSubjectInfo;
41: this .defaultRole = defaultRole;
42: this .doAsCurrentCaller = doAsCurrentCaller;
43: isUseContextHandler = useContextHandler;
44: }
45:
46: public Map getPrincipalRoleMap() {
47: return principalRoleMap;
48: }
49:
50: public Map<String, SubjectInfo> getRoleDesignates() {
51: return roleDesignates;
52: }
53:
54: public SubjectInfo getDefaultSubjectInfo() {
55: return defaultSubjectInfo;
56: }
57:
58: public String getDefaultSubjectRealm() {
59: return defaultSubjectInfo == null ? null : defaultSubjectInfo
60: .getRealm();
61: }
62:
63: public String getDefaultSubjectId() {
64: return defaultSubjectInfo == null ? null : defaultSubjectInfo
65: .getId();
66: }
67:
68: public String getDefaultRole() {
69: return defaultRole;
70: }
71:
72: public boolean isDoAsCurrentCaller() {
73: return doAsCurrentCaller;
74: }
75:
76: public boolean isUseContextHandler() {
77: return isUseContextHandler;
78: }
79: }
|