@POST @Produces(MediaType.APPLICATION_JSON) @Path("/{id}/deployments/{version}/targetState") @SuppressFBWarnings("UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD") public void setTargetStatus( @NotNull @PathParam("id") @ApiParam(required = true) String id, @NotNull @PathParam("version") @ApiParam(required = true) Integer version, TargetStateRequest request) { String compositeId = IntegrationDeployment.compositeId(id, version); IntegrationDeployment deployment = getDataManager().fetch(IntegrationDeployment.class, compositeId); deployment = new IntegrationDeployment.Builder().createFrom(deployment).targetState(request.targetState).build(); getDataManager().update(deployment); }
.createFrom(current) .currentState(IntegrationDeploymentState.Error) .statusMessage(Exceptions.toString(e))
.createFrom(integrationDeployment) .spec(builder.steps(steps).build()) .build();
IntegrationDeployment current = dataManager.fetch(IntegrationDeployment.class, integrationDeploymentId); IntegrationDeployment updated = new IntegrationDeployment.Builder() .createFrom(current) .createFrom(current) .currentState(IntegrationDeploymentState.Error) .lastUpdated(new Date())
@Override public StateUpdate execute(IntegrationDeployment integrationDeployment) { IntegrationDeploymentState currentState = !openShiftService().exists(integrationDeployment.getSpec().getName()) || openShiftService().delete(integrationDeployment.getSpec().getName()) ? IntegrationDeploymentState.Unpublished : IntegrationDeploymentState.Pending; if (currentState == IntegrationDeploymentState.Unpublished) { logInfo(integrationDeployment,"Deleted"); IntegrationDeployment updated = new IntegrationDeployment.Builder().createFrom(integrationDeployment).addAllStepsDone(Collections.emptyList()).build(); dataManager.update(updated); } return new StateUpdate(currentState); }
public IntegrationDeployment encrypt(IntegrationDeployment integrationDeployment) { return new IntegrationDeployment.Builder() .createFrom(integrationDeployment) .spec(new IntegrationDeploymentSpec.Builder().createFrom(integrationDeployment.getSpec()).steps(encrypt(integrationDeployment.getSpec().getSteps())).build()) .build(); }