Search in sources :

Example 1 with StateChangeHandler

use of io.syndesis.server.controller.StateChangeHandler in project syndesis by syndesisio.

the class IntegrationController method checkIntegrationStatus.

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));
    }
}
Also used : IntegrationDeploymentState(io.syndesis.common.model.integration.IntegrationDeploymentState) StateChangeHandler(io.syndesis.server.controller.StateChangeHandler)

Aggregations

IntegrationDeploymentState (io.syndesis.common.model.integration.IntegrationDeploymentState)1 StateChangeHandler (io.syndesis.server.controller.StateChangeHandler)1