KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > connectors > authentication > RuntimeSecurityMap


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.connectors.authentication;
25
26 import java.util.HashMap JavaDoc;
27
28 /**
29  * @author ko133006
30  */

31 public class RuntimeSecurityMap {
32
33     private HashMap JavaDoc userMap;
34
35     private HashMap JavaDoc groupMap;
36
37     public RuntimeSecurityMap() {
38         this.userMap = new HashMap JavaDoc();
39         this.groupMap = new HashMap JavaDoc();
40     }
41
42     public RuntimeSecurityMap(HashMap JavaDoc userMap, HashMap JavaDoc groupMap) {
43         this.userMap = (HashMap JavaDoc) userMap.clone();
44         this.groupMap = (HashMap JavaDoc) groupMap.clone();
45     }
46
47     public boolean equals(RuntimeSecurityMap map) {
48         if (!(map.userMap.equals(this.userMap)))
49             return false;
50         else if (!(map.groupMap.equals(this.groupMap)))
51             return false;
52         else
53             return true;
54     }
55
56     public String JavaDoc toString() {
57         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
58         // implement
59
return sb.toString();
60     }
61
62     public boolean isEmpty() {
63         if ((this.userMap.size() == 0) && (this.groupMap.size() == 0))
64             return true;
65         else
66             return false;
67     }
68
69     public HashMap JavaDoc getUserMap() {
70         return (HashMap JavaDoc) ((this.userMap).clone());
71     }
72
73     public HashMap JavaDoc getGroupMap() {
74         return (HashMap JavaDoc) ((this.groupMap).clone());
75     }
76
77 }
78
Popular Tags