chore: rename_triggerUtils (#18405)

Refactored Renamed TriggerUtils.java to RestAPIActivateUtils.java and its usage
This commit is contained in:
appsmithguru 2022-12-07 17:33:50 +05:30 committed by GitHub
parent 9931d3cdc5
commit b64df3e1c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 10 deletions

View File

@ -47,7 +47,7 @@ import java.util.Set;
import static org.apache.commons.lang3.StringUtils.isNotEmpty; import static org.apache.commons.lang3.StringUtils.isNotEmpty;
@NoArgsConstructor @NoArgsConstructor
public class TriggerUtils { public class RestAPIActivateUtils {
public static String SIGNATURE_HEADER_NAME = "X-APPSMITH-SIGNATURE"; public static String SIGNATURE_HEADER_NAME = "X-APPSMITH-SIGNATURE";
public static String RESPONSE_DATA_TYPE = "X-APPSMITH-DATATYPE"; public static String RESPONSE_DATA_TYPE = "X-APPSMITH-DATATYPE";

View File

@ -10,7 +10,7 @@ import com.appsmith.external.helpers.restApiUtils.helpers.HeaderUtils;
import com.appsmith.external.helpers.restApiUtils.helpers.HintMessageUtils; import com.appsmith.external.helpers.restApiUtils.helpers.HintMessageUtils;
import com.appsmith.external.helpers.restApiUtils.helpers.InitUtils; import com.appsmith.external.helpers.restApiUtils.helpers.InitUtils;
import com.appsmith.external.helpers.restApiUtils.helpers.SmartSubstitutionUtils; import com.appsmith.external.helpers.restApiUtils.helpers.SmartSubstitutionUtils;
import com.appsmith.external.helpers.restApiUtils.helpers.TriggerUtils; import com.appsmith.external.helpers.restApiUtils.helpers.RestAPIActivateUtils;
import com.appsmith.external.helpers.restApiUtils.helpers.URIUtils; import com.appsmith.external.helpers.restApiUtils.helpers.URIUtils;
import com.appsmith.external.models.ActionConfiguration; import com.appsmith.external.models.ActionConfiguration;
import com.appsmith.external.models.ActionExecutionResult; import com.appsmith.external.models.ActionExecutionResult;
@ -36,7 +36,7 @@ public class BaseRestApiPluginExecutor implements PluginExecutor<APIConnection>,
protected SmartSubstitutionUtils smartSubstitutionUtils; protected SmartSubstitutionUtils smartSubstitutionUtils;
protected URIUtils uriUtils; protected URIUtils uriUtils;
protected DatasourceUtils datasourceUtils; protected DatasourceUtils datasourceUtils;
protected TriggerUtils triggerUtils; protected RestAPIActivateUtils restAPIActivateUtils;
protected InitUtils initUtils; protected InitUtils initUtils;
protected HeaderUtils headerUtils; protected HeaderUtils headerUtils;
protected HintMessageUtils hintMessageUtils; protected HintMessageUtils hintMessageUtils;
@ -51,7 +51,7 @@ public class BaseRestApiPluginExecutor implements PluginExecutor<APIConnection>,
this.dataUtils = new DataUtils(); this.dataUtils = new DataUtils();
this.smartSubstitutionUtils = new SmartSubstitutionUtils(); this.smartSubstitutionUtils = new SmartSubstitutionUtils();
this.uriUtils = new URIUtils(); this.uriUtils = new URIUtils();
this.triggerUtils = new TriggerUtils(); this.restAPIActivateUtils = new RestAPIActivateUtils();
this.initUtils = new InitUtils(); this.initUtils = new InitUtils();
this.headerUtils = new HeaderUtils(); this.headerUtils = new HeaderUtils();
this.datasourceUtils = new DatasourceUtils(); this.datasourceUtils = new DatasourceUtils();

View File

@ -186,7 +186,7 @@ public class GraphQLPlugin extends BasePlugin {
ActionExecutionRequest actionExecutionRequest = ActionExecutionRequest actionExecutionRequest =
RequestCaptureFilter.populateRequestFields(actionConfiguration, uri, insertedParams, objectMapper); RequestCaptureFilter.populateRequestFields(actionConfiguration, uri, insertedParams, objectMapper);
WebClient.Builder webClientBuilder = triggerUtils.getWebClientBuilder(actionConfiguration, WebClient.Builder webClientBuilder = restAPIActivateUtils.getWebClientBuilder(actionConfiguration,
datasourceConfiguration); datasourceConfiguration);
String reqContentType = headerUtils.getRequestContentType(actionConfiguration, datasourceConfiguration); String reqContentType = headerUtils.getRequestContentType(actionConfiguration, datasourceConfiguration);
@ -266,12 +266,12 @@ public class GraphQLPlugin extends BasePlugin {
Object requestBodyObj = dataUtils.getRequestBodyObject(actionConfiguration, reqContentType, Object requestBodyObj = dataUtils.getRequestBodyObject(actionConfiguration, reqContentType,
encodeParamsToggle, encodeParamsToggle,
httpMethod); httpMethod);
WebClient client = triggerUtils.getWebClient(webClientBuilder, apiConnection, reqContentType, objectMapper, WebClient client = restAPIActivateUtils.getWebClient(webClientBuilder, apiConnection, reqContentType, objectMapper,
EXCHANGE_STRATEGIES, requestCaptureFilter); EXCHANGE_STRATEGIES, requestCaptureFilter);
/* Triggering the actual REST API call */ /* Triggering the actual REST API call */
Set<String> hintMessages = new HashSet<>(); Set<String> hintMessages = new HashSet<>();
return triggerUtils.triggerApiCall(client, httpMethod, uri, requestBodyObj, actionExecutionRequest, return restAPIActivateUtils.triggerApiCall(client, httpMethod, uri, requestBodyObj, actionExecutionRequest,
objectMapper, objectMapper,
hintMessages, errorResult, requestCaptureFilter); hintMessages, errorResult, requestCaptureFilter);
} }

View File

@ -149,7 +149,7 @@ public class RestApiPlugin extends BasePlugin {
ActionExecutionRequest actionExecutionRequest = ActionExecutionRequest actionExecutionRequest =
RequestCaptureFilter.populateRequestFields(actionConfiguration, uri, insertedParams, objectMapper); RequestCaptureFilter.populateRequestFields(actionConfiguration, uri, insertedParams, objectMapper);
WebClient.Builder webClientBuilder = triggerUtils.getWebClientBuilder(actionConfiguration, WebClient.Builder webClientBuilder = restAPIActivateUtils.getWebClientBuilder(actionConfiguration,
datasourceConfiguration); datasourceConfiguration);
String reqContentType = headerUtils.getRequestContentType(actionConfiguration, datasourceConfiguration); String reqContentType = headerUtils.getRequestContentType(actionConfiguration, datasourceConfiguration);
@ -172,11 +172,11 @@ public class RestApiPlugin extends BasePlugin {
Object requestBodyObj = dataUtils.getRequestBodyObject(actionConfiguration, reqContentType, Object requestBodyObj = dataUtils.getRequestBodyObject(actionConfiguration, reqContentType,
encodeParamsToggle, encodeParamsToggle,
httpMethod); httpMethod);
WebClient client = triggerUtils.getWebClient(webClientBuilder, apiConnection, reqContentType, objectMapper, WebClient client = restAPIActivateUtils.getWebClient(webClientBuilder, apiConnection, reqContentType, objectMapper,
EXCHANGE_STRATEGIES, requestCaptureFilter); EXCHANGE_STRATEGIES, requestCaptureFilter);
/* Triggering the actual REST API call */ /* Triggering the actual REST API call */
return triggerUtils.triggerApiCall(client, httpMethod, uri, requestBodyObj, actionExecutionRequest, return restAPIActivateUtils.triggerApiCall(client, httpMethod, uri, requestBodyObj, actionExecutionRequest,
objectMapper, hintMessages, errorResult, requestCaptureFilter); objectMapper, hintMessages, errorResult, requestCaptureFilter);
} }