Skip to content

Commit

Permalink
Revert "add type into envoy artifact"
Browse files Browse the repository at this point in the history
  • Loading branch information
tharindu1st authored Feb 15, 2024
1 parent 869926e commit 13fdd58
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.wso2.carbon.apimgt.impl.importexport.APIImportExportException;
import org.wso2.carbon.apimgt.impl.importexport.ExportFormat;
import org.wso2.carbon.apimgt.impl.importexport.utils.CommonUtil;
import org.wso2.carbon.apimgt.impl.utils.APIUtil;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -81,13 +80,11 @@ public RuntimeArtifactDto generateGatewayArtifact(List<APIRuntimeArtifactDto> ap
apiProjectDto.setEnvironments(new HashSet<>());
apiProjectDto.setOrganizationId(apiRuntimeArtifactDto.getOrganization());
}
Map<String, org.wso2.carbon.apimgt.api.model.Environment> environments = APIUtil.getEnvironments(apiRuntimeArtifactDto.getOrganization());
// environment is unique for a revision in a deployment
// create new environment
EnvironmentDto environment = new EnvironmentDto();
environment.setName(apiRuntimeArtifactDto.getLabel());
environment.setVhost(apiRuntimeArtifactDto.getVhost());
environment.setType(environments.get(apiRuntimeArtifactDto.getLabel()).getType());
environment.setDeployedTimeStamp(apiRuntimeArtifactDto.getDeployedTimeStamp());
apiProjectDto.getEnvironments().add(environment); // ignored if the name of the environment is same
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ public static RuntimeArtifactDto generateRuntimeArtifact(String apiId, String na
ServiceReferenceHolder.getInstance().getGatewayArtifactGenerator(type);
if (gatewayArtifactGenerator != null) {
List<APIRuntimeArtifactDto> gatewayArtifacts = getRuntimeArtifacts(apiId, gatewayLabel, tenantDomain);
if (gatewayArtifacts != null && !gatewayArtifacts.isEmpty()) {
return gatewayArtifactGenerator.generateGatewayArtifact(gatewayArtifacts);
} else {
return null;
}
return gatewayArtifactGenerator.generateGatewayArtifact(gatewayArtifacts);
} else {
Set<String> gatewayArtifactGeneratorTypes =
ServiceReferenceHolder.getInstance().getGatewayArtifactGeneratorTypes();
Expand Down Expand Up @@ -92,7 +88,6 @@ public static RuntimeArtifactDto generateAllRuntimeArtifact(String apiId, String

public static RuntimeArtifactDto generateMetadataArtifact(String tenantDomain, String apiId, String gatewayLabel)
throws APIManagementException {

List<APIRuntimeArtifactDto> gatewayArtifacts = getRuntimeArtifacts(apiId, gatewayLabel, tenantDomain);
if (gatewayArtifacts != null) {

Expand Down Expand Up @@ -198,7 +193,6 @@ public static RuntimeArtifactDto generateAllMetadataArtifact(String apiId, Strin

private static List<APIRuntimeArtifactDto> getRuntimeArtifacts(String apiId, String gatewayLabel,
String tenantDomain) throws APIManagementException {

List<APIRuntimeArtifactDto> gatewayArtifacts;
if (StringUtils.isNotEmpty(gatewayLabel)) {
byte[] decodedValue = Base64.decodeBase64(gatewayLabel.getBytes());
Expand Down Expand Up @@ -226,7 +220,6 @@ private static List<APIRuntimeArtifactDto> getRuntimeArtifacts(String apiId, Str

private static List<APIRuntimeArtifactDto> getAllRuntimeArtifacts(String apiId, String gatewayLabel)
throws APIManagementException {

List<APIRuntimeArtifactDto> gatewayArtifacts;
if (StringUtils.isNotEmpty(gatewayLabel)) {
byte[] decodedValue = Base64.decodeBase64(gatewayLabel.getBytes());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@ public class EnvironmentDto {

private long deployedTimeStamp;

private String type;

public String getType() {

return type;
}

public void setType(String type) {

this.type = type;
}

public String getName() {
return name;
}
Expand Down

0 comments on commit 13fdd58

Please sign in to comment.