• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DeleteServiceInstanceBindingRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest的典型用法代码示例。如果您正苦于以下问题:Java DeleteServiceInstanceBindingRequest类的具体用法?Java DeleteServiceInstanceBindingRequest怎么用?Java DeleteServiceInstanceBindingRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DeleteServiceInstanceBindingRequest类属于org.cloudfoundry.community.servicebroker.model包,在下文中一共展示了DeleteServiceInstanceBindingRequest类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: deleteServiceInstanceBinding

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
@Override
public ServiceInstanceBinding deleteServiceInstanceBinding(DeleteServiceInstanceBindingRequest request) throws ServiceBrokerException {
    DbDumperServiceInstanceBinding dbDumperServiceInstanceBinding = repositoryInstanceBinding.findOne(request.getBindingId());
    if (dbDumperServiceInstanceBinding == null) {
        throw new ServiceBrokerException("Cannot find binding instance: " + request.getBindingId());
    }
    Map<String, Object> credentials = Maps.newHashMap();
    ServiceInstanceBinding serviceInstanceBinding = new ServiceInstanceBinding(
            dbDumperServiceInstanceBinding.getId(),
            dbDumperServiceInstanceBinding.getDbDumperServiceInstance().getServiceInstanceId(),
            credentials,
            null,
            dbDumperServiceInstanceBinding.getAppGuid()
    );
    repositoryInstanceBinding.delete(dbDumperServiceInstanceBinding);
    return serviceInstanceBinding;
}
 
开发者ID:orange-cloudfoundry,项目名称:db-dumper-service,代码行数:18,代码来源:DbDumperServiceInstanceBindingService.java


示例2: deleteServiceInstanceBinding

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
@Override
public ServiceInstanceBinding deleteServiceInstanceBinding(
		DeleteServiceInstanceBindingRequest request)
		throws ServiceBrokerException {
	try {
		log(request.getBindingId(), "Removing binding ", IN_PROGRESS);
		ServiceInstanceBinding binding = bindings.removeBinding(request
				.getBindingId());
		log(request.getBindingId(), "Removing binding ", COMPLETE);

		return binding;
	} catch (Exception e) {
		log(request.getBindingId(), "Failed to remove binding ", FAILED);
		throw e;
	}
}
 
开发者ID:krujos,项目名称:data-lifecycle-service-broker,代码行数:17,代码来源:LCServiceInstanceBindingService.java


示例3: deleteServiceInstanceBinding

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
@Override
public ServiceInstanceBinding deleteServiceInstanceBinding(DeleteServiceInstanceBindingRequest deleteRequest)
        throws ServiceBrokerException {
    LOGGER.debug(LoggerHelper.getParamsAsString("deleteServiceInstanceBinding", deleteRequest.getBindingId(),
            deleteRequest.getInstance(), deleteRequest.getServiceId(), deleteRequest.getPlanId()));
    Optional<ServiceInstanceBinding> bindingInstance;
    try {
        Location storingLocation = Location.newInstance(deleteRequest.getBindingId(),
            deleteRequest.getInstance().getServiceInstanceId());

        bindingInstance = store.deleteById(storingLocation)
                .map(createRequest -> rewriteMissingAttrs(createRequest, deleteRequest))
                .map(this::getServiceInstanceBinding);

    } catch (IOException e) {
        throw new ServiceBrokerException(e.getMessage(), e);
    }
    return bindingInstance.orElse(null);
}
 
开发者ID:trustedanalytics,项目名称:broker-store,代码行数:20,代码来源:ServiceInstanceBindingServiceStore.java


示例4: deleteBindingPlanShared_bindingCreated_bindingDeletedFromFileSystem

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
@Test(expected = IOException.class)
public void deleteBindingPlanShared_bindingCreated_bindingDeletedFromFileSystem() throws Exception {
  //arrange
  String bindingId = UUID.randomUUID().toString();
  String serviceInstanceId = UUID.randomUUID().toString();
  ServiceInstance instance = getServiceInstance(serviceInstanceId, "fakeBaseGuid-shared-plan");
  serviceBean.createServiceInstance(getCreateInstanceRequest(instance));

  CreateServiceInstanceBindingRequest bindReq = getCreateBindingRequest(serviceInstanceId).withBindingId(bindingId);
  bindingBean.createServiceInstanceBinding(bindReq);

  //act
  DeleteServiceInstanceBindingRequest deleteRequest = getDeleteBindingRequest(serviceInstanceId, bindReq);
  bindingBean.deleteServiceInstanceBinding(deleteRequest);

  //assert
  zkClient.getZNode(serviceInstanceId + "/" + bindingId);
}
 
