KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > security > auth > login > PolicyConfig


1 /*
2 * JBoss, the OpenSource J2EE webOS
3 *
4 * Distributable under LGPL license.
5 * See terms of license at gnu.org.
6 */

7 package org.jboss.security.auth.login;
8
9 import java.util.Collections JavaDoc;
10 import java.util.Map JavaDoc;
11 import java.util.HashMap JavaDoc;
12 import java.util.ArrayList JavaDoc;
13 import java.util.Set JavaDoc;
14
15 /** The root object for the login-config.xml descriptor as defined by the
16  * security-config_4_0.xsd.
17  *
18  * @author Scott.Stark@jboss.org
19  * @version $Revision: 1.1.2.1 $
20  */

21 public class PolicyConfig
22 {
23    Map JavaDoc config = Collections.synchronizedMap(new HashMap JavaDoc());
24
25    public void add(AuthenticationInfo authInfo)
26    {
27       config.put(authInfo.getName(), authInfo);
28    }
29    public AuthenticationInfo get(String JavaDoc name)
30    {
31       AuthenticationInfo info = (AuthenticationInfo) config.get(name);
32       return info;
33    }
34    public AuthenticationInfo remove(String JavaDoc name)
35    {
36       AuthenticationInfo info = (AuthenticationInfo) config.remove(name);
37       return info;
38    }
39    public void clear()
40    {
41       config.clear();
42    }
43    public Set JavaDoc getConfigNames()
44    {
45       return config.keySet();
46    }
47    public int size()
48    {
49       return config.size();
50    }
51    public boolean containsKey(String JavaDoc name)
52    {
53       return config.containsKey(name);
54    }
55    public void copy(PolicyConfig pc)
56    {
57       config.putAll(pc.config);
58    }
59 }
60
Popular Tags