fr.paris.lutece.plugins.blobstoreclient.util.http
Class WebServiceCaller

java.lang.Object
  extended by fr.paris.lutece.plugins.blobstoreclient.util.http.WebServiceCaller
All Implemented Interfaces:
IWebServiceCaller

public class WebServiceCaller
extends Object
implements IWebServiceCaller

WebServiceCaller


Constructor Summary
WebServiceCaller()
           
 
Method Summary
 org.apache.commons.fileupload.FileItem callWSDownloadFile(String strUrl, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements)
          Call WS to download a file
 void callWSDownloadFile(String strUrl, String strFilePath, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements)
          Call WS to download a file
 String callWSGet(String strUrl, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements)
          Call Rest WS to execute a GET method
 String callWSGetFileName(String strUrl)
          Call Rest WS to get the file name
 String callWSPost(String strUrl, Map<String,List<String>> mapParameters, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements)
          Call Rest WS to do an action
 String callWSPostMultiPart(String strUrl, Map<String,List<String>> mapParameters, Map<String,org.apache.commons.fileupload.FileItem> listFileItems, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements)
          Call Rest WS to execute a multipart POST method
protected  String trace(String strUrl)
          Trace the web service call
protected  String trace(String strUrl, Map<String,List<String>> mapParameters, Map<String,org.apache.commons.fileupload.FileItem> fileItems, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements)
          Trace the web service call
protected  String trace(String strUrl, Map<String,List<String>> mapParameters, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements)
          Trace the web service call
protected  String trace(String strUrl, fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator, List<String> listElements)
          Trace the web service call
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebServiceCaller

public WebServiceCaller()
Method Detail

callWSGetFileName

public String callWSGetFileName(String strUrl)
                         throws fr.paris.lutece.util.httpaccess.HttpAccessException
Call Rest WS to get the file name

Specified by:
callWSGetFileName in interface IWebServiceCaller
Parameters:
strUrl - the url
Returns:
the file name
Throws:
fr.paris.lutece.util.httpaccess.HttpAccessException - exception if there is an HTTP issue

callWSGet

public String callWSGet(String strUrl,
                        fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
                        List<String> listElements)
                 throws fr.paris.lutece.util.httpaccess.HttpAccessException
Call Rest WS to execute a GET method

Specified by:
callWSGet in interface IWebServiceCaller
Parameters:
strUrl - the url
authenticator - The request authenticator
listElements - the list of elements to include in the signature
Returns:
the response as a String
Throws:
fr.paris.lutece.util.httpaccess.HttpAccessException - exception if there is an HTTP issue

callWSPost

public String callWSPost(String strUrl,
                         Map<String,List<String>> mapParameters,
                         fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
                         List<String> listElements)
                  throws fr.paris.lutece.util.httpaccess.HttpAccessException
Call Rest WS to do an action

Specified by:
callWSPost in interface IWebServiceCaller
Parameters:
strUrl - the url
mapParameters - the params to pass in the post
authenticator - The request authenticator
listElements - the list of elements to include in the signature
Returns:
the response as a String
Throws:
fr.paris.lutece.util.httpaccess.HttpAccessException - the exception if there is a problem

callWSPostMultiPart

public String callWSPostMultiPart(String strUrl,
                                  Map<String,List<String>> mapParameters,
                                  Map<String,org.apache.commons.fileupload.FileItem> listFileItems,
                                  fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
                                  List<String> listElements)
                           throws fr.paris.lutece.util.httpaccess.HttpAccessException
Call Rest WS to execute a multipart POST method

Specified by:
callWSPostMultiPart in interface IWebServiceCaller
Parameters:
strUrl - the url
mapParameters - the params to pass in the post
listFileItems - the file to upload - map of (parameter_name, file_to_upload)
authenticator - The request authenticator
listElements - the list of elements to include in the signature
Returns:
the response as a String
Throws:
fr.paris.lutece.util.httpaccess.HttpAccessException - the exception if there is a problem

callWSDownloadFile

public void callWSDownloadFile(String strUrl,
                               String strFilePath,
                               fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
                               List<String> listElements)
                        throws fr.paris.lutece.util.httpaccess.HttpAccessException
Call WS to download a file

Specified by:
callWSDownloadFile in interface IWebServiceCaller
Parameters:
strUrl - the url of the file to download
strFilePath - the file path to download the file
authenticator - the request authenticator
listElements - the list of elements to include in the signature
Throws:
fr.paris.lutece.util.httpaccess.HttpAccessException - exception if there is an HTTP error

callWSDownloadFile

public org.apache.commons.fileupload.FileItem callWSDownloadFile(String strUrl,
                                                                 fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
                                                                 List<String> listElements)
                                                          throws fr.paris.lutece.util.httpaccess.HttpAccessException
Call WS to download a file

Specified by:
callWSDownloadFile in interface IWebServiceCaller
Parameters:
strUrl - the url of the file to download
authenticator - the request authenticator
listElements - the list of elements to include in the signature
Returns:
a FileItem
Throws:
fr.paris.lutece.util.httpaccess.HttpAccessException - exception if there is an HTTP error

trace

protected String trace(String strUrl)
Trace the web service call

Parameters:
strUrl - The WS URI
Returns:
The trace

trace

protected String trace(String strUrl,
                       fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
                       List<String> listElements)
Trace the web service call

Parameters:
strUrl - The WS URI
authenticator - The Request Authenticator
listElements - The list of elements to use to build the signature
Returns:
The trace

trace

protected String trace(String strUrl,
                       Map<String,List<String>> mapParameters,
                       fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
                       List<String> listElements)
Trace the web service call

Parameters:
strUrl - The WS URI
mapParameters - The parameters
authenticator - The Request Authenticator
listElements - The list of elements to use to build the signature
Returns:
The trace

trace

protected String trace(String strUrl,
                       Map<String,List<String>> mapParameters,
                       Map<String,org.apache.commons.fileupload.FileItem> fileItems,
                       fr.paris.lutece.util.signrequest.RequestAuthenticator authenticator,
                       List<String> listElements)
Trace the web service call

Parameters:
strUrl - The WS URI
mapParameters - The parameters
fileItems - the file to upload - map of (parameter_name, file_to_upload)
authenticator - The Request Authenticator
listElements - The list of elements to use to build the signature
Returns:
The trace


Copyright © 2014 Mairie de Paris. All Rights Reserved.