开发者ID:trustedanalytics,项目名称:hdfs-broker,代码行数:19,代码来源:CreateDeleteThenGetTest.java


示例5: deleteServiceInstanceBinding

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
@Override
public ServiceInstanceBinding deleteServiceInstanceBinding(DeleteServiceInstanceBindingRequest request)
        throws ServiceBrokerException {

    return Optional.ofNullable(this.bindingRepository.findOne(request.getBindingId()))
            .map(psbi -> {
                this.bindingRepository.delete(psbi);
                return psbi;
            })
            .orElse(null);

}
 
开发者ID:joshlong,项目名称:cloudfoundry-ftp-service-broker,代码行数:13,代码来源:FtpServiceInstanceBindingService.java


示例6: itPlaysItCoolIfItDoesNotHaveAnInstance

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
@Test
public void itPlaysItCoolIfItDoesNotHaveAnInstance()
		throws ServiceBrokerException {

	bindingService
			.deleteServiceInstanceBinding(new DeleteServiceInstanceBindingRequest(
					"foo", serviceInstance, "postgrescdm", COPY));
}
 
开发者ID:krujos,项目名称:data-lifecycle-service-broker,代码行数:9,代码来源:LCServiceInstanceBindingServiceCopyTest.java


示例7: itShouldNotInteractWithProviderForTheProductionCopyDuringUnbind

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
@Test
public void itShouldNotInteractWithProviderForTheProductionCopyDuringUnbind()
		throws ServiceBrokerException {
	String serviceId = "postgrescmd";
	bindingService
			.deleteServiceInstanceBinding(new DeleteServiceInstanceBindingRequest(
					bindingId, serviceInstance, serviceId, PRODUCTION));
	verify(provider, never()).deleteCopy(any());
}
 
开发者ID:krujos,项目名称:data-lifecycle-service-broker,代码行数:10,代码来源:LCServiceInstanceBindingServiceProdTest.java


示例8: testDeleteServiceInstance_existingInstance_deletesAndReturnsInstance

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
@Test
public void testDeleteServiceInstance_existingInstance_deletesAndReturnsInstance()
    throws Exception {

    ServiceInstance serviceInstance = getServiceInstance("serviceId");
    Optional<ServiceInstanceBinding> instance = Optional.of(getServiceInstanceBinding("bindingId"));
    Location storingLocation = Location.newInstance("bindingId", "serviceInstanceId");
    when(store.deleteById(storingLocation))
        .thenReturn(Optional.of(getRequest("bindingId")));

    assertThat(service.deleteServiceInstanceBinding(
        new DeleteServiceInstanceBindingRequest("bindingId", serviceInstance, "", "")).getId(),
        equalTo(instance.get().getId()));
    verify(store).deleteById(storingLocation);
}
 
开发者ID:trustedanalytics,项目名称:broker-store,代码行数:16,代码来源:ServiceInstanceBindingServiceStoreTest.java


示例9: testDeleteServiceInstance_nonExistingInstance_returnsNull

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
@Test
public void testDeleteServiceInstance_nonExistingInstance_returnsNull() throws Exception {
    ServiceInstance serviceInstance = getServiceInstance("serviceId");
    Location storingLocation = Location.newInstance("bindingId", "serviceInstanceId");
    when(store.deleteById(storingLocation))
        .thenReturn(Optional.empty());

    assertNull(service.deleteServiceInstanceBinding(
        new DeleteServiceInstanceBindingRequest("bindingId", serviceInstance, "", "")));
}
 
开发者ID:trustedanalytics,项目名称:broker-store,代码行数:11,代码来源:ServiceInstanceBindingServiceStoreTest.java


示例10: testDeleteServiceInstance_storeThrowsIOException_throwsException

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
@Test
public void testDeleteServiceInstance_storeThrowsIOException_throwsException()
    throws Exception {

    ServiceInstance serviceInstance = getServiceInstance("serviceId");
    Location storingLocation = Location.newInstance("bindingId", "serviceInstanceId");
    when(store.deleteById(storingLocation))
        .thenThrow(new IOException());
    thrown.expect(isA(ServiceBrokerException.class));
    thrown.expectCause(isA(IOException.class));

    service.deleteServiceInstanceBinding(
        new DeleteServiceInstanceBindingRequest("bindingId", serviceInstance, "", ""));
}
 
