Class SampleGroupProvider
- java.lang.Object
-
- org.sakaiproject.provider.authzGroup.SampleGroupProvider
-
- All Implemented Interfaces:
GroupProvider
public class SampleGroupProvider extends Object implements GroupProvider
Sample of a GroupProvider. Shows how to handle compound ids (connected with a '+').
To use, set an authzGroup's external id to one of the following:
- sakai.access
- sakai.maintain
- sakai.access+sakai.maintain
You should also have a user directory provider that recognizes the users:
- user1
- user
- user3
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_courseExternalIdThe external id for the "course" group.protected intm_courseStudentshow many students in the "course" group.protected HashSet<String>m_usersaA collection of user ids.protected HashSet<String>m_userscprotected HashSet<String>m_usersmprotected Propertiesm_usersxprotected Stringm_xFileConfiguration: the full file path to the external user grants file (optional).
-
Constructor Summary
Constructors Constructor Description SampleGroupProvider()Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Cleanup before shutting down.Map<String,String>getGroupRolesForUser(String userId)MapgetGroupRolesForUser(String userId, String acadEid)StringgetRole(String id, String user)Map<String,String>getUserRolesForGroup(String id)booleangroupExists(String arg0)voidinit()Final initialization, once all dependencies are set.StringpackId(String[] ids)StringpreferredRole(String one, String other)voidsetCourseExternalId(String value)Dependency - set the external id for the "course" group.voidsetCourseStudents(String count)Set how many students in the "course" groupvoidsetXFile(String value)Dependency - set the full file path to the optional external user grants file.String[]unpackId(String id)protected voidupdate()
-
-
-
Field Detail
-
m_xFile
protected String m_xFile
Configuration: the full file path to the external user grants file (optional).
-
m_courseExternalId
protected String m_courseExternalId
The external id for the "course" group.
-
m_courseStudents
protected int m_courseStudents
how many students in the "course" group.
-
m_usersx
protected Properties m_usersx
-
-
Method Detail
-
setXFile
public void setXFile(String value)
Dependency - set the full file path to the optional external user grants file.- Parameters:
value- The full file path to the external user grants file.
-
setCourseExternalId
public void setCourseExternalId(String value)
Dependency - set the external id for the "course" group.- Parameters:
value- The external id for the "course" site.
-
setCourseStudents
public void setCourseStudents(String count)
Set how many students in the "course" group- Parameters:
count- How many students in the "course" group
-
init
public void init()
Final initialization, once all dependencies are set.
-
destroy
public void destroy()
Cleanup before shutting down.
-
getRole
public String getRole(String id, String user)
- Specified by:
getRolein interfaceGroupProvider
-
getUserRolesForGroup
public Map<String,String> getUserRolesForGroup(String id)
- Specified by:
getUserRolesForGroupin interfaceGroupProvider
-
getGroupRolesForUser
public Map<String,String> getGroupRolesForUser(String userId)
- Specified by:
getGroupRolesForUserin interfaceGroupProvider
-
getGroupRolesForUser
public Map getGroupRolesForUser(String userId, String acadEid)
- Specified by:
getGroupRolesForUserin interfaceGroupProvider
-
packId
public String packId(String[] ids)
- Specified by:
packIdin interfaceGroupProvider
-
unpackId
public String[] unpackId(String id)
- Specified by:
unpackIdin interfaceGroupProvider
-
preferredRole
public String preferredRole(String one, String other)
- Specified by:
preferredRolein interfaceGroupProvider
-
update
protected void update()
-
groupExists
public boolean groupExists(String arg0)
- Specified by:
groupExistsin interfaceGroupProvider
-
-