Skip to content

Commit

Permalink
Fix: Checkstyle Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BLasan committed Sep 14, 2024
1 parent 5be42ca commit 1fac89a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,10 @@ public static File exportApi(APIProvider apiProvider, APIIdentifier apiIdentifie
addOperationPoliciesToArchive(archivePath, tenantDomain, exportFormat, apiProvider,
api, currentApiUuid);

// TODO: Add Custom Backend to the Archive
JsonObject endpointConfig = JsonParser.parseString(api.getEndpointConfig()).getAsJsonObject();
if (APIConstants.ENDPOINT_TYPE_SEQUENCE.equals(
endpointConfig.get(API_ENDPOINT_CONFIG_PROTOCOL_TYPE).getAsString())) {
addCustomBackendToArchive(archivePath, apiProvider, currentApiUuid, endpointConfig);
addCustomBackendToArchive(archivePath, apiProvider, currentApiUuid);
}

addGatewayEnvironmentsToArchive(archivePath, apiDtoToReturn.getId(), exportFormat, apiProvider);
Expand Down Expand Up @@ -637,20 +636,21 @@ public static void addEndpointCertificatesToArchive(String archivePath, APIDTO a
}
}

public static void addCustomBackendToArchive(String archivePath, APIProvider apiProvider, String apiUUID,
JsonObject endpointConfig) throws APIManagementException {
public static void addCustomBackendToArchive(String archivePath, APIProvider apiProvider, String apiUUID)
throws APIManagementException {
try {
CommonUtil.createDirectory(archivePath + File.separator + ImportExportConstants.CUSTOM_BACKEND_DIRECTORY);

// Add production Backend Sequences
CustomBackendData data = apiProvider.getCustomBackendByAPIUUID(apiUUID, APIConstants.API_KEY_TYPE_PRODUCTION);
if(data != null) {
CustomBackendData data = apiProvider.getCustomBackendByAPIUUID(apiUUID,
APIConstants.API_KEY_TYPE_PRODUCTION);
if (data != null) {
exportCustomBackend(data.getName(), data.getSequence(), archivePath);
}

// Add sandbox Backend Sequences
data = apiProvider.getCustomBackendByAPIUUID(apiUUID, APIConstants.API_KEY_TYPE_SANDBOX);
if(data != null) {
if (data != null) {
exportCustomBackend(data.getName(), data.getSequence(), archivePath);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,8 @@ public static void updateAPIWithCustomBackend(API api, String extractedFolderPat
String seqName = APIUtil.getCustomBackendName(api.getUuid(), APIConstants.API_KEY_TYPE_PRODUCTION);
String seqId = UUID.randomUUID().toString();
InputStream seq = APIUtil.getCustomBackendSequence(customBackendDir, seqFile, ".xml");
apiProvider.updateCustomBackend(api.getUuid(), APIConstants.API_KEY_TYPE_PRODUCTION, seq, seqName, seqId);
apiProvider.updateCustomBackend(api.getUuid(), APIConstants.API_KEY_TYPE_PRODUCTION, seq, seqName,
seqId);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ public static API updateApi(API originalAPI, APIDTO apiDtoToUpdate, APIProvider
* @param endpointType Endpoint Type of the Custom Backend (SANDBOX, PRODUCTION)
* @param customBackend Custom Backend
* @param contentDecomp Header Content of the Request
* @return Custom Backend File Name
* @throws APIManagementException If an error occurs while updating the API and API definition
*/
public static void updateCustomBackend(API api, APIProvider apiProvider, String endpointType,
Expand Down

0 comments on commit 1fac89a

Please sign in to comment.