Class IdentityAttributeValidationService


  • public class IdentityAttributeValidationService
    extends Object
    Service class used to validate attribute values in requests
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static IdentityAttributeValidationService instance()  
      void validateIdentityAttributeValues​(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.ChangeResponse response)
      Validates all attribute values stored in the provided identity, according to each attribute validation regex.
      void validatePivotAttributesIntegrity​(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto existingIdentityDto, String clientCode, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.ChangeResponse response)
      Validates the integrity of pivot attributes stored in the provided identity.
      If a pivot attribute is present and certified with a process with a greater or equal level to the defined process in configuration, then ALL the pivot attributes need to be present and certified with the same certification process.
      If the birthcountry code attribute is set and doesn't correspond to FRANCE, then the birthplace code attribute is allowed to be missing.
      If the above rules are not fullfiled, the response status is put to FAILURE.
    • Constructor Detail

      • IdentityAttributeValidationService

        public IdentityAttributeValidationService()
    • Method Detail

      • validateIdentityAttributeValues

        public void validateIdentityAttributeValues​(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity,
                                                    fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.ChangeResponse response)
                                             throws IdentityAttributeNotFoundException
        Validates all attribute values stored in the provided identity, according to each attribute validation regex. Adds validation error statuses in the response in case of invalid values, and put the status to FAILURE.
        Parameters:
        identity - the identity
        response - the response
        Throws:
        IdentityAttributeNotFoundException
      • validatePivotAttributesIntegrity

        public void validatePivotAttributesIntegrity​(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto existingIdentityDto,
                                                     String clientCode,
                                                     fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity,
                                                     fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.ChangeResponse response)
                                              throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
        Validates the integrity of pivot attributes stored in the provided identity.
        If a pivot attribute is present and certified with a process with a greater or equal level to the defined process in configuration, then ALL the pivot attributes need to be present and certified with the same certification process.
        If the birthcountry code attribute is set and doesn't correspond to FRANCE, then the birthplace code attribute is allowed to be missing.
        If the above rules are not fullfiled, the response status is put to FAILURE.
        Parameters:
        cuid - the cuid
        identityRequest - the identity request
        response - the response
        Throws:
        fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException