KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > policyframework > AccessRights


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.policyframework;
21
22 import java.io.Serializable JavaDoc;
23 import java.util.List JavaDoc;
24
25 /**
26  * An interface for a list of access rights and rules,
27  *
28  * @author James D Robinson <a HREF="mailto:james@3sp.com">&lt;james@3sp.com&gt;</a>
29  *
30  */

31 public interface AccessRights extends Resource, Serializable JavaDoc {
32
33     /**
34      * Add a {@link AccessRight} to this delegation resource
35      *
36      * @param perm permission to add
37      */

38     public void addAccessRight(AccessRight perm);
39
40     /**
41      * Remove a {@link AccessRight} from this delegation resource
42      *
43      * @param perm permission to remove
44      */

45     public void removeAccessRight(AccessRight perm);
46
47     /**
48      * Get a {@link List} of all permissions this resource permission has.
49      *
50      * @return permissions
51      */

52     public List JavaDoc getAccessRights();
53
54     /**
55      * Set the resource ID. You should never need to call this directly as the
56      * database will do it when creating a resource permission
57      *
58      * @param id id
59      */

60     public void setResourceId(int id);
61
62     /**
63      * Get the permission class. Will be one of {@link AccessRight}
64      *
65      * @return String
66      */

67     public String JavaDoc getAccessRightsClass();
68
69     /**
70      * Get any rules associated with this resource
71      *
72      * @return rules
73      */

74     public List JavaDoc getRules();
75
76     /**
77      * Add a rule to this resource
78      *
79      * @param rule rule to add
80      */

81     public void addRule(Rule rule);
82
83     /**
84      * Remove a rule from this resource
85      *
86      * @param rule rule to remove
87      */

88     public void removeRule(Rule rule);
89
90     /**
91      * Get if this resource permission contains the specified permission
92      *
93      * @param accessRight resource type resource permission wrapper
94      * @return contains permission
95      */

96     public boolean containsAccessRight(AccessRight accessRight);
97
98 }
99
Popular Tags