Class MockIdentityTransportRest

  • All Implemented Interfaces:
    IIdentityTransportProvider

    public class MockIdentityTransportRest
    extends java.lang.Object
    WARNING this is a mock transport for LuteceTestCase purpose
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.IdentityDto createIdentity​(fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.IdentityChangeDto identityChange)
      Creates an identity only if the identity does not already exist.
      fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.ResponseDto deleteIdentity​(java.lang.String strConnectionId, java.lang.String strApplicationCode)
      Deletes an identity from the specified connectionId
      java.io.InputStream downloadFileAttribute​(java.lang.String strIdConnection, java.lang.String strCustomerId, java.lang.String strAttributeKey, java.lang.String strClientAppCode)
      fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.ApplicationRightsDto getApplicationRights​(java.lang.String strClientAppCode)
      java.util.List<fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.IdentityDto> getIdentities​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> mapAttributeValues, java.util.List<java.lang.String> listAttributeKeyNames, java.lang.String strClientCode)
      returns a list of identity from combination of attributes
      fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.IdentityDto getIdentity​(java.lang.String strIdConnection, java.lang.String strCustomerId, java.lang.String strClientCode)
      get identity matching connectionId and customerId for provided application code
      void setHttpTransport​(IHttpTransportProvider httpTransport)
      setter of httpTransport
      void setIdentityStoreEndPoint​(java.lang.String strIdentityStoreEndPoint)
      setter of identityStoreEndPoint
      fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.IdentityDto updateIdentity​(fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.IdentityChangeDto identityChange, java.util.Map<java.lang.String,​org.apache.commons.fileupload.FileItem> mapFileItem)
      apply changes to an identity
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MockIdentityTransportRest

        public MockIdentityTransportRest()
    • Method Detail

      • getIdentity

        public fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.IdentityDto getIdentity​(java.lang.String strIdConnection,
                                                                                           java.lang.String strCustomerId,
                                                                                           java.lang.String strClientCode)
                                                                                    throws fr.paris.lutece.plugins.identitystore.web.exception.ResourceNotFoundException,
                                                                                           fr.paris.lutece.portal.service.util.AppException
        get identity matching connectionId and customerId for provided application code
        Specified by:
        getIdentity in interface IIdentityTransportProvider
        Parameters:
        strIdConnection - connection Id (can be null if strCustomerId is provided)
        strCustomerId - customer Id (can be null if strConnectionId is provided)
        strClientCode - application code of calling application
        Returns:
        identity if found
        Throws:
        fr.paris.lutece.portal.service.util.AppException - if inconsitent parmeters provided, or errors occurs...
        fr.paris.lutece.plugins.identitystore.web.exception.ResourceNotFoundException
      • updateIdentity

        public fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.IdentityDto updateIdentity​(fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.IdentityChangeDto identityChange,
                                                                                              java.util.Map<java.lang.String,​org.apache.commons.fileupload.FileItem> mapFileItem)
                                                                                       throws fr.paris.lutece.plugins.identitystore.web.exception.ResourceNotFoundException,
                                                                                              fr.paris.lutece.portal.service.util.AppException
        apply changes to an identity
        Specified by:
        updateIdentity in interface IIdentityTransportProvider
        Parameters:
        identityChange - change to apply to identity
        mapFileItem - file map to upload
        Returns:
        the updated identity
        Throws:
        fr.paris.lutece.portal.service.util.AppException - if error occured while updating identity
        fr.paris.lutece.plugins.identitystore.web.exception.ResourceNotFoundException
      • downloadFileAttribute

        public java.io.InputStream downloadFileAttribute​(java.lang.String strIdConnection,
                                                         java.lang.String strCustomerId,
                                                         java.lang.String strAttributeKey,
                                                         java.lang.String strClientAppCode)
        Specified by:
        downloadFileAttribute in interface IIdentityTransportProvider
        Parameters:
        strIdConnection - connection Id (can be null if strCustomerId is provided)
        strCustomerId - customer Id (can be null if strConnectionId is provided)
        strAttributeKey - attribute Key (must match a an attribute of type file)
        strClientAppCode - application code of calling application
        Returns:
        inputstream of attribute file
      • createIdentity

        public fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.IdentityDto createIdentity​(fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.IdentityChangeDto identityChange)
                                                                                       throws fr.paris.lutece.portal.service.util.AppException
        Creates an identity only if the identity does not already exist. The identity is created from the provided attributes. The order to test if the identity exists: - by using the provided customer id if present - by using the provided connection id if present
        Specified by:
        createIdentity in interface IIdentityTransportProvider
        Parameters:
        identityChange - change to apply to identity
        Returns:
        the created identity
        Throws:
        fr.paris.lutece.portal.service.util.AppException - if error occurred while updating identity
      • getApplicationRights

        public fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.ApplicationRightsDto getApplicationRights​(java.lang.String strClientAppCode)
                                                                                                      throws fr.paris.lutece.portal.service.util.AppException
        Specified by:
        getApplicationRights in interface IIdentityTransportProvider
        Returns:
        ApplicationRightsDto for the given application
        Throws:
        fr.paris.lutece.portal.service.util.AppException - if error occured
      • deleteIdentity

        public fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.ResponseDto deleteIdentity​(java.lang.String strConnectionId,
                                                                                              java.lang.String strApplicationCode)
        Deletes an identity from the specified connectionId
        Specified by:
        deleteIdentity in interface IIdentityTransportProvider
        Parameters:
        strConnectionId - the connection id
        strApplicationCode - the application code
        Returns:
        the ResponseDto object
      • setIdentityStoreEndPoint

        public void setIdentityStoreEndPoint​(java.lang.String strIdentityStoreEndPoint)
        setter of identityStoreEndPoint
        Parameters:
        strIdentityStoreEndPoint - value to use
      • setHttpTransport

        public void setHttpTransport​(IHttpTransportProvider httpTransport)
        setter of httpTransport
        Parameters:
        httpTransport - IHttpTransportProvider to use
      • getIdentities

        public java.util.List<fr.paris.lutece.plugins.identitystore.v2.web.rs.dto.IdentityDto> getIdentities​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> mapAttributeValues,
                                                                                                             java.util.List<java.lang.String> listAttributeKeyNames,
                                                                                                             java.lang.String strClientCode)
                                                                                                      throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
        returns a list of identity from combination of attributes
        Specified by:
        getIdentities in interface IIdentityTransportProvider
        Parameters:
        mapAttributeValues - a map that associates list of values to search for some attributes
        listAttributeKeyNames - a list of attributes to retrieve in identities
        strClientCode - application code who requested identities
        Returns:
        identity filled according to application rights for user identified by connection id
        Throws:
        fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException