Class HttpAccessTransport

java.lang.Object
fr.paris.lutece.plugins.identitystore.v1.web.service.HttpAccessTransport
All Implemented Interfaces:
IHttpTransportProvider

public class HttpAccessTransport extends Object implements IHttpTransportProvider
IHttpTransportProvider which use library-httpaccess
  • Constructor Details

    • HttpAccessTransport

      public HttpAccessTransport()
  • Method Details

    • doPost

      public String doPost(String strUrl, Map<String,String> mapParams, Map<String,String> mapHeadersRequest) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      make POST request on given url with params and headers
      Specified by:
      doPost in interface IHttpTransportProvider
      Parameters:
      strUrl - url to call
      mapParams - params to post
      mapHeadersRequest - headers of the request
      Returns:
      response body as String
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
    • doPostJSON

      public <T> T doPostJSON(String strUrl, Map<String,String> mapParams, Map<String,String> mapHeadersRequest, Object json, Class<T> responseJsonClass, com.fasterxml.jackson.databind.ObjectMapper mapper) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      make POST request on given url with params and headers of a JSON object to retrieve another JSON
      Specified by:
      doPostJSON in interface IHttpTransportProvider
      Type Parameters:
      T - of the response
      Parameters:
      strUrl - url to call
      mapParams - params to post
      mapHeadersRequest - headers of the request
      json - JSON object to post
      responseJsonClass - the class
      mapper - mapper for JSON serialize / deserialize
      Returns:
      response T
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
    • doGet

      public <T> T doGet(String strEndPointUrl, Map<String,String> mapParams, Map<String,String> mapHeadersRequest, Class<T> responseJsonClass, com.fasterxml.jackson.databind.ObjectMapper mapper) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      Description copied from interface: IHttpTransportProvider
      make a Get request on given url with parameters
      Specified by:
      doGet in interface IHttpTransportProvider
      Type Parameters:
      T - of the response
      Parameters:
      strEndPointUrl - url
      mapParams - param to add to url
      mapHeadersRequest - request header
      responseJsonClass - the class
      mapper - mapper for JSON serialize / deserialize
      Returns:
      response list
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
    • doPostMultiPart

      public <T> T doPostMultiPart(String strEndPointUrl, Map<String,String> mapParams, Map<String,String> mapHeadersRequest, Map<String,org.apache.commons.fileupload.FileItem> mapFiles, Class<T> responseJsonClass, com.fasterxml.jackson.databind.ObjectMapper mapper) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      Description copied from interface: IHttpTransportProvider
      make a multipart Post request
      Specified by:
      doPostMultiPart in interface IHttpTransportProvider
      Type Parameters:
      T - of the response
      Parameters:
      strEndPointUrl - url
      mapParams - param to add to request
      mapHeadersRequest - request header
      mapFiles - file to add to multipart request
      responseJsonClass - the class
      mapper - mapper for JSON serialize / deserialize
      Returns:
      response list
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
    • doDelete

      public <T> T doDelete(String strEndPointUrl, Map<String,String> mapParams, Map<String,String> mapHeadersRequest, Class<T> responseJsonClass, com.fasterxml.jackson.databind.ObjectMapper mapper) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      Description copied from interface: IHttpTransportProvider
      make a Delete request on given url with parameters
      Specified by:
      doDelete in interface IHttpTransportProvider
      Type Parameters:
      T - of the response
      Parameters:
      strEndPointUrl - url
      mapParams - param to add to url
      mapHeadersRequest - request header
      responseJsonClass - the class
      mapper - mapper for JSON serialize / deserialize
      Returns:
      response list
      Throws:
      fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException