Java Code Examples for org.springframework.cloud.servicebroker.model.binding.DeleteServiceInstanceBindingRequest#getBindingId()

The following examples show how to use org.springframework.cloud.servicebroker.model.binding.DeleteServiceInstanceBindingRequest#getBindingId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EcsServiceInstanceBindingService.java    From ecs-cf-service-broker with Apache License 2.0 5 votes vote down vote up
@Override
public Mono<DeleteServiceInstanceBindingResponse> deleteServiceInstanceBinding(DeleteServiceInstanceBindingRequest request)
        throws ServiceBrokerException {

    String bindingId = request.getBindingId();
    try {
        BindingWorkflow workflow = getWorkflow(request)
                .withDeleteRequest(request);

        LOG.info("looking up binding: " + bindingId);
        ServiceInstanceBinding binding = repository.find(bindingId);
        if (binding == null)
            throw new ServiceInstanceBindingDoesNotExistException(bindingId);
        LOG.info("binding found: " + bindingId);

        workflow.removeBinding(binding);

        LOG.info("deleting from repository" + bindingId);
        repository.delete(bindingId);
        return Mono.just(DeleteServiceInstanceBindingResponse.builder()
                .async(false)
                .build());
    } catch (Exception e) {
        LOG.error("Error deleting binding: " + e);
        throw new ServiceBrokerException(e);
    }
}
 
Example 2
Source File: EcsServiceInstanceBindingService.java    From ecs-cf-service-broker with Apache License 2.0 5 votes vote down vote up
private boolean isRemoteConnectBinding(DeleteServiceInstanceBindingRequest deleteRequest) throws IOException {
    String bindingId = deleteRequest.getBindingId();
    ServiceInstanceBinding binding = repository.find(bindingId);
    if (binding == null)
        throw new ServiceInstanceBindingDoesNotExistException(bindingId);
    return isRemoteConnectBinding(binding.getParameters());
}
 
Example 3
Source File: ExampleServiceBindingService.java    From spring-cloud-open-service-broker with Apache License 2.0 5 votes vote down vote up
@Override
public Mono<DeleteServiceInstanceBindingResponse> deleteServiceInstanceBinding(DeleteServiceInstanceBindingRequest request) {
	String serviceInstanceId = request.getServiceInstanceId();
	String bindingId = request.getBindingId();

	//
	// delete any binding-specific credentials
	//

	return Mono.just(DeleteServiceInstanceBindingResponse.builder()
			.async(true)
			.build());
}
 
Example 4
Source File: ServiceInstanceBindingEventServiceTest.java    From spring-cloud-open-service-broker with Apache License 2.0 5 votes vote down vote up
@Override
public Mono<DeleteServiceInstanceBindingResponse> deleteServiceInstanceBinding(
		DeleteServiceInstanceBindingRequest request) {
	if (request.getBindingId() == null) {
		return Mono.error(new ServiceInstanceBindingDoesNotExistException("service-binding-id"));
	}
	return Mono.just(DeleteServiceInstanceBindingResponse.builder().build());
}
 
Example 5
Source File: BindingWorkflowImpl.java    From ecs-cf-service-broker with Apache License 2.0 4 votes vote down vote up
public BindingWorkflow withDeleteRequest(DeleteServiceInstanceBindingRequest request) {
    this.instanceId = request.getServiceInstanceId();
    this.bindingId = request.getBindingId();
    return(this);
}