KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > usermanager > JahiaGroupManagerProvider


1 package org.jahia.services.usermanager;
2
3 import org.jahia.data.JahiaDOMObject;
4 import org.jahia.exceptions.JahiaException;
5 import org.jahia.services.JahiaService;
6
7 import java.util.Properties JavaDoc;
8 import java.util.Vector JavaDoc;
9
10 /**
11  * <p>Title: </p>
12  * <p>Description: </p>
13  * <p>Copyright: Copyright (c) 2003</p>
14  * <p>Company: </p>
15  *
16  * @author Predrag Viceic <Predrag.Viceic@ci.unil.ch>
17  * @version 1.0
18  */

19
20 public abstract class JahiaGroupManagerProvider extends JahiaService {
21
22 //-------------------------------------------------------------------------
23
/**
24      * Create a new group in the system.
25      *
26      * @param int siteID the site owner of this user
27      * @param groupname Group's unique identification name
28      *
29      * @return Retrun a reference on a group object on success, or if the groupname
30      * already exists or another error occured, null is returned.
31      */

32     public abstract JahiaGroup createGroup (int siteID, String JavaDoc name, Properties JavaDoc properties);
33
34     //-------------------------------------------------------------------------
35
/**
36      * Lookup the group information from the underlaying system (DB, LDAP, ... )
37      * Try to lookup the group into the cache, if it's not in the cache, then
38      * load it into the cahce from the database.
39      *
40      * @param int siteID the site id
41      * @param name Group's unique identification name.
42      *
43      * @return Return a reference on a the specified group name. Return null
44      * if the group doesn't exist or when any error occured.
45      */

46     public abstract JahiaGroup lookupGroup (int siteID, String JavaDoc name);
47
48     /**
49      * Lookup the group information from the underlaying system (DB, LDAP, ... )
50      * Try to lookup the group into the cache, if it's not in the cache, then
51      * load it into the cahce from the database.
52      *
53      * @param String groupKey Group's unique identification key.
54      *
55      * @return Return a reference on a the specified group name. Return null
56      * if the group doesn't exist or when any error occured.
57      */

58     public abstract JahiaGroup lookupGroup (String JavaDoc groupKey);
59
60     /**
61      * This function checks on a gived site if the groupname has already been
62      * assigned to another group.
63      *
64      * @param int siteID the site id
65      * @param groupname String representing the unique group name.
66      *
67      * @return Return true if the specified username has not been assigned yet,
68      * return false on any failure.
69      */

70     public abstract boolean groupExists (int siteID, String JavaDoc name);
71
72     /**
73      * Remove the specified user from all the membership lists of all the groups.
74      *
75      * @param user Reference on an existing user.
76      *
77      * @return Return true on success, or false on any failure.
78      */

79     public abstract boolean removeUserFromAllGroups (JahiaUser user);
80
81     /**
82      * Return a <code>Vector</code) of <code>String</code> representing all the
83      * group names.
84      *
85      * @return Return a vector of strings containing all the group names.
86      */

87     public abstract Vector JavaDoc getGroupnameList ();
88
89     /**
90      * Return a <code>Vector</code) of <code>String</code> representing all the
91      * group names of a site.
92      *
93      * @param int the site id
94      *
95      * @return Return a vector of strings containing all the group names.
96      */

97     public abstract Vector JavaDoc getGroupnameList (int siteID);
98
99     /**
100      * Return a <code>Vector</code) of <code>String</code> representing all the
101      * group keys of a site.
102      *
103      * @param int the site id
104      *
105      * @return Return a vector of identifier of all groups of this site.
106      *
107      * @auhtor NK
108      */

109     public abstract Vector JavaDoc getGroupList (int siteID);
110
111     /**
112      * Return a <code>Vector</code) of <code>String</code> representing all the
113      * group keys of a site.
114      *
115      * @param int the site id
116      *
117      * @return Return a vector of identifier of all groups of this site.
118      *
119      * @auhtor NK
120      */

121     public abstract Vector JavaDoc getGroupList ();
122
123     /**
124      * Return the list of groups to which the specified user has access.
125      *
126      * @param user Valid reference on an existing group.
127      *
128      * @return Return a vector of strings holding all the group names to
129      * which the user as access. On any error, the returned vector
130      * might be null.
131      */

132     public abstract Vector JavaDoc getUserMembership (JahiaUser user);
133
134     /**
135      *
136      */

137     public abstract JahiaGroup getAdministratorGroup (int siteID);
138
139     /**
140      * Get all JahiaSite objects where the user has an access.
141      *
142      * @param JahiaUser user, the user you want to get his access grantes sites list.
143      *
144      * @return Return a vector containing all JahiaSite objects where the user has an access.
145      *
146      * @author Alexandre Kraft
147      */

148     public abstract Vector JavaDoc getAdminGrantedSites (JahiaUser user) throws JahiaException;
149
150     /**
151      * Return an instance of the users group.
152      *
153      * @return Return the instance of the users group. Return null on any failure
154      */

155     public abstract JahiaGroup getUsersGroup (int siteID);
156
157     /**
158      * Return an instance of the guest group
159      *
160      * @return Return the instance of the guest group. Return null on any failure.
161      */

162     public abstract JahiaGroup getGuestGroup (int siteID);
163
164     /**
165      * return a DOM document of all groups of a site
166      *
167      * @param int the site id
168      *
169      * @return JahiaDOMObject a DOM representation of this object
170      *
171      * @author NK
172      */

173     public abstract JahiaDOMObject getGroupsAsDOM (int siteID) throws JahiaException;
174
175     /**
176      * return a DOM document of all group props of a site
177      *
178      * @param int the site id
179      *
180      * @return JahiaDOMObject a DOM representation of this object
181      *
182      * @author NK
183      */

184     public abstract JahiaDOMObject getGroupPropsAsDOM (int siteID) throws JahiaException;
185
186     /**
187      * return a DOM document of all application role groups of a site
188      *
189      * @param int the site id
190      *
191      * @return JahiaDOMObject a DOM representation of this object
192      *
193      * @author NK
194      */

195     public abstract JahiaDOMObject getAppRoleGroupsAsDOM (int siteID) throws JahiaException;
196
197     /**
198      * return a DOM document of all user group access for a site
199      *
200      * @param int the site id
201      *
202      * @return JahiaDOMObject a DOM representation of this object
203      *
204      * @author NK
205      */

206     public abstract JahiaDOMObject getUserGroupAccessAsDOM (int siteID) throws JahiaException;
207
208     /**
209      * return a DOM document of all application group access for a site
210      * Here users and groups have access to application role groups ( not normal groups )
211      *
212      * @param int the site id
213      *
214      * @return JahiaDOMObject a DOM representation of this object
215      *
216      * @author NK
217      */

218     public abstract JahiaDOMObject getAppGroupAccessAsDOM (int siteID) throws JahiaException;
219
220     /**
221      * This method indicates that any internal cache for a provider should be
222      * updated because the value has changed and needs to be transmitted to the
223      * other nodes in a clustering environment.
224      * @param jahiaGroup JahiaGroup the group to be updated in the cache.
225      */

226     public abstract void updateCache(JahiaGroup jahiaGroup);
227
228 }
229
Popular Tags