org.hawk.http
Interface IHttpExecutor

All Known Implementing Classes:
AbstractHttpExecutor, DefaultHttpExecutor

public interface IHttpExecutor


Method Summary
 java.lang.String executeGetRequest(java.lang.String targetURL, boolean invalidateSession)
          requests for a post on the url specified by target url with the parameters specified in the requestparams
 java.lang.String executeMultiPartPOST(java.lang.String urlString, java.util.Map<java.lang.String,java.lang.String> map)
          This hits the target URL with the post data using the JSESSIONID.
 java.lang.String executePost(java.lang.String targetURL, java.lang.String postData, boolean invalidateSession)
          This hits the target URL with the post data using the JSESSIONID.
 boolean setHttpSessionInfo(java.net.URLConnection conn, boolean invalidateSession)
          This saves http session information for subsequence invocation.
 java.lang.String uploadFile(java.lang.String urlString, java.lang.String exsistingFileName)
          This uploads a file to the target URL.
 

Method Detail

executePost

java.lang.String executePost(java.lang.String targetURL,
                             java.lang.String postData,
                             boolean invalidateSession)
                             throws java.lang.Exception
This hits the target URL with the post data using the JSESSIONID.

Parameters:
targetURL - target url to hit
data - post data
jsessionid - used for standard j2ee session management.
Returns:
JSESSIONID , essentially during login page of a website.otherwise returns the same.
Throws:
java.lang.Exception

executeGetRequest

java.lang.String executeGetRequest(java.lang.String targetURL,
                                   boolean invalidateSession)
                                   throws java.lang.Exception
requests for a post on the url specified by target url with the parameters specified in the requestparams

Parameters:
targetURL -
invalidateSession - if true discard the jsessionid parameter
Returns:
response body of the the requested url specified by target url
Throws:
java.lang.Exception

executeMultiPartPOST

java.lang.String executeMultiPartPOST(java.lang.String urlString,
                                      java.util.Map<java.lang.String,java.lang.String> map)
                                      throws java.lang.Exception
This hits the target URL with the post data using the JSESSIONID.

Parameters:
targetURL - target url to hit
data - post data
jsessionid - used for standard j2ee session management.
Returns:
JSESSIONID , essentially during login page of a website.otherwise returns the same.
Throws:
java.lang.Exception

uploadFile

java.lang.String uploadFile(java.lang.String urlString,
                            java.lang.String exsistingFileName)
                            throws java.lang.Exception
This uploads a file to the target URL.

Parameters:
urlString - target URL to hit
exsistingFileName - name of the file to upload
jsessionid - JSESSIONID to use
Returns:
returns true on success otherwise false
Throws:
java.lang.Exception

setHttpSessionInfo

boolean setHttpSessionInfo(java.net.URLConnection conn,
                           boolean invalidateSession)
This saves http session information for subsequence invocation.

Parameters:
conn - httpconnection
invalidateSession - should logout
Returns:
returns true on success else false.