Class DefaultScimV2Mapping

java.lang.Object
org.nuxeo.scim.v2.service.DefaultScimV2Mapping
All Implemented Interfaces:
ScimV2Mapping

public class DefaultScimV2Mapping extends Object implements ScimV2Mapping
Since:
2023.14
  • Field Details

  • 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 interface ScimV2Mapping
      Parameters:
      groupModel - the created group model
      groupResource - 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 interface ScimV2Mapping
      Parameters:
      userModel - the created user model
      userResource - 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 interface ScimV2Mapping
      Parameters:
      groupModel - the updated group model
      groupResource - 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 interface ScimV2Mapping
      Parameters:
      userModel - the created user model
      userResource - 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 interface ScimV2Mapping
      Parameters:
      groupModel - the group model about to be created
      groupResource - 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 interface ScimV2Mapping
      Parameters:
      userModel - the user model about to be created
      userResource - 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 interface ScimV2Mapping
      Parameters:
      groupModel - the group model about to be updated
      groupResource - 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 interface ScimV2Mapping
      Parameters:
      userModel - the user model about to be updated
      userResource - 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 interface ScimV2Mapping
      Parameters:
      groupModel - the group model
      baseURL - 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 interface ScimV2Mapping
      Parameters:
      userModel - the user model
      baseURL - 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

      public String getGroupAttributeName(String column, Object filterValue)
      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 interface ScimV2Mapping
      Parameters:
      column - the SCIM attribute name
      filterValue - the value of a filter expression to be converted if any
      Returns:
      the matching group model attribute
    • getGroupMemberAttributeName

      public String getGroupMemberAttributeName(String scimAttribute, Object filterValue)
      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 interface ScimV2Mapping
      Parameters:
      scimAttribute - the SCIM attribute name
      filterValue - the value of a filter expression to be converted if any
      Returns:
      the matching group model attribute
    • getUserAttributeName

      public String getUserAttributeName(String column, Object filterValue)
      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 interface ScimV2Mapping
      Parameters:
      column - the SCIM attribute name
      filterValue - the value of a filter expression to be converted if any
      Returns:
      the matching group model attribute
    • getUserMemberAttributeName

      public String getUserMemberAttributeName(String scimAttribute, Object filterValue)
      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 interface ScimV2Mapping
      Parameters:
      scimAttribute - the SCIM attribute name
      filterValue - 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 interface ScimV2Mapping
      Parameters:
      groupModel - the group model to patch
      groupResource - 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)