KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > security > AuthorizationModule


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 package org.infoglue.cms.security;
25
26 import java.util.List JavaDoc;
27 import java.util.Properties JavaDoc;
28
29 import org.infoglue.cms.entities.management.GroupVO;
30 import org.infoglue.cms.entities.management.RoleVO;
31 import org.infoglue.cms.entities.management.SystemUserVO;
32 import org.infoglue.cms.exception.Bug;
33 import org.infoglue.cms.exception.SystemException;
34
35 /**
36  * This interface defines what a autorizationModule has to fulfill.
37  *
38  * @author Mattias Bogeblad
39  */

40
41 public interface AuthorizationModule
42 {
43     /**
44      * Gets is the implementing class can update as well as read
45      */

46     
47     public boolean getSupportUpdate();
48     
49     /**
50      * Gets is the implementing class can delete as well as read
51      */

52     
53     public boolean getSupportDelete();
54     
55     /**
56      * Gets is the implementing class can create as well as read
57      */

58     
59     public boolean getSupportCreate();
60
61     /**
62      * Gets an authorized InfoGluePrincipal
63      */

64     
65     public InfoGluePrincipal getAuthorizedInfoGluePrincipal(String JavaDoc userName) throws Exception JavaDoc;
66     
67     /**
68      * Gets an InfoGlueRole
69      */

70     
71     public InfoGlueRole getAuthorizedInfoGlueRole(String JavaDoc roleName) throws Exception JavaDoc;
72
73     /**
74      * Gets an InfoGlueGroup
75      */

76     
77     public InfoGlueGroup getAuthorizedInfoGlueGroup(String JavaDoc groupName) throws Exception JavaDoc;
78
79     /**
80      * This method is used to fetch a users roles.
81      */

82
83     public List JavaDoc authorizeUser(String JavaDoc userName) throws Exception JavaDoc;
84
85     /**
86      * This method is used to fetch all available roles.
87      */

88
89     public List JavaDoc getRoles() throws Exception JavaDoc;
90
91     /**
92      * This method is used to fetch all available groups.
93      */

94
95     public List JavaDoc getGroups() throws Exception JavaDoc;
96
97     /**
98      * This method is used to fetch all users.
99      */

100
101     public List JavaDoc getUsers() throws Exception JavaDoc;
102
103     /**
104      * This method is used to fetch all users part of the named role.
105      * @deprecated
106      */

107
108     public List JavaDoc getUsers(String JavaDoc roleName) throws Exception JavaDoc;
109     
110     /**
111      * This method is used to fetch all users part of the named role.
112      */

113
114     public List JavaDoc getRoleUsers(String JavaDoc roleName) throws Exception JavaDoc;
115
116     /**
117      * This method is used to fetch all users part of the named group.
118      */

119
120     public List JavaDoc getGroupUsers(String JavaDoc groupName) throws Exception JavaDoc;
121
122     /**
123      * This method is used to get a filtered list of all users.
124      * @param firstName
125      * @param lastName
126      * @param userName
127      * @param email
128      * @param roleIds
129      * @return
130      * @throws SystemException
131      * @throws Bug
132      */

133     
134     public List JavaDoc getFilteredUsers(String JavaDoc firstName, String JavaDoc lastName, String JavaDoc userName, String JavaDoc email, String JavaDoc[] roleIds) throws Exception JavaDoc;
135
136     /**
137      * This method is used to create a new user.
138      */

139
140     public void createInfoGluePrincipal(SystemUserVO systemUserVO) throws Exception JavaDoc;
141
142     /**
143      * This method is used to update an existing user.
144      */

145
146     public void updateInfoGluePrincipal(SystemUserVO systemUserVO, String JavaDoc[] roleNames, String JavaDoc[] groupNames) throws Exception JavaDoc;
147
148     /**
149      * This method is used to send out a newpassword to an existing users.
150      */

151
152     public void updateInfoGluePrincipalPassword(String JavaDoc userName) throws Exception JavaDoc;
153
154     /**
155      * This method is used to send out a newpassword to an existing users.
156      */

157
158     public void updateInfoGluePrincipalPassword(String JavaDoc userName, String JavaDoc oldPassword, String JavaDoc newPassword) throws Exception JavaDoc;
159
160     /**
161      * This method is used to delete an existing user.
162      */

163
164     public void deleteInfoGluePrincipal(String JavaDoc userName) throws Exception JavaDoc;
165
166
167     /**
168      * This method is used to create a new rol.
169      */

170
171     public void createInfoGlueRole(RoleVO roleVO) throws Exception JavaDoc;
172
173     /**
174      * This method is used to update an existing role.
175      */

176
177     public void updateInfoGlueRole(RoleVO roleVO, String JavaDoc[] userNames) throws Exception JavaDoc;
178
179     /**
180      * This method is used to delete an existing role.
181      */

182
183     public void deleteInfoGlueRole(String JavaDoc roleName) throws Exception JavaDoc;
184
185
186     /**
187      * This method is used to create a new group.
188      */

189
190     public void createInfoGlueGroup(GroupVO groupVO) throws Exception JavaDoc;
191
192     /**
193      * This method is used to update an existing group.
194      */

195
196     public void updateInfoGlueGroup(GroupVO roleVO, String JavaDoc[] userNames) throws Exception JavaDoc;
197
198     /**
199      * This method is used to delete an existing group.
200      */

201
202     public void deleteInfoGlueGroup(String JavaDoc groupName) throws Exception JavaDoc;
203
204     public Properties JavaDoc getExtraProperties();
205
206     public void setExtraProperties(Properties JavaDoc properties);
207     
208     public void setTransactionObject(Object JavaDoc transactionObject);
209     
210     public Object JavaDoc getTransactionObject();
211 }
Popular Tags