Class HttpHelper
java.lang.Object
com.aeontronix.enhancedmule.tools.util.HttpHelper
- All Implemented Interfaces:
Closeable,AutoCloseable
public class HttpHelper extends Object implements Closeable
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classHttpHelper.MultiPartRequestclassHttpHelper.RuntimeIOException -
Field Summary
Fields Modifier and Type Field Description static StringCONTENT_TYPEstatic longTOOMANYCALLSRETRYDELAY -
Constructor Summary
Constructors Constructor Description HttpHelper()HttpHelper(JsonHelper jsonHelper, AuthenticationProvider authenticationProvider) -
Method Summary
-
Field Details
-
CONTENT_TYPE
- See Also:
- Constant Field Values
-
TOOMANYCALLSRETRYDELAY
public static final long TOOMANYCALLSRETRYDELAY
-
-
Constructor Details
-
HttpHelper
public HttpHelper() -
HttpHelper
-
-
Method Details
-
convertPath
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getAuthToken
- Throws:
HttpException
-
setAuthToken
-
httpGetBasicAuth
- Throws:
HttpException
-
httpPutBasicAuth
public void httpPutBasicAuth(String path, byte[] data, OutputStream outputStream) throws HttpException- Throws:
HttpException
-
httpPutBasicAuth
public void httpPutBasicAuth(String path, InputStream is, OutputStream outputStream) throws HttpException- Throws:
HttpException
-
anypointHttpGet
- Throws:
HttpException
-
httpGet
- Throws:
HttpException
-
httpGet
- Throws:
HttpException
-
anypointHttpGetWithOrgAndOwner
public String anypointHttpGetWithOrgAndOwner(String path, String orgId, String ownerId) throws HttpException- Throws:
HttpException
-
anypointHttpPost
- Throws:
HttpException
-
anypointHttpPostWithOrgAndOwner
public String anypointHttpPostWithOrgAndOwner(String path, Object data, String orgId, String ownerId) throws HttpException- Throws:
HttpException
-
httpPost
- Throws:
HttpException
-
httpPost
- Throws:
HttpException
-
httpPatch
- Throws:
HttpException
-
httpPut
- Throws:
HttpException
-
httpPut
- Throws:
HttpException
-
anypointHttpPut
public String anypointHttpPut(String path, Object data, Environment environment) throws HttpException- Throws:
HttpException
-
httpDelete
- Throws:
HttpException
-
httpHardDelete
- Throws:
HttpException
-
httpDelete
- Throws:
HttpException
-
anypointHttpDelete
public String anypointHttpDelete(@NotNull String path, @NotNull Environment env) throws HttpException- Throws:
HttpException
-
createAnypointMultiPartPostRequest
public HttpHelper.MultiPartRequest createAnypointMultiPartPostRequest(@NotNull String url, @Nullable Environment environment) -
createAnypointMultiPartPatchRequest
public HttpHelper.MultiPartRequest createAnypointMultiPartPatchRequest(@NotNull String url, @Nullable Environment environment) -
createAnypointMultiPartPutRequest
public HttpHelper.MultiPartRequest createAnypointMultiPartPutRequest(@NotNull String url, @Nullable Environment environment) -
executeWrapper
protected String executeWrapper(@NotNull org.apache.http.client.methods.HttpRequestBase method, HttpHelper.MultiPartRequest multiPartRequest) throws HttpException- Throws:
HttpException
-
setProxy
-
unsetProxy
public void unsetProxy() -
getMaxRetries
public int getMaxRetries() -
setMaxRetries
public void setMaxRetries(int maxRetries) -
getRetryDelay
public long getRetryDelay() -
setRetryDelay
public void setRetryDelay(long retryDelay) -
isLoginRequest
public boolean isLoginRequest() -
setLoginRequest
public void setLoginRequest(boolean loginRequest) -
httpGetBinary
- Throws:
HttpException
-