Class HttpHelper
java.lang.Object
com.aeontronix.enhancedmule.tools.util.HttpHelper
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclass -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpHelper(JsonHelper jsonHelper, AuthenticationProvider authenticationProvider) -
Method Summary
Modifier and TypeMethodDescriptionanypointHttpDelete(@NotNull String path, @NotNull Environment env) anypointHttpGet(String path, Environment env) anypointHttpGetWithOrgAndOwner(String path, String orgId, String ownerId) anypointHttpPost(String path, Object data, Environment env) anypointHttpPostWithOrgAndOwner(String path, Object data, String orgId, String ownerId) anypointHttpPut(String path, Object data, Environment environment) voidclose()protected static StringconvertPath(String path) createAnypointMultiPartPatchRequest(@NotNull String url, @Nullable Environment environment) createAnypointMultiPartPostRequest(@NotNull String url, @Nullable Environment environment) createAnypointMultiPartPutRequest(@NotNull String url, @Nullable Environment environment) protected StringexecuteWrapper(@NotNull org.apache.http.client.methods.HttpRequestBase method, HttpHelper.MultiPartRequest multiPartRequest) static StringintlonghttpDelete(String path) httpDelete(String path, Object data) voidhttpGetBasicAuth(String path, OutputStream outputStream) byte[]httpGetBinary(String url) httpHardDelete(String path) voidhttpPutBasicAuth(String path, InputStream is, OutputStream outputStream) booleanstatic voidsetAnypointPlatformUrl(String anypointPlatformUrl) voidsetLoginRequest(boolean loginRequest) voidsetMaxRetries(int maxRetries) voidsetProxy(@NotNull String scheme, @NotNull String host, int port, @Nullable String username, @Nullable String password) voidsetRetryDelay(long retryDelay) void
-
Field Details
-
CONTENT_TYPE
- See Also:
-
TOOMANYCALLSRETRYDELAY
public static final long TOOMANYCALLSRETRYDELAY
-
-
Constructor Details
-
HttpHelper
public HttpHelper() -
HttpHelper
-
-
Method Details
-
getAnypointPlatformUrl
-
setAnypointPlatformUrl
-
convertPath
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
httpGetBasicAuth
- 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 @NotNull String path, @NotNull @NotNull Environment env) throws HttpException - Throws:
HttpException
-
createAnypointMultiPartPostRequest
public HttpHelper.MultiPartRequest createAnypointMultiPartPostRequest(@NotNull @NotNull String url, @Nullable @Nullable Environment environment) -
createAnypointMultiPartPatchRequest
public HttpHelper.MultiPartRequest createAnypointMultiPartPatchRequest(@NotNull @NotNull String url, @Nullable @Nullable Environment environment) -
createAnypointMultiPartPutRequest
public HttpHelper.MultiPartRequest createAnypointMultiPartPutRequest(@NotNull @NotNull String url, @Nullable @Nullable Environment environment) -
executeWrapper
protected String executeWrapper(@NotNull @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
-