KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > users > Group


1 /*
2 Copyright (c) 2003 eInnovation Inc. All rights reserved
3
4 This library is free software; you can redistribute it and/or modify it under the terms
5 of the GNU Lesser General Public License as published by the Free Software Foundation;
6 either version 2.1 of the License, or (at your option) any later version.
7
8 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the GNU Lesser General Public License for more details.
11 */

12
13 package com.openedit.users;
14
15 import java.util.Collection JavaDoc;
16 import java.util.Date JavaDoc;
17
18
19 /**
20  * This interface represents a group, which may have certain permissions.
21  *
22  * @author Eric Galluzzo
23  */

24 public interface Group extends PropertyContainer
25 {
26     /**
27      * The name of this group.
28      *
29      * @return The group name.
30      */

31     String JavaDoc getName();
32     
33     /**
34      * Retrieve the date/time at which this group was created.
35      *
36      * @return The creation date
37      */

38     Date JavaDoc getCreationDate();
39
40     /**
41      * Retrieve all the names of permissions that this group grants.
42      *
43      * @return A collection of <code>String</code>s
44      */

45     Collection JavaDoc getPermissions();
46
47     /**
48      * Add the given permission to this group. If the permission is already part of this group,
49      * this method does nothing.
50      *
51      * @param inPermission The name of the permission to add
52      *
53      * @throws UserManagerException If the permission could not be added
54      */

55     void addPermission(String JavaDoc inPermission) throws UserManagerException;
56
57     
58     /**
59      * Determine whether this group has the given permission.
60      *
61      * @param inPermission The name of the permission
62      *
63      * @return <code>true</code> if so, <code>false</code> if not
64      */

65     boolean hasPermission(String JavaDoc inPermission);
66
67     /**
68      * Remove the given permission from this group. If the permission is not part of this group,
69      * this method does nothing.
70      *
71      * @param inPermission The name of the permission to remove
72      *
73      * @throws UserManagerException If the permission could not be removed
74      */

75     void removePermission(String JavaDoc inPermission) throws UserManagerException;
76
77     public PropertyContainer getPropertyContainer();
78     
79     public long getLastModified();
80     
81
82 }
83
Popular Tags