Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
switschel committed Oct 21, 2024
2 parents 1745325 + 44c67f0 commit bb92c56
Showing 1 changed file with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,25 +211,12 @@ public ResponseEntity<String> deleteConnectionConfiguration(@PathVariable String
if (configuration.enabled)
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body("Can't delete an enabled connector! Disable connector first.");
//Make sure the connector is disconnected before it is deleted.
if(connectorRegistry.getClientForTenant(tenant, ident).isConnected())
// make sure the connector is disconnected before it is deleted.
if (connectorRegistry.getClientForTenant(tenant, ident).isConnected())
bootstrapService.disableConnector(tenant, ident);
connectorConfigurationComponent.deleteConnectorConfiguration(ident);
mappingComponent.removeConnectorFromDeploymentMap(tenant, ident);
bootstrapService.shutdownAndRemoveConnector(tenant, ident);
// NOTE this block was disabled since a disabled connector is not registered in
// connectorRegistry

// AConnectorClient client = connectorRegistry.getClientForTenant(tenant,
// configuration.getIdent());
// if (client == null)
// return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Client with ident
// " + ident + " not found");
// client.disconnect();
// bootstrapService.shutdownAndRemoveConnector(tenant,
// client.getConnectorIdent());
// connectorConfigurationComponent.deleteConnectorConfiguration(ident);
// mappingComponent.removeConnectorFromDeploymentMap(tenant, ident);
} catch (Exception ex) {
log.error("Tenant {} - Error getting mqtt broker configuration {}", tenant, ex);
throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, ex.getLocalizedMessage());
Expand Down

0 comments on commit bb92c56

Please sign in to comment.