public class BlogRightsSynchronizer extends Object
Note: this class is not thread-safe
Constructor and Description |
---|
BlogRightsSynchronizer(Long blogId,
String externalSystemId) |
Modifier and Type | Method and Description |
---|---|
void |
mergeRights(List<ExternalTopicRoleTO> rolesToSetOrUpdate,
List<ExternalTopicRoleTO> rolesToRemove)
Synchronize blog rights for an external system by merging them with the existing rights.
|
void |
replaceRights(List<ExternalTopicRoleTO> rolesToSet)
Synchronize the members of the blog by replacing the existing member roles that were assigned
for the external system with the provided members and there roles.
|
void |
replaceRights(String externalObjectId,
Map<String,BlogRole> externalUserRoles,
Map<String,BlogRole> externalGroupRoles)
Synchronize the members of the blog by replacing the existing member roles that were assigned
for the external system with the provided members and there roles.
|
public void mergeRights(List<ExternalTopicRoleTO> rolesToSetOrUpdate, List<ExternalTopicRoleTO> rolesToRemove) throws BlogAccessException, BlogNotFoundException
rolesToSetOrUpdate
- collection of entities and roles to add or updaterolesToRemove
- optional collection of entities to remove from the blog. If an entity is also
contained in the rolesToSetOrUpdate it will still be removed. The role member of
the TO is ignored.BlogAccessException
- in case the current user is not allowed to modify the blog access rights for the
external systemBlogNotFoundException
- in case the blog does not existpublic void replaceRights(List<ExternalTopicRoleTO> rolesToSet) throws BlogAccessException, BlogNotFoundException
rolesToSet
- collection of entities and roles to add or updateBlogAccessException
- in case the current user is not allowed to modify the blog access rights for the
external systemBlogNotFoundException
- in case the blog does not existpublic void replaceRights(String externalObjectId, Map<String,BlogRole> externalUserRoles, Map<String,BlogRole> externalGroupRoles) throws BlogAccessException, BlogNotFoundException
externalObjectId
- identifier of an external object that has to be assigned to the blog. If the
external object is not assigned the roles won't be synchronized.externalUserRoles
- mapping from the user identifier in the external system to the role to assignexternalGroupRoles
- mapping from the group identifier in the external system to the role to assignBlogAccessException
- in case the current user is not allowed to modify the blog access rights for the
external systemBlogNotFoundException
- in case the blog does not existCopyright © 2019 Communote team. All rights reserved.