From a39f2bdaf60296e72d7cb5e9c00ef5bcdf1b298a Mon Sep 17 00:00:00 2001 From: hiranyakavishani Date: Wed, 11 Oct 2023 10:43:36 +0530 Subject: [PATCH] Fixing typo issues --- .../org/wso2/carbon/apimgt/impl/APIProviderImpl.java | 9 +++++++++ .../wso2/carbon/apimgt/impl/utils/LifeCycleUtils.java | 2 +- .../api/publisher/v1/impl/ApiProductsApiServiceImpl.java | 3 +-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java index 7f928f2c06ec..1e988a5ebef6 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java @@ -1920,6 +1920,15 @@ public API createNewAPIVersion(String existingApiId, String newVersion, Boolean return getAPIbyUUID(newAPIId, organization); } + /** + * Create a new API Product version from an existing API Product + * @param existingApiProductId The id of the API Product to be copied + * @param newVersion The version of the new API Product + * @param isDefaultVersion whether this version is default or not + * @param organization Identifier of an organization + * @return APIProduct object + * @throws APIManagementException + */ public APIProduct createNewAPIProductVersion(String existingApiProductId, String newVersion, Boolean isDefaultVersion, String organization) throws APIManagementException { diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/LifeCycleUtils.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/LifeCycleUtils.java index 45afc2f8a779..32019f2fd73a 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/LifeCycleUtils.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/LifeCycleUtils.java @@ -139,7 +139,7 @@ private static void changeAPIProductLifecycle(APIProvider apiProvider, APIProduc throw new APIManagementException("Invalid Lifecycle status provided for default APIExecutor"); } - // If the API status is CREATED/PROTOTYPED ,check for check list items of lifecycle + // If the API Product status is CREATED/PROTOTYPED ,check for check list items of lifecycle executeLifeCycleChecklist(apiProvider, new ApiTypeWrapper(apiProduct), currentState, targetState, checklist); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/impl/ApiProductsApiServiceImpl.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/impl/ApiProductsApiServiceImpl.java index b363e72458e0..33d72fa91732 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/impl/ApiProductsApiServiceImpl.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/impl/ApiProductsApiServiceImpl.java @@ -1161,7 +1161,6 @@ public Response createNewAPIProductVersion(String newVersion, String apiProductI } APIProvider apiProvider = RestApiCommonUtil.getLoggedInUserProvider(); String tenantDomain = RestApiCommonUtil.getLoggedInUserTenantDomain(); - APIProduct versionedAPIProduct = apiProvider.createNewAPIProductVersion(apiProductId, newVersion, defaultVersion, tenantDomain); newVersionedApiProduct = APIMappingUtil.fromAPIProducttoDTO(versionedAPIProduct); @@ -1179,7 +1178,7 @@ public Response createNewAPIProductVersion(String newVersion, String apiProductI // the existence of the resource RestApiUtil.handleResourceNotFoundError(RestApiConstants.RESOURCE_API_PRODUCT, apiProductId, e, log); } else if (isAuthorizationFailure(e)) { - RestApiUtil.handleAuthorizationFailure("Authorization failure while copying API : " + RestApiUtil.handleAuthorizationFailure("Authorization failure while copying API Product : " + apiProductId, e, log); } else { String errorMessage = "Error while copying API Product : " + apiProductId;