KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > cms > security > auth > PrincipalCollection


1 /**
2  *
3  * Magnolia and its source-code is licensed under the LGPL.
4  * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5  * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6  * you are required to provide proper attribution to obinary.
7  * If you reproduce or distribute the document without making any substantive modifications to its content,
8  * please use the following attribution line:
9  *
10  * Copyright 1993-2006 obinary Ltd. (http://www.obinary.com) All rights reserved.
11  *
12  */

13 package info.magnolia.cms.security.auth;
14
15 import java.io.Serializable JavaDoc;
16 import java.security.Principal JavaDoc;
17 import java.util.Collection JavaDoc;
18
19
20 /**
21  * @author Sameer Charles $Id: PrincipalCollection.java 6341 2006-09-12 09:18:27Z philipp $
22  */

23 public interface PrincipalCollection extends Principal JavaDoc, Serializable JavaDoc {
24
25     public String JavaDoc getName();
26
27     /**
28      * Set this principal name
29      */

30     public void setName(String JavaDoc name);
31
32     /**
33      * Set collection
34      * @param collection
35      */

36     public void set(Collection JavaDoc collection);
37
38     /**
39      * Add to collection
40      * @param principal to be added to the collection
41      */

42     public void add(Principal JavaDoc principal);
43
44     /**
45      * Remove from the collection
46      * @param principal to be removed from the collection
47      */

48     public void remove(Principal JavaDoc principal);
49
50     /**
51      * Clear collection
52      */

53     public void clearAll();
54
55     /**
56      * Check if this collection contains specified object
57      * @param principal
58      * @return true if the specified object exist in the collection
59      */

60     public boolean contains(Principal JavaDoc principal);
61
62     /**
63      * Checks if this collection contains object with the specified name
64      * @param name
65      * @return true if the collection contains the principal by the specified name
66      */

67     public boolean contains(String JavaDoc name);
68
69     /**
70      * Get principal associated to the specified name from the collection
71      * @param name
72      * @return principal object associated to the specified name
73      */

74     public Principal JavaDoc get(String JavaDoc name);
75
76 }
77
Popular Tags