Package org.nuxeo.scim.v2.service
Class DefaultScimV2Mapping
java.lang.Object
org.nuxeo.scim.v2.service.DefaultScimV2Mapping
- All Implemented Interfaces:
ScimV2Mapping
- Since:
- 2023.14
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionafterCreateGroup
(DocumentModel groupModel, com.unboundid.scim2.common.types.GroupResource groupResource) Hook to be executed after a group is created.afterCreateUser
(DocumentModel userModel, com.unboundid.scim2.common.types.UserResource userResource) Hook to be executed after a user is created.afterUpdateGroup
(DocumentModel groupModel, com.unboundid.scim2.common.types.GroupResource groupResource) Hook to be executed after a group is updated.afterUpdateUser
(DocumentModel userModel, com.unboundid.scim2.common.types.UserResource userResource) Hook to be executed after a user is updated.beforeCreateGroup
(DocumentModel groupModel, com.unboundid.scim2.common.types.GroupResource groupResource) Hook to be executed before a group is created.beforeCreateUser
(DocumentModel userModel, com.unboundid.scim2.common.types.UserResource userResource) Hook to be executed before a user is created.beforeUpdateGroup
(DocumentModel groupModel, com.unboundid.scim2.common.types.GroupResource groupResource) Hook to be executed before a group is updated.beforeUpdateUser
(DocumentModel userModel, com.unboundid.scim2.common.types.UserResource userResource) Hook to be executed before a user is updated.getGroupAttributeName
(String column, Object filterValue) Gets the Nuxeo group model attribute name matching the SCIM attribute name used in SCIM Search filtering and sorting.getGroupMemberAttributeName
(String scimAttribute, Object filterValue) Gets the Nuxeo group model attribute name matching the SCIM attribute name used in SCIM patch request path filtering.com.unboundid.scim2.common.types.GroupResource
getGroupResourceFromNuxeoGroup
(DocumentModel groupModel, String baseURL) Gets a group resource representation of a group model.getUserAttributeName
(String column, Object filterValue) Gets the Nuxeo user model attribute name matching the SCIM attribute name used in SCIM Search filtering and sorting.getUserMemberAttributeName
(String scimAttribute, Object filterValue) Gets the Nuxeo user model attribute name matching the SCIM attribute name used in SCIM patch request path filtering.com.unboundid.scim2.common.types.UserResource
getUserResourceFromNuxeoUser
(DocumentModel userModel, String baseURL) Gets a user resource representation of a user model.protected com.unboundid.scim2.common.types.UserResource
newUserResource
(String userId, String baseURL) patchGroup
(DocumentModel groupModel, com.unboundid.scim2.common.types.GroupResource groupResource) Hook to be executed when a group is patched using JSON patch.protected void
setEmail
(List<com.unboundid.scim2.common.types.Email> emails, DocumentModel userModel, String userSchemaName) protected void
setName
(com.unboundid.scim2.common.types.Name name, DocumentModel userModel, String userSchemaName) protected DocumentModel
updateNuxeoGroupFromGroupResource
(DocumentModel groupModel, com.unboundid.scim2.common.types.GroupResource groupResource) protected DocumentModel
updateNuxeoUserFromUserResource
(DocumentModel userModel, com.unboundid.scim2.common.types.UserResource userResource)
-
Field Details
-
EMAIL
- See Also:
-
FIRST_NAME
- See Also:
-
LAST_NAME
- See Also:
-
-
Constructor Details
-
DefaultScimV2Mapping
public DefaultScimV2Mapping()
-
-
Method Details
-
afterCreateGroup
public DocumentModel afterCreateGroup(DocumentModel groupModel, com.unboundid.scim2.common.types.GroupResource groupResource) Description copied from interface:ScimV2Mapping
Hook to be executed after a group is created.- Specified by:
afterCreateGroup
in interfaceScimV2Mapping
- Parameters:
groupModel
- the created group modelgroupResource
- the group resource from which the group model is created- Returns:
- the created group model
-
afterCreateUser
public DocumentModel afterCreateUser(DocumentModel userModel, com.unboundid.scim2.common.types.UserResource userResource) Description copied from interface:ScimV2Mapping
Hook to be executed after a user is created.- Specified by:
afterCreateUser
in interfaceScimV2Mapping
- Parameters:
userModel
- the created user modeluserResource
- the user resource from which the user model is created- Returns:
- the created user model
-
afterUpdateGroup
public DocumentModel afterUpdateGroup(DocumentModel groupModel, com.unboundid.scim2.common.types.GroupResource groupResource) Description copied from interface:ScimV2Mapping
Hook to be executed after a group is updated.- Specified by:
afterUpdateGroup
in interfaceScimV2Mapping
- Parameters:
groupModel
- the updated group modelgroupResource
- the group resource from which the group model is updated- Returns:
- the updated group model
-
afterUpdateUser
public DocumentModel afterUpdateUser(DocumentModel userModel, com.unboundid.scim2.common.types.UserResource userResource) Description copied from interface:ScimV2Mapping
Hook to be executed after a user is updated.- Specified by:
afterUpdateUser
in interfaceScimV2Mapping
- Parameters:
userModel
- the created user modeluserResource
- the user resource from which the user model is updated- Returns:
- the updated user model
-
beforeCreateGroup
public DocumentModel beforeCreateGroup(DocumentModel groupModel, com.unboundid.scim2.common.types.GroupResource groupResource) throws com.unboundid.scim2.common.exceptions.ScimException Description copied from interface:ScimV2Mapping
Hook to be executed before a group is created.- Specified by:
beforeCreateGroup
in interfaceScimV2Mapping
- Parameters:
groupModel
- the group model about to be createdgroupResource
- the group resource from which the group model is created- Returns:
- the created group model
- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- if an error occurred
-
beforeCreateUser
public DocumentModel beforeCreateUser(DocumentModel userModel, com.unboundid.scim2.common.types.UserResource userResource) Description copied from interface:ScimV2Mapping
Hook to be executed before a user is created.- Specified by:
beforeCreateUser
in interfaceScimV2Mapping
- Parameters:
userModel
- the user model about to be createduserResource
- the user resource from which the user model is created- Returns:
- the created user model
-
beforeUpdateGroup
public DocumentModel beforeUpdateGroup(DocumentModel groupModel, com.unboundid.scim2.common.types.GroupResource groupResource) throws com.unboundid.scim2.common.exceptions.ScimException Description copied from interface:ScimV2Mapping
Hook to be executed before a group is updated.- Specified by:
beforeUpdateGroup
in interfaceScimV2Mapping
- Parameters:
groupModel
- the group model about to be updatedgroupResource
- the group resource from which the group model is updated- Returns:
- the updated group model
- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- if an error occurred
-
beforeUpdateUser
public DocumentModel beforeUpdateUser(DocumentModel userModel, com.unboundid.scim2.common.types.UserResource userResource) Description copied from interface:ScimV2Mapping
Hook to be executed before a user is updated.- Specified by:
beforeUpdateUser
in interfaceScimV2Mapping
- Parameters:
userModel
- the user model about to be updateduserResource
- the user resource from which the user model is updated- Returns:
- the updated user model
-
getGroupResourceFromNuxeoGroup
public com.unboundid.scim2.common.types.GroupResource getGroupResourceFromNuxeoGroup(DocumentModel groupModel, String baseURL) throws com.unboundid.scim2.common.exceptions.ScimException Description copied from interface:ScimV2Mapping
Gets a group resource representation of a group model.- Specified by:
getGroupResourceFromNuxeoGroup
in interfaceScimV2Mapping
- Parameters:
groupModel
- the group modelbaseURL
- the location base URL of the SCIM group object- Returns:
- the group resource
- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- if an error occurred
-
getUserResourceFromNuxeoUser
public com.unboundid.scim2.common.types.UserResource getUserResourceFromNuxeoUser(DocumentModel userModel, String baseURL) throws com.unboundid.scim2.common.exceptions.ScimException Description copied from interface:ScimV2Mapping
Gets a user resource representation of a user model.- Specified by:
getUserResourceFromNuxeoUser
in interfaceScimV2Mapping
- Parameters:
userModel
- the user modelbaseURL
- the location base URL of the SCIM user object- Returns:
- the user resource
- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- if an error occurred
-
getGroupAttributeName
Description copied from interface:ScimV2Mapping
Gets the Nuxeo group model attribute name matching the SCIM attribute name used in SCIM Search filtering and sorting.- Specified by:
getGroupAttributeName
in interfaceScimV2Mapping
- Parameters:
column
- the SCIM attribute namefilterValue
- the value of a filter expression to be converted if any- Returns:
- the matching group model attribute
-
getGroupMemberAttributeName
Description copied from interface:ScimV2Mapping
Gets the Nuxeo group model attribute name matching the SCIM attribute name used in SCIM patch request path filtering. E.g. in this case, the SCIM attribute to map is "value":{ "schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"], "Operations":[{ "op":"remove", "path":"members[value eq \"someGroupId\"]" }] }
- Specified by:
getGroupMemberAttributeName
in interfaceScimV2Mapping
- Parameters:
scimAttribute
- the SCIM attribute namefilterValue
- the value of a filter expression to be converted if any- Returns:
- the matching group model attribute
-
getUserAttributeName
Description copied from interface:ScimV2Mapping
Gets the Nuxeo user model attribute name matching the SCIM attribute name used in SCIM Search filtering and sorting.- Specified by:
getUserAttributeName
in interfaceScimV2Mapping
- Parameters:
column
- the SCIM attribute namefilterValue
- the value of a filter expression to be converted if any- Returns:
- the matching group model attribute
-
getUserMemberAttributeName
Description copied from interface:ScimV2Mapping
Gets the Nuxeo user model attribute name matching the SCIM attribute name used in SCIM patch request path filtering. E.g. in this case, the SCIM attribute to map is "value":{ "schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"], "Operations":[{ "op":"remove", "path":"members[value eq \"someUserId\"]" }] }
- Specified by:
getUserMemberAttributeName
in interfaceScimV2Mapping
- Parameters:
scimAttribute
- the SCIM attribute namefilterValue
- the value of a filter expression to be converted if any- Returns:
- the matching user model attribute
-
patchGroup
public DocumentModel patchGroup(DocumentModel groupModel, com.unboundid.scim2.common.types.GroupResource groupResource) throws com.unboundid.scim2.common.exceptions.ScimException Description copied from interface:ScimV2Mapping
Hook to be executed when a group is patched using JSON patch.This is called when handling the attributes othen than "members" in a patch request operation.
- Specified by:
patchGroup
in interfaceScimV2Mapping
- Parameters:
groupModel
- the group model to patchgroupResource
- the group resource from which the group model is patched- Returns:
- the patched group model
- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- if an error occurred
-
updateNuxeoGroupFromGroupResource
protected DocumentModel updateNuxeoGroupFromGroupResource(DocumentModel groupModel, com.unboundid.scim2.common.types.GroupResource groupResource) -
updateNuxeoUserFromUserResource
protected DocumentModel updateNuxeoUserFromUserResource(DocumentModel userModel, com.unboundid.scim2.common.types.UserResource userResource) -
newUserResource
protected com.unboundid.scim2.common.types.UserResource newUserResource(String userId, String baseURL) throws URISyntaxException - Throws:
URISyntaxException
-
setEmail
protected void setEmail(List<com.unboundid.scim2.common.types.Email> emails, DocumentModel userModel, String userSchemaName) -
setName
protected void setName(com.unboundid.scim2.common.types.Name name, DocumentModel userModel, String userSchemaName)
-