开发者ID:trustedanalytics,项目名称:broker-store,代码行数:15,代码来源:ServiceInstanceBindingServiceStoreTest.java


示例11: deleteServiceInstanceBinding

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
@Override
public ServiceInstanceBinding deleteServiceInstanceBinding(DeleteServiceInstanceBindingRequest deleteServiceInstanceBindingRequest)
        throws ServiceBrokerException {
    String serviceInstanceId = deleteServiceInstanceBindingRequest.getInstance().getServiceInstanceId();
    String bindingId = deleteServiceInstanceBindingRequest.getBindingId();
    try {
        this.role.unBindRoleFromDatabase(serviceInstanceId);
    } catch (SQLException e) {
        logger.error("Error while deleting service instance binding '" + bindingId + "'", e);
        throw new ServiceBrokerException(e.getMessage());
    }
    return new ServiceInstanceBinding(bindingId, serviceInstanceId, null, null, null);
}
 
开发者ID:cloudfoundry-community,项目名称:postgresql-cf-service-broker,代码行数:14,代码来源:PostgreSQLServiceInstanceBindingService.java


示例12: testDeleteServiceBinding_success_shouldReturnRemovedInstance

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
@Test
public void testDeleteServiceBinding_success_shouldReturnRemovedInstance() throws Exception {
  // arrange
  final String INSTANCE_ID = "instanceId3";
  final String BINDING_ID = "bindingId3";
  when(h2oProvisionerRestApi.createH2oInstance(INSTANCE_ID, conf.getH2oMapperNodes(),
      conf.getH2oMapperMemory(), true, yarnConfig))
          .thenReturn(new ResponseEntity<>(CREDENTIALS, HttpStatus.OK));

  CreateServiceInstanceRequest createInstanceReq =
      CfBrokerRequestsFactory.getCreateInstanceRequest(INSTANCE_ID);
  ServiceInstance createdInstance = instanceService.createServiceInstance(createInstanceReq);
  freeze().until(() -> credentialsStore.getById(Location.newInstance(INSTANCE_ID)).isPresent());

  CreateServiceInstanceBindingRequest bindReq =
      CfBrokerRequestsFactory.getCreateServiceBindingRequest(INSTANCE_ID, BINDING_ID);

  bindingService.createServiceInstanceBinding(bindReq);

  // act
  DeleteServiceInstanceBindingRequest request =
      new DeleteServiceInstanceBindingRequest(bindReq.getBindingId(), createdInstance,
          createInstanceReq.getServiceDefinitionId(), bindReq.getPlanId());
  ServiceInstanceBinding removedBinding = bindingService.deleteServiceInstanceBinding(request);

  // assert
  assertThat(removedBinding.getId(), equalTo(BINDING_ID));
}
 
开发者ID:trustedanalytics,项目名称:h2o-broker,代码行数:29,代码来源:H2oBrokerIntegrationTest.java


示例13: rewriteMissingAttrs

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
private CreateServiceInstanceBindingRequest rewriteMissingAttrs(CreateServiceInstanceBindingRequest createRequest,
                                                                DeleteServiceInstanceBindingRequest deleteRequest) {
    return createRequest.withBindingId(deleteRequest.getBindingId()).
            withServiceInstanceId(deleteRequest.getInstance().getServiceInstanceId());
}
 
开发者ID:trustedanalytics,项目名称:broker-store,代码行数:6,代码来源:ServiceInstanceBindingServiceStore.java


示例14: deleteServiceInstanceBinding

import org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest; //导入依赖的package包/类
@Override
public ServiceInstanceBinding deleteServiceInstanceBinding(DeleteServiceInstanceBindingRequest deleteRequest)
        throws ServiceBrokerException {
    return delegate.deleteServiceInstanceBinding(deleteRequest);
}
 
开发者ID:trustedanalytics,项目名称:broker-store,代码行数:6,代码来源:ForwardingServiceInstanceBindingServiceStore.java



注:本文中的org.cloudfoundry.community.servicebroker.model.DeleteServiceInstanceBindingRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FeatureCodec类代码示例发布时间:2022-05-23
下一篇:
Java Main类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap