From 014f95bd10a7713ce1eec6f721f763bd58f998e9 Mon Sep 17 00:00:00 2001 From: pasindu Date: Thu, 25 May 2023 13:27:58 +0530 Subject: [PATCH] Rename API dto file and refactor --- .../rest/api/PublisherRESTAPIServices.java | 8 +- .../api/PublisherRESTAPIServicesImpl.java | 8 +- .../APIInfo/APIInfo.java} | 4 +- .../APIInfo}/AdvertiseInfo.java | 2 +- .../APIInfo}/BusinessInformation.java | 2 +- .../APIUtils => dto/APIInfo}/Operations.java | 2 +- .../pom.xml | 6 +- .../publisher/APIPublisherServiceImpl.java | 88 +++++++++---------- 8 files changed, 58 insertions(+), 62 deletions(-) rename components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/{util/APIUtils/APIResponseUtil.java => dto/APIInfo/APIInfo.java} (99%) rename components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/{util/APIUtils => dto/APIInfo}/AdvertiseInfo.java (95%) rename components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/{util/APIUtils => dto/APIInfo}/BusinessInformation.java (95%) rename components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/{util/APIUtils => dto/APIInfo}/Operations.java (97%) diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServices.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServices.java index 35134c6610..6bc3f17318 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServices.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServices.java @@ -23,7 +23,7 @@ import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.AccessTokenInfo; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.BadRequestException; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.UnexpectedResponseException; -import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.APIUtils.APIResponseUtil; +import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo; import org.json.JSONObject; import org.wso2.carbon.apimgt.api.model.APIIdentifier; import org.wso2.carbon.apimgt.api.model.Scope; @@ -54,10 +54,10 @@ public interface PublisherRESTAPIServices { JSONObject getApis(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo) throws APIServicesException, BadRequestException, UnexpectedResponseException; - JSONObject addAPI(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, APIResponseUtil api) + JSONObject addAPI(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, APIInfo api) throws APIServicesException, BadRequestException, UnexpectedResponseException; - boolean updateApi(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, APIResponseUtil api) + boolean updateApi(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, APIInfo api) throws APIServicesException, BadRequestException, UnexpectedResponseException; boolean saveAsyncApiDefinition(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, String uuid, @@ -113,6 +113,6 @@ public interface PublisherRESTAPIServices { throws APIServicesException, BadRequestException, UnexpectedResponseException; boolean addDocumentationContent(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, - APIResponseUtil api, String docId, String docContent) + APIInfo api, String docId, String docContent) throws APIServicesException, BadRequestException, UnexpectedResponseException; } diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServicesImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServicesImpl.java index dcb9eb6335..3308f13115 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServicesImpl.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServicesImpl.java @@ -25,7 +25,7 @@ import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.AccessTokenInfo; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.BadRequestException; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.UnexpectedResponseException; -import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.APIUtils.APIResponseUtil; +import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo; import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.HttpsTrustManagerUtils; import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.ScopeUtils; import okhttp3.MediaType; @@ -315,7 +315,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices { } @Override - public JSONObject addAPI(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, APIResponseUtil api) + public JSONObject addAPI(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, APIInfo api) throws APIServicesException, BadRequestException, UnexpectedResponseException { String addAPIEndPoint = endPointPrefix + Constants.API_ENDPOINT; @@ -402,7 +402,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices { } @Override - public boolean updateApi(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, APIResponseUtil api) + public boolean updateApi(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, APIInfo api) throws APIServicesException, BadRequestException, UnexpectedResponseException { String updateAPIEndPoint = endPointPrefix + Constants.API_ENDPOINT + api.getId(); @@ -1063,7 +1063,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices { @Override public boolean addDocumentationContent(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, - APIResponseUtil api, String docId, String docContent) + APIInfo api, String docId, String docContent) throws APIServicesException, BadRequestException, UnexpectedResponseException { String addDocumentationContentEndPoint = endPointPrefix + Constants.API_ENDPOINT + api.getId() + "/documents/" + docId; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIUtils/APIResponseUtil.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/dto/APIInfo/APIInfo.java similarity index 99% rename from components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIUtils/APIResponseUtil.java rename to components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/dto/APIInfo/APIInfo.java index cf0d50d465..a6f76116d9 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIUtils/APIResponseUtil.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/dto/APIInfo/APIInfo.java @@ -16,7 +16,7 @@ * under the License. */ -package io.entgra.device.mgt.core.apimgt.extension.rest.api.util.APIUtils; +package io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo; import org.json.JSONObject; import org.wso2.carbon.apimgt.api.model.APICategory; @@ -31,7 +31,7 @@ import java.util.Set; * This class represents the API response. */ -public class APIResponseUtil { +public class APIInfo { private String id; private String name; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIUtils/AdvertiseInfo.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/dto/APIInfo/AdvertiseInfo.java similarity index 95% rename from components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIUtils/AdvertiseInfo.java rename to components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/dto/APIInfo/AdvertiseInfo.java index 4762a260ca..93511526aa 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIUtils/AdvertiseInfo.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/dto/APIInfo/AdvertiseInfo.java @@ -16,7 +16,7 @@ * under the License. */ -package io.entgra.device.mgt.core.apimgt.extension.rest.api.util.APIUtils; +package io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo; /** * This hold the advertisement information of an API. diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIUtils/BusinessInformation.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/dto/APIInfo/BusinessInformation.java similarity index 95% rename from components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIUtils/BusinessInformation.java rename to components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/dto/APIInfo/BusinessInformation.java index 3384100dd6..ad32e51f15 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIUtils/BusinessInformation.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/dto/APIInfo/BusinessInformation.java @@ -16,7 +16,7 @@ * under the License. */ -package io.entgra.device.mgt.core.apimgt.extension.rest.api.util.APIUtils; +package io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo; /** * This hold the business information of an API. diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIUtils/Operations.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/dto/APIInfo/Operations.java similarity index 97% rename from components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIUtils/Operations.java rename to components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/dto/APIInfo/Operations.java index fae81de88a..51f2c1ee4c 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIUtils/Operations.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/dto/APIInfo/Operations.java @@ -16,7 +16,7 @@ * under the License. */ -package io.entgra.device.mgt.core.apimgt.extension.rest.api.util.APIUtils; +package io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo; import java.util.Set; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml index c82e0cdfc9..e23a764fbb 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml @@ -174,11 +174,7 @@ org.scannotation;version="1.0", org.scannotation.archiveiterator;version="1.0", org.w3c.dom, - io.entgra.device.mgt.core.apimgt.extension.rest.api, - io.entgra.device.mgt.core.apimgt.extension.rest.api.dto, - io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions, - io.entgra.device.mgt.core.apimgt.extension.rest.api.constants, - io.entgra.device.mgt.core.apimgt.extension.rest.api.util.*, + io.entgra.device.mgt.core.apimgt.extension.rest.api.*, io.entgra.device.mgt.core.apimgt.annotations, org.wso2.carbon.apimgt.api, org.wso2.carbon.apimgt.api.model, diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java index 6c55bf0f26..44391fb712 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java @@ -28,7 +28,7 @@ import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.AccessTokenInfo; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.BadRequestException; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.UnexpectedResponseException; -import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.APIUtils.APIResponseUtil; +import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -180,7 +180,7 @@ public class APIPublisherServiceImpl implements APIPublisherService { publisherRESTAPIServices.addNewSharedScope(apiApplicationKey, accessTokenInfo, scope); } } - APIResponseUtil api = getAPI(apiConfig, true); + APIInfo api = getAPI(apiConfig, true); JSONObject createdAPI = publisherRESTAPIServices.addAPI(apiApplicationKey, accessTokenInfo, api); if (apiConfig.getEndpointType() != null && "WS".equals(apiConfig.getEndpointType())) { publisherRESTAPIServices.saveAsyncApiDefinition(apiApplicationKey, accessTokenInfo, @@ -260,7 +260,7 @@ public class APIPublisherServiceImpl implements APIPublisherService { apiIdentifier); if (scopesToMoveAsSharedScopes.size() > 0) { // update API to remove local scopes - APIResponseUtil api = getAPI(apiConfig, false); + APIInfo api = getAPI(apiConfig, false); api.setLifeCycleStatus(existingAPI.getString("lifeCycleStatus")); publisherRESTAPIServices.updateApi(apiApplicationKey, accessTokenInfo, api); @@ -275,7 +275,7 @@ public class APIPublisherServiceImpl implements APIPublisherService { } existingAPI = publisherRESTAPIServices.getApi(apiApplicationKey, accessTokenInfo, apiIdentifier); - APIResponseUtil api = getAPI(apiConfig, true); + APIInfo api = getAPI(apiConfig, true); api.setLastUpdatedTime(existingAPI.getString("lifeCycleStatus")); api.setId(existingAPI.getString("id")); publisherRESTAPIServices.updateApi(apiApplicationKey, accessTokenInfo, api); @@ -357,7 +357,7 @@ public class APIPublisherServiceImpl implements APIPublisherService { } } if (apiConfig.getApiDocumentationSourceFile() != null) { - APIResponseUtil api = getAPI(apiConfig, true); + APIInfo api = getAPI(apiConfig, true); String fileName = CarbonUtils.getCarbonHome() + File.separator + "repository" + @@ -541,28 +541,28 @@ public class APIPublisherServiceImpl implements APIPublisherService { } } - private APIResponseUtil getAPI(APIConfig config, boolean includeScopes) { - - APIResponseUtil apiResponseUtil = new APIResponseUtil(); - apiResponseUtil.setName(config.getName().replace(Constants.SPACE, Constants.EMPTY_STRING)); - apiResponseUtil.setDescription(""); - apiResponseUtil.setContext(config.getContext()); - apiResponseUtil.setVersion(config.getVersion()); - apiResponseUtil.setProvider(config.getOwner()); - apiResponseUtil.setLifeCycleStatus(CREATED_STATUS); - apiResponseUtil.setWsdlInfo(null); - apiResponseUtil.setWsdlUrl(null); - apiResponseUtil.setResponseCachingEnabled(false); - apiResponseUtil.setCacheTimeout(0); - apiResponseUtil.setHasThumbnail(false); - apiResponseUtil.setDefaultVersion(config.isDefault()); - apiResponseUtil.setRevision(false); - apiResponseUtil.setRevisionedApiId(null); - apiResponseUtil.setEnableSchemaValidation(false); + private APIInfo getAPI(APIConfig config, boolean includeScopes) { + + APIInfo apiInfo = new APIInfo(); + apiInfo.setName(config.getName().replace(Constants.SPACE, Constants.EMPTY_STRING)); + apiInfo.setDescription(""); + apiInfo.setContext(config.getContext()); + apiInfo.setVersion(config.getVersion()); + apiInfo.setProvider(config.getOwner()); + apiInfo.setLifeCycleStatus(CREATED_STATUS); + apiInfo.setWsdlInfo(null); + apiInfo.setWsdlUrl(null); + apiInfo.setResponseCachingEnabled(false); + apiInfo.setCacheTimeout(0); + apiInfo.setHasThumbnail(false); + apiInfo.setDefaultVersion(config.isDefault()); + apiInfo.setRevision(false); + apiInfo.setRevisionedApiId(null); + apiInfo.setEnableSchemaValidation(false); Set tags = new HashSet<>(); tags.addAll(Arrays.asList(config.getTags())); - apiResponseUtil.setTags(tags); + apiInfo.setTags(tags); Set availableTiers = new HashSet<>(); if (config.getEndpointType() != null && "WS".equals(config.getEndpointType())) { @@ -570,7 +570,7 @@ public class APIPublisherServiceImpl implements APIPublisherService { } else { availableTiers.add(UNLIMITED_TIER); } - apiResponseUtil.setPolicies(availableTiers); + apiInfo.setPolicies(availableTiers); if (config.getEndpointType() == null) { List operations = new ArrayList(); @@ -608,16 +608,16 @@ public class APIPublisherServiceImpl implements APIPublisherService { } operations.add(operation); } - apiResponseUtil.setScopes(scopeSet); - apiResponseUtil.setOperations(operations); + apiInfo.setScopes(scopeSet); + apiInfo.setOperations(operations); } if (config.isSharedWithAllTenants()) { - apiResponseUtil.setSubscriptionAvailability(SUBSCRIPTION_TO_ALL_TENANTS); - apiResponseUtil.setVisibility(API_GLOBAL_VISIBILITY); + apiInfo.setSubscriptionAvailability(SUBSCRIPTION_TO_ALL_TENANTS); + apiInfo.setVisibility(API_GLOBAL_VISIBILITY); } else { - apiResponseUtil.setSubscriptionAvailability(SUBSCRIPTION_TO_CURRENT_TENANT); - apiResponseUtil.setVisibility(API_PRIVATE_VISIBILITY); + apiInfo.setSubscriptionAvailability(SUBSCRIPTION_TO_CURRENT_TENANT); + apiInfo.setVisibility(API_PRIVATE_VISIBILITY); } String endpointConfig; @@ -634,9 +634,9 @@ public class APIPublisherServiceImpl implements APIPublisherService { Set transports = new HashSet<>(); transports.addAll(Arrays.asList(config.getTransports())); - apiResponseUtil.setTransport(transports); + apiInfo.setTransport(transports); - apiResponseUtil.setType("HTTP"); + apiInfo.setType("HTTP"); if (config.getEndpointType() != null && "dynamic".equals(config.getEndpointType())) { endpointConfig = "{\n" + @@ -650,7 +650,7 @@ public class APIPublisherServiceImpl implements APIPublisherService { " }"; endPointConfig = new JSONObject(endpointConfig); //TODO: Will be used in dynamic endpoints -// apiResponseUtil.setInSequence(config.getInSequenceName()); +// apiInfo.setInSequence(config.getInSequenceName()); } // if ws endpoint @@ -667,10 +667,10 @@ public class APIPublisherServiceImpl implements APIPublisherService { endPointConfig = new JSONObject(endpointConfig); transports.addAll(Arrays.asList("wss,ws")); - apiResponseUtil.setTransport(transports); - apiResponseUtil.setType("WS"); + apiInfo.setTransport(transports); + apiInfo.setType("WS"); } - apiResponseUtil.setEndpointConfig(endPointConfig); + apiInfo.setEndpointConfig(endPointConfig); List accessControlAllowOrigins = new ArrayList<>(); accessControlAllowOrigins.add("*"); @@ -691,17 +691,17 @@ public class APIPublisherServiceImpl implements APIPublisherService { accessControlAllowMethods.add("OPTIONS"); CORSConfiguration corsConfiguration = new CORSConfiguration(false, accessControlAllowOrigins, false, accessControlAllowHeaders, accessControlAllowMethods); - apiResponseUtil.setCorsConfiguration(corsConfiguration); + apiInfo.setCorsConfiguration(corsConfiguration); - apiResponseUtil.setAuthorizationHeader("Authorization"); + apiInfo.setAuthorizationHeader("Authorization"); List keyManagers = new ArrayList<>(); keyManagers.add("all"); - apiResponseUtil.setKeyManagers(keyManagers); - apiResponseUtil.setEnableSchemaValidation(false); - apiResponseUtil.setMonetization(null); - apiResponseUtil.setServiceInfo(null); + apiInfo.setKeyManagers(keyManagers); + apiInfo.setEnableSchemaValidation(false); + apiInfo.setMonetization(null); + apiInfo.setServiceInfo(null); - return apiResponseUtil; + return apiInfo; //TODO: Will be used in WS or dynamic endpoints // if (config.getEndpointType() != null && "WS".equals(config.getEndpointType())) {