Skip to content

Commit e3514f7

Browse files
committed
Fix external gateway check
1 parent 98b08c4 commit e3514f7

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIAdminImpl.java

-18
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,6 @@ public Environment addEnvironment(String tenantDomain, Environment environment)
200200
Environment environmentToStore = new Environment(environment);
201201
encryptGatewayConfigurationValues(null, environmentToStore);
202202
apiMgtDAO.addEnvironment(tenantDomain, environment);
203-
204-
if (environment.getProvider().equals(APIConstants.EXTERNAL_GATEWAY_VENDOR)) {
205-
GatewayConfigurationService gatewayConfigurationService = new GatewayConfigurationServiceImpl();
206-
gatewayConfigurationService.addGatewayConfiguration(tenantDomain, environment.getName(),
207-
environment.getGatewayType(), environment);
208-
}
209203
return environment;
210204
}
211205

@@ -220,11 +214,6 @@ public void deleteEnvironment(String tenantDomain, String uuid) throws APIManage
220214
ExceptionCodes.from(ExceptionCodes.READONLY_GATEWAY_ENVIRONMENT, String.format("UUID '%s'", uuid)));
221215
}
222216
apiMgtDAO.deleteEnvironment(uuid);
223-
224-
if (existingEnv.getProvider().equals(APIConstants.EXTERNAL_GATEWAY_VENDOR)) {
225-
GatewayConfigurationService gatewayConfigurationService = new GatewayConfigurationServiceImpl();
226-
gatewayConfigurationService.removeGatewayConfiguration(tenantDomain, existingEnv.getName());
227-
}
228217
}
229218

230219
@Override
@@ -262,13 +251,6 @@ public Environment updateEnvironment(String tenantDomain, Environment environmen
262251
// Perform a separate task of updating gateway label names
263252
updateGatewayLabelNameForGatewayPolicies(existingEnv.getDisplayName(), updatedEnvironment.getDisplayName(),
264253
tenantDomain);
265-
266-
if (environment.getProvider().equals(APIConstants.EXTERNAL_GATEWAY_VENDOR)) {
267-
GatewayConfigurationService gatewayConfigurationService = new GatewayConfigurationServiceImpl();
268-
gatewayConfigurationService.updateGatewayConfiguration(tenantDomain, environment.getName(),
269-
environment.getType(), environment);
270-
}
271-
272254
return updatedEnvironment;
273255
}
274256

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/notifier/ExternalGatewayNotifier.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private boolean isExternalGatewayAvailableToDeployment(DeployAPIInGatewayEvent d
167167
Map<String, Environment> environments = APIUtil.getEnvironments(deployAPIInGatewayEvent.getTenantDomain());
168168
for (String label : gatewayLabels) {
169169
Environment environment = environments.get(label);
170-
if (environment != null && !APIConstants.WSO2_GATEWAY_ENVIRONMENT.equals(environment.getGatewayType())) {
170+
if (environment != null && !APIConstants.WSO2_GATEWAY_ENVIRONMENT.equals(environment.getProvider())) {
171171
return true;
172172
}
173173
}

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10407,7 +10407,7 @@ public static boolean isAnyExternalGateWayProviderExists(String tenantDomain) {
1040710407
try {
1040810408
Map<String, Environment> environments = getEnvironments(tenantDomain);
1040910409
for (Environment environment : environments.values()) {
10410-
if (!APIConstants.WSO2_GATEWAY_ENVIRONMENT.equals(environment.getGatewayType())) {
10410+
if (!APIConstants.WSO2_GATEWAY_ENVIRONMENT.equals(environment.getProvider())) {
1041110411
return true;
1041210412
}
1041310413
}

0 commit comments

Comments
 (0)