private boolean equalTo(ImmutableIntegrationDeploymentOverview another) { return Objects.equals(userId, another.userId) && currentState.equals(another.currentState) && targetState.equals(another.targetState) && stepsDone.equals(another.stepsDone) && Objects.equals(statusMessage, another.statusMessage) && Objects.equals(id, another.id) && version == another.version && createdAt == another.createdAt && updatedAt == another.updatedAt; }
/** * Computes a hash code from attributes: {@code userId}, {@code currentState}, {@code targetState}, {@code stepsDone}, {@code statusMessage}, {@code id}, {@code version}, {@code createdAt}, {@code updatedAt}. * @return hashCode value */ @Override public int hashCode() { int h = 5381; h += (h << 5) + Objects.hashCode(userId); h += (h << 5) + currentState.hashCode(); h += (h << 5) + targetState.hashCode(); h += (h << 5) + stepsDone.hashCode(); h += (h << 5) + Objects.hashCode(statusMessage); h += (h << 5) + Objects.hashCode(id); h += (h << 5) + version; h += (h << 5) + Long.hashCode(createdAt); h += (h << 5) + Long.hashCode(updatedAt); return h; }
private void checkIntegrationStatus(IntegrationDeployment integrationDeployment) { if (integrationDeployment == null) { return; } IntegrationDeployment reconciled = reconcileDeployment(integrationDeployment); IntegrationDeploymentState desiredState = reconciled.getTargetState(); IntegrationDeploymentState currentState = reconciled.getCurrentState(); if (!currentState.equals(desiredState)) { reconciled.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, reconciled); } }); } else if (reconciled.getCurrentState() != integrationDeployment.getCurrentState()) { dataManager.update(reconciled); scheduledChecks.remove(getIntegrationMarkerKey(reconciled)); } else { scheduledChecks.remove(getIntegrationMarkerKey(reconciled)); } }
private void deactivatePreviousDeployments(IntegrationDeployment integrationDeployment) { dataManager.fetchIdsByPropertyValue(IntegrationDeployment.class, "integrationId", integrationDeployment.getIntegrationId().get(), "targetState", IntegrationDeploymentState.Published.name()) .stream() .map(id -> dataManager.fetch(IntegrationDeployment.class, id)) .filter(r -> r.getVersion() != integrationDeployment.getVersion()) .map(r -> r.unpublishing()) .forEach(r -> { dataManager.update(r); }); }
private boolean equalTo(ImmutableIntegrationDeployment another) { return integrationId.equals(another.integrationId) && Objects.equals(spec, another.spec) && Objects.equals(userId, another.userId) && currentState.equals(another.currentState) && targetState.equals(another.targetState) && stepsDone.equals(another.stepsDone) && Objects.equals(statusMessage, another.statusMessage) && Objects.equals(id, another.id) && version == another.version && createdAt == another.createdAt && updatedAt == another.updatedAt; }
/** * Computes a hash code from attributes: {@code integrationId}, {@code spec}, {@code userId}, {@code currentState}, {@code targetState}, {@code stepsDone}, {@code statusMessage}, {@code id}, {@code version}, {@code createdAt}, {@code updatedAt}. * @return hashCode value */ @Override public int hashCode() { int h = 5381; h += (h << 5) + integrationId.hashCode(); h += (h << 5) + Objects.hashCode(spec); h += (h << 5) + Objects.hashCode(userId); h += (h << 5) + currentState.hashCode(); h += (h << 5) + targetState.hashCode(); h += (h << 5) + stepsDone.hashCode(); h += (h << 5) + Objects.hashCode(statusMessage); h += (h << 5) + Objects.hashCode(id); h += (h << 5) + version; h += (h << 5) + Long.hashCode(createdAt); h += (h << 5) + Long.hashCode(updatedAt); return h; }
private boolean equalTo(ImmutableIntegrationOverview another) { return isDraft == another.isDraft && currentState.equals(another.currentState) && targetState.equals(another.targetState) && Objects.equals(deploymentVersion, another.deploymentVersion) && deployments.equals(another.deployments) && board.equals(another.board) && Objects.equals(url, another.url) && Objects.equals(id, another.id) && isDeleted == another.isDeleted && steps.equals(another.steps) && flows.equals(another.flows) && connections.equals(another.connections) && Objects.equals(description, another.description) && properties.equals(another.properties) && configuredProperties.equals(another.configuredProperties) && version == another.version && createdAt == another.createdAt && updatedAt == another.updatedAt && tags.equals(another.tags) && Objects.equals(name, another.name) && resources.equals(another.resources); }
/** * Computes a hash code from attributes: {@code isDraft}, {@code currentState}, {@code targetState}, {@code deploymentVersion}, {@code deployments}, {@code board}, {@code url}, {@code id}, {@code isDeleted}, {@code steps}, {@code flows}, {@code connections}, {@code description}, {@code properties}, {@code configuredProperties}, {@code version}, {@code createdAt}, {@code updatedAt}, {@code tags}, {@code name}, {@code resources}. * @return hashCode value */ @Override public int hashCode() { int h = 5381; h += (h << 5) + Boolean.hashCode(isDraft); h += (h << 5) + currentState.hashCode(); h += (h << 5) + targetState.hashCode(); h += (h << 5) + Objects.hashCode(deploymentVersion); h += (h << 5) + deployments.hashCode(); h += (h << 5) + board.hashCode(); h += (h << 5) + Objects.hashCode(url); h += (h << 5) + Objects.hashCode(id); h += (h << 5) + Boolean.hashCode(isDeleted); h += (h << 5) + steps.hashCode(); h += (h << 5) + flows.hashCode(); h += (h << 5) + connections.hashCode(); h += (h << 5) + Objects.hashCode(description); h += (h << 5) + properties.hashCode(); h += (h << 5) + configuredProperties.hashCode(); h += (h << 5) + version; h += (h << 5) + Long.hashCode(createdAt); h += (h << 5) + Long.hashCode(updatedAt); h += (h << 5) + tags.hashCode(); h += (h << 5) + Objects.hashCode(name); h += (h << 5) + resources.hashCode(); return h; }
private boolean stale(StateChangeHandler handler, IntegrationDeployment integrationDeployment) { if (integrationDeployment == null || handler == null) { return true; } IntegrationDeploymentState desiredState = integrationDeployment.getTargetState(); return desiredState.equals(integrationDeployment.getCurrentState()); }
private Collection<? extends LeveledMessage> computeDeploymentDifferences(Integration integration, Collection<IntegrationDeployment> allDeployments) { List<IntegrationDeployment> deployments = allDeployments.stream() .filter(d -> d.getIntegrationId().equals(integration.getId())) .filter(d -> d.getCurrentState().equals(IntegrationDeploymentState.Published)) .collect(Collectors.toList());
if (targetState.equals(Published)) {