private void checkIntegrationStatusIfNotAlreadyInProgress(String id) { executor.execute(() -> { IntegrationDeployment integrationDeployment = dataManager.fetch(IntegrationDeployment.class, id); if( integrationDeployment!=null ) { String scheduledKey = getIntegrationMarkerKey(integrationDeployment); // Don't start check is already a check is running if (!scheduledChecks.contains(scheduledKey)) { checkIntegrationStatus(integrationDeployment); } } }); }
private void checkIntegrationStatusIfNotAlreadyInProgress(String id) { executor.execute(() -> { IntegrationDeployment integrationDeployment = dataManager.fetch(IntegrationDeployment.class, id); if( integrationDeployment != null) { String scheduledKey = getIntegrationMarkerKey(integrationDeployment); LOG.debug("Check if IntegrationStatus {} is already in progress for key: {} (keys: {})", id, scheduledKey, scheduledChecks); // Don't start check is already a check is running if (!scheduledChecks.contains(scheduledKey)) { checkIntegrationStatus(integrationDeployment); } else { LOG.debug("A check for IntegrationDeployment {} is already configured with key {}", id, scheduledKey); } } else { LOG.debug("No IntegrationDeployment with id: {}", id); } }); }
private void checkIntegrationStatus(IntegrationDeployment integrationDeployment) { if (integrationDeployment == null) { return; } IntegrationDeploymentState desiredState = integrationDeployment.getTargetState(); IntegrationDeploymentState currentState = integrationDeployment.getCurrentState(); if (!currentState.equals(desiredState)) { integrationDeployment.getId().ifPresent(integrationDeploymentId -> { StateChangeHandler statusChangeHandler = handlers.get(desiredState); if (statusChangeHandler != null) { LOG.info("Integration {} : Desired status \"{}\" != current status \"{}\" --> calling status change handler", integrationDeploymentId, desiredState.toString(), currentState); callStateChangeHandler(statusChangeHandler, integrationDeploymentId); } }); } else { scheduledChecks.remove(getIntegrationMarkerKey(integrationDeployment)); } }
private void checkIntegrationStatus(IntegrationDeployment integrationDeployment) { if (integrationDeployment == null) { return; } IntegrationDeploymentState desiredState = integrationDeployment.getTargetState(); IntegrationDeploymentState currentState = integrationDeployment.getCurrentState(); if (!currentState.equals(desiredState)) { integrationDeployment.getId().ifPresent(integrationDeploymentId -> { StateChangeHandler statusChangeHandler = handlers.get(desiredState); if (statusChangeHandler != null) { LOG.info("Integration {} : Desired status \"{}\" != current status \"{}\" --> calling status change handler", integrationDeploymentId, desiredState.toString(), currentState); callStateChangeHandler(statusChangeHandler, integrationDeploymentId); } }); } else { scheduledChecks.remove(getIntegrationMarkerKey(integrationDeployment)); } }
void callStateChangeHandler(StateChangeHandler handler, String integrationDeploymentId) { executor.execute(() -> { IntegrationDeployment integrationDeployment = dataManager.fetch(IntegrationDeployment.class, integrationDeploymentId); String checkKey = getIntegrationMarkerKey(integrationDeployment); scheduledChecks.add(checkKey);
/* default */ void callStateChangeHandler(StateChangeHandler handler, String integrationDeploymentId) { executor.execute(() -> { IntegrationDeployment integrationDeployment = dataManager.fetch(IntegrationDeployment.class, integrationDeploymentId); String checkKey = getIntegrationMarkerKey(integrationDeployment); scheduledChecks.add(checkKey);