private HttpStatus getCreateResponseCode(CreateServiceInstanceResponse response) { if (response != null) { if (response.isAsync()) { return HttpStatus.ACCEPTED; } else if (response.isInstanceExisted()) { return HttpStatus.OK; } } return HttpStatus.CREATED; }
/** * Create a builder that provides a fluent API for constructing a {@literal GetLastServiceOperationResponse}. * * @return the builder */ public static GetLastServiceOperationResponseBuilder builder() { return new GetLastServiceOperationResponseBuilder(); }
/** * Construct a {@link GetLastServiceOperationResponse} from the provided values. * * @return the newly constructed {@literal GetLastServiceOperationResponse} */ public GetLastServiceOperationResponse build() { return new GetLastServiceOperationResponse(state, description, deleteOperation); } }
@Override public Mono<DeleteServiceInstanceResponse> deleteServiceInstance(DeleteServiceInstanceRequest request) { String serviceInstanceId = request.getServiceInstanceId(); String planId = request.getPlanId(); // // perform the steps necessary to initiate the asynchronous // deletion of all provisioned resources // DeleteServiceInstanceResponse response = DeleteServiceInstanceResponse.builder() .async(true) .build(); return Mono.just(response); }
@Override public Mono<GetLastServiceOperationResponse> getLastOperation(GetLastServiceOperationRequest request) { String serviceInstanceId = request.getServiceInstanceId(); // // determine the status of the operation in progress // OperationState state = OperationState.SUCCEEDED; GetLastServiceOperationResponse response = GetLastServiceOperationResponse.builder() .operationState(state) .build(); return Mono.just(response); } }
private UpdateServiceInstanceRequestBuilder buildUpdateRequest() { return UpdateServiceInstanceRequest.builder() .serviceDefinitionId("service-definition-id") .planId("plan-id") .previousValues(new PreviousValues("previous-plan-id")) .parameters("create-param-1", "value1") .parameters("create-param-2", "value2") .context(requestContext); }
private CreateServiceInstanceRequestBuilder buildCreateRequest() { return CreateServiceInstanceRequest.builder() .serviceDefinitionId("service-definition-id") .planId("plan-id") .parameters("create-param-1", "value1") .parameters("create-param-2", "value2") .context(requestContext); }
/** * Create a builder that provides a fluent API for constructing a {@literal GetServiceInstanceRequest}. * * <p> * This builder is provided to support testing of * {@link org.springframework.cloud.servicebroker.service.ServiceInstanceService} implementations. * * @return the builder */ public static GetServiceInstanceRequestBuilder builder() { return new GetServiceInstanceRequestBuilder(); }
/** * Construct a {@link GetServiceInstanceRequest} from the provided values. * * @return the newly constructed {@literal GetServiceInstanceRequest} */ public GetServiceInstanceRequest build() { return new GetServiceInstanceRequest(serviceInstanceId, platformInstanceId, apiInfoLocation, originatingIdentity); } }
/** * Construct a {@link GetServiceInstanceResponse} from the provided values. * * @return the newly constructed {@literal GetServiceInstanceResponse} */ public GetServiceInstanceResponse build() { return new GetServiceInstanceResponse(serviceDefinitionId, planId, dashboardUrl, parameters); } }
/** * Construct a {@link UpdateServiceInstanceRequest} from the provided values. * * @return the newly constructed {@literal UpdateServiceInstanceRequest} */ public UpdateServiceInstanceRequest build() { return new UpdateServiceInstanceRequest(serviceDefinitionId, serviceInstanceId, planId, serviceDefinition, plan, previousValues, parameters, context, asyncAccepted, platformInstanceId, apiInfoLocation, originatingIdentity); } }
/** * Construct a {@link DeleteServiceInstanceRequest} from the provided values. * * @return the newly constructed {@literal DeleteServiceInstanceRequest} */ public DeleteServiceInstanceRequest build() { return new DeleteServiceInstanceRequest(serviceInstanceId, serviceDefinitionId, planId, serviceDefinition, plan, asyncAccepted, platformInstanceId, apiInfoLocation, originatingIdentity); } }
/** * Construct a {@link CreateServiceInstanceResponse} from the provided values. * * @return the newly constructed {@literal CreateServiceInstanceResponse} */ public CreateServiceInstanceResponse build() { return new CreateServiceInstanceResponse(async, operation, dashboardUrl, instanceExisted); } }
/** * Create a builder that provides a fluent API for constructing a {@literal CreateServiceInstanceResponse}. * * @return the builder */ public static CreateServiceInstanceResponseBuilder builder() { return new CreateServiceInstanceResponseBuilder(); }
/** * Create a builder that provides a fluent API for constructing a {@literal CreateServiceInstanceRequest}. * * <p> * This builder is provided to support testing of * {@link org.springframework.cloud.servicebroker.service.ServiceInstanceService} implementations. * * @return the builder */ public static CreateServiceInstanceRequestBuilder builder() { return new CreateServiceInstanceRequestBuilder(); }
/** * Construct a {@link CreateServiceInstanceRequest} from the provided values. * * @return the newly constructed {@literal CreateServiceInstanceRequest} */ public CreateServiceInstanceRequest build() { return new CreateServiceInstanceRequest(serviceDefinitionId, serviceInstanceId, planId, serviceDefinition, plan, parameters, context, asyncAccepted, platformInstanceId, apiInfoLocation, originatingIdentity); } }
/** * Create a builder that provides a fluent API for constructing a {@literal GetServiceInstanceResponse}. * * @return the builder */ public static GetServiceInstanceResponseBuilder builder() { return new GetServiceInstanceResponseBuilder(); }
@Override public String toString() { return super.toString() + "UpdateServiceInstanceRequest{" + "serviceDefinitionId='" + serviceDefinitionId + '\'' + ", planId='" + planId + '\'' + ", previousValues=" + previousValues + ", serviceInstanceId='" + serviceInstanceId + '\'' + '}'; }
private HttpStatus getCreateResponseCode(CreateServiceInstanceResponse response) { if (response != null) { if (response.isAsync()) { return HttpStatus.ACCEPTED; } else if (response.isInstanceExisted()) { return HttpStatus.OK; } } return HttpStatus.CREATED; }
/** * Create a builder that provides a fluent API for constructing a {@literal GetServiceInstanceRequest}. * * <p> * This builder is provided to support testing of * {@link org.springframework.cloud.servicebroker.service.ServiceInstanceService} implementations. * * @return the builder */ public static GetServiceInstanceRequestBuilder builder() { return new GetServiceInstanceRequestBuilder(); }