Interface Directories
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
AdminGroups
Groups may be stored in a site specific manner so the actual implementation used is a build-time configuration option. They may be ldap directory based or implemented by storing in the calendar database.
Methods may throw an unimplemented exception if functions are not available.
- Version:
- 3.3.2
- Author:
- Mike Douglass douglm rpi.edu
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classClass to be implemented by caller and passed during init. -
Method Summary
Modifier and TypeMethodDescriptionIf this is a valid user principal return the account.voidAdd a groupvoidaddMember(BwGroup<?> group, BwPrincipal<?> val) Add a principal to a groupBwPrincipal<?>caladdrToPrincipal(String caladdr) Given a calendar address return the associated calendar account.Return principals tha match the CUA.find(List<org.bedework.webdav.servlet.shared.WebdavProperty> props, List<org.bedework.webdav.servlet.shared.WebdavProperty> returnProps, String cutype, javax.xml.ws.Holder<Boolean> truncated) Return matching principals.BwGroup<?>Find a group given its nameCollection<BwGroup<?>>findGroupParents(BwGroup<?> group) Collection<BwGroup<?>>getAll(boolean populate) Return all groups to which this user has some access.Collection<BwGroup<?>>getAllGroups(BwPrincipal<?> val) Return all groups of which the given principal is a member.Return the name of the configuration properties for the module, e.g "module.user-ldap-group" or "module.dir-config"Needed for the ischedule serviceGet application visible directory information.getDirInfo(BwPrincipal<?> p) Return some sort of directory information for the given principal.booleanShow whether entries can be modified with this class.The urls should be principal urls.Collection<BwGroup<?>>getGroups(BwPrincipal<?> val) Return all groups of which the given principal is a member.voidgetMembers(BwGroup<?> group) Populate the group with a (possibly empty) Collection of members.BwPrincipal<?>getPrincipal(String href) Return principal for the given href.voidinit(Directories.CallBack cb, Configurations configs) Provide the callback objectbooleanisPrincipal(String val) Does the value appear to represent a valid principal?makePrincipalUri(String id, int whoType) booleanmergePreferences(BwPreferences prefs, BwPrincipalInfo pinfo) Uses the values in pinfo to update the supplied preferences.normalizeCua(String val) Ensure we have something that looks like a valid calendar user address.principalToCaladdr(BwPrincipal<?> val) Given a user principal return a calendar address.voidremoveGroup(BwGroup<?> group) Delete a groupvoidremoveMember(BwGroup<?> group, BwPrincipal<?> val) Remove a member from a groupvoidupdateGroup(BwGroup<?> group) update a group.uriToCaladdr(String val) Given a uri return a calendar address.userToCaladdr(String val) Given a user account return a calendar address.booleanvalidPrincipal(String href) Test for a valid principal in the directory.
-
Method Details
-
init
Provide the callback object- Parameters:
cb- callbackconfigs- Configuratiosn object
-
getConfigName
String getConfigName()Return the name of the configuration properties for the module, e.g "module.user-ldap-group" or "module.dir-config"- Returns:
- String
-
getDirectoryInfo
DirectoryInfo getDirectoryInfo()Get application visible directory information.- Returns:
- DirectoryInfo
-
validPrincipal
Test for a valid principal in the directory. This may have a number of uses. For example, when organizing meetings we may want to send an invitation to a user who has not yet logged on. This allows us to distinguish between a bad account (spam maybe?) and a real account.Sites may wish to override this method to check their directory to see if the principal exists.
- Parameters:
href- of principal- Returns:
- true if it's a valid principal
-
isPrincipal
Does the value appear to represent a valid principal?- Parameters:
val- href of principal- Returns:
- true if it's a (possible) principal
-
accountFromPrincipal
If this is a valid user principal return the account.- Parameters:
val- href of principal- Returns:
- account or null if not valid user principal
-
getPrincipal
Return principal for the given href.- Parameters:
href- ofprincipal- Returns:
- Principal
- Throws:
CalFacadeException
-
getDefaultDomain
String getDefaultDomain()Needed for the ischedule service- Returns:
- the default domain for the service.
-
getGroups
The urls should be principal urls. principalUrl can null for the current user. The result is a collection of principal urls of which the given url is a member, based upon rootUrl. For example, if rootUrl points to the base of the user principal hierarchy, then the rsult should be at least the current user's principal url, remembering that user principals are themselves groups and the user is considered a member of their own group.- Parameters:
rootUrl- - url to base search on.principalUrl- - url of principal or null for current user- Returns:
- Collection of urls - always non-null
- Throws:
CalFacadeException
-
makePrincipalUri
- Parameters:
id- accountwhoType- - from WhoDefs- Returns:
- String principal uri
-
uriToCaladdr
Given a uri return a calendar address. This should handle actions such as turning
auser
into the associated calendar address of
mailto:auser@ahost.orgIt should also deal with user@somewhere.org to mailto:user@somewhere.org
Note: this method and userToCalAddr should be doing lookups of the enterprise directory (or carddav) to determine the calendar user address. For the moment we do a transform of the account to get a mailto.
- Parameters:
val- uri- Returns:
- caladdr for this system or null for an invalid uri
-
principalToCaladdr
Given a user principal return a calendar address.- Parameters:
val- principal- Returns:
- caladdr
-
userToCaladdr
Given a user account return a calendar address. For example, we might have an account
auser
with the associated calendar address of
mailto:auser@ahost.orgNote: this method and uriToCalAddr should be doing lookups of the enterprise directory (or carddav) to determine the calendar user address. For the moment we do a transform of the account to get a mailto.
- Parameters:
val- account- Returns:
- caladdr for this system
- Throws:
RuntimeException- for errors
-
caladdrToPrincipal
Given a calendar address return the associated calendar account. For example, we might have a calendar address
mailto:auser@ahost.org
with the associated account of
auser
We also allow user principals
Wherever we need a user account use the converted value. Call userToCaladdr for the inverse.
- Parameters:
caladdr- calendar address- Returns:
- account or null if not caladdr for this system
-
normalizeCua
Ensure we have something that looks like a valid calendar user address. Could be a mailto: or a principal- Parameters:
val- String potential calendar user address- Returns:
- String valid or null invalid.
- Throws:
CalFacadeException
-
getDirInfo
Return some sort of directory information for the given principal.- Parameters:
p- principal for which we want info- Returns:
- BwPrincipalInfo directory information.
- Throws:
CalFacadeException
-
find
List<BwPrincipalInfo> find(List<org.bedework.webdav.servlet.shared.WebdavProperty> props, List<org.bedework.webdav.servlet.shared.WebdavProperty> returnProps, String cutype, javax.xml.ws.Holder<Boolean> truncated) Return matching principals.- Parameters:
props- to matchreturnProps- used to configure returned datacutype- null - or typetruncated- value is true if result is incomplete- Returns:
- BwPrincipalInfo objects that match.
-
find
List<BwPrincipalInfo> find(String cua, String cutype, boolean expand, javax.xml.ws.Holder<Boolean> truncated) Return principals tha match the CUA.- Parameters:
cua- a calendar user addresscutype- individual, group etc (null for individual)expand- if true expand any groups so that the info contains group member info.- Returns:
- BwPrincipalInfo objects that match.
-
mergePreferences
Uses the values in pinfo to update the supplied preferences. This may be a site specific operation. It allows bedework to use directory information to alter the behavior of principals. For example, we can define resources in a directory and the auto-respond behavior will be turned on in bedework scheduling.- Parameters:
prefs-pinfo-- Returns:
- boolean true if preferences updated
- Throws:
CalFacadeException
-
getGroups
Return all groups of which the given principal is a member. Never returns null.Does not check the returned groups for membership of other groups.
- Parameters:
val- a principal- Returns:
- Collection of BwGroup
- Throws:
CalFacadeException
-
getAllGroups
Return all groups of which the given principal is a member. Never returns null.This does check the groups for membership of other groups so the returned collection gives the groups of which the principal is directly or indirectly a member.
- Parameters:
val- a principal- Returns:
- Collection of BwGroup
- Throws:
CalFacadeException
-
getGroupMaintOK
boolean getGroupMaintOK()Show whether entries can be modified with this class. Some sites may use other mechanisms.- Returns:
- boolean true if group maintenance is implemented.
-
getAll
Return all groups to which this user has some access. Never returns null.- Parameters:
populate- boolean populate with members- Returns:
- Collection of BwGroup
- Throws:
CalFacadeException
-
getMembers
Populate the group with a (possibly empty) Collection of members. Does not populate groups which are members.- Parameters:
group- BwGroup group object to add- Throws:
CalFacadeException
-
addGroup
Add a group- Parameters:
group- BwGroup group object to add- Throws:
CalFacadeException- If there's a problem
-
findGroup
Find a group given its name- Parameters:
name- String group name- Returns:
- BwGroup group object
- Throws:
RuntimeException- If there's a problem
-
addMember
Add a principal to a group- Parameters:
group- a group principalval- BwPrincipal new member- Throws:
CalFacadeException- For invalid usertype values.
-
removeMember
Remove a member from a group- Parameters:
group- a group principalval- BwPrincipal new member- Throws:
CalFacadeException- For invalid usertype values.
-
removeGroup
Delete a group- Parameters:
group- BwGroup group object to delete- Throws:
CalFacadeException- If there's a problem
-
updateGroup
update a group. This may have no meaning in some directories.- Parameters:
group- BwGroup group object to update- Throws:
CalFacadeException- If there's a problem
-
findGroupParents
- Parameters:
group-- Returns:
- Collection
- Throws:
CalFacadeException
-
getAdminGroupsIdPrefix
String getAdminGroupsIdPrefix()- Returns:
- String used to prefix administrative group names to distinguish them from user group names.
-