Source:
protected Selectable doAccept(HandlerEvent event) { DatabaseBackupRequest request = event.getData(); Selectable result; Long stackId = request.getResourceId(); LOGGER.debug("Backing up database on stack {}, backup id {}", stackId, request.getBackupId()); try { Stack stack = stackService.getByIdWithListsInTransaction(stackId); Cluster cluster = stack.getCluster(); InstanceMetaData gatewayInstance = stack.getPrimaryGatewayInstance(); GatewayConfig gatewayConfig = gatewayConfigService.getGatewayConfig(stack, gatewayInstance, cluster.hasGateway()); Set<String> gatewayFQDN = Collections.singleton(gatewayInstance.getDiscoveryFQDN()); ExitCriteriaModel exitModel = ClusterDeletionBasedExitCriteriaModel.clusterDeletionBasedModel(stackId, cluster.getId()); Optional<LdapView> ldapView = ldapConfigService.get(stack.getEnvironmentCrn(), stack.getName()); String virtualGroupsEnvironmentCrn = environmentConfigProvider.getParentEnvironmentCrn(stack.getEnvironmentCrn()); String adminGroup = ldapView.orElseThrow(() -> new CloudbreakServiceException("Ranger admin group not found.")) .getAdminGroup(); LOGGER.error("Admin Group:", adminGroup); VirtualGroupRequest virtualGroupRequest = new VirtualGroupRequest(virtualGroupsEnvironmentCrn, adminGroup); String rangerAdminGroup = virtualGroupService.getVirtualGroup(virtualGroupRequest, UmsRight.RANGER_ADMIN.getRight()); SaltConfig saltConfig = saltConfigGenerator.createSaltConfig(request.getBackupLocation(), request.getBackupId(), rangerAdminGroup, stack); hostOrchestrator.backupDatabase(gatewayConfig, gatewayFQDN, stackUtil.collectReachableNodes(stack), saltConfig, exitModel); result = new DatabaseBackupSuccess(stackId); } catch (Exception e) { LOGGER.error("Database backup event failed", e); result = new DatabaseBackupFailedEvent(stackId, e, DetailedStackStatus.DATABASE_BACKUP_FAILED); } return result; }

Target:
protected Selectable doAccept(HandlerEvent event) { DatabaseBackupRequest request = event.getData(); Selectable result; Long stackId = request.getResourceId(); LOGGER.debug("Backing up database on stack {}, backup id {}", stackId, request.getBackupId()); try { Stack stack = stackService.getByIdWithListsInTransaction(stackId); Cluster cluster = stack.getCluster(); InstanceMetaData gatewayInstance = stack.getPrimaryGatewayInstance(); GatewayConfig gatewayConfig = gatewayConfigService.getGatewayConfig(stack, gatewayInstance, cluster.hasGateway()); Set<String> gatewayFQDN = Collections.singleton(gatewayInstance.getDiscoveryFQDN()); ExitCriteriaModel exitModel = ClusterDeletionBasedExitCriteriaModel.clusterDeletionBasedModel(stackId, cluster.getId()); String rangerAdminGroup = rangerVirtualGroupService.getRangerVirtualGroup(stack); SaltConfig saltConfig = saltConfigGenerator.createSaltConfig(request.getBackupLocation(), request.getBackupId(), rangerAdminGroup, stack); hostOrchestrator.backupDatabase(gatewayConfig, gatewayFQDN, stackUtil.collectReachableNodes(stack), saltConfig, exitModel); result = new DatabaseBackupSuccess(stackId); } catch (Exception e) { LOGGER.error("Database backup event failed", e); result = new DatabaseBackupFailedEvent(stackId, e, DetailedStackStatus.DATABASE_BACKUP_FAILED); } return result; }