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

Java ServiceInstanceDoesNotExistException类代码示例

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

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



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

示例1: removeBinding

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public void removeBinding(ServiceInstanceBinding binding)
        throws EcsManagementClientException, IOException {
    ServiceInstance instance = instanceRepository.find(instanceId);
    if (instance == null)
        throw new ServiceInstanceDoesNotExistException(instanceId);
    String bucketName = instance.getName();
    List<VolumeMount> volumes = binding.getVolumeMounts();
    if (volumes != null && volumes.size() > 0) {
        Map<String, Object> mountConfig = (
                    (SharedVolumeDevice) volumes.get(0).getDevice()
                ).getMountConfig();
        String unixId = (String) mountConfig.get("uid");
        LOG.error("Deleting user map of instance Id and Binding Id " +
                bucketName + " " + bindingId);
        try {
            ecs.deleteUserMap(bindingId, unixId);
        } catch (EcsManagementClientException e) {
            LOG.error("Error deleting user map: " + e.getMessage());
        }
    }

    ecs.removeUserFromBucket(bucketName, bindingId);
    ecs.deleteUser(bindingId);
}
 
开发者ID:codedellemc,项目名称:ecs-cf-service-broker,代码行数:26,代码来源:BucketBindingWorkflow.java


示例2: getCredentials

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public Map<String, Object> getCredentials(String secretKey, Map<String, Object> parameters)
        throws IOException, EcsManagementClientException {
    ServiceInstance instance = instanceRepository.find(instanceId);
    if (instance == null)
        throw new ServiceInstanceDoesNotExistException(instanceId);
    String namespaceName = instance.getName();

    Map<String, Object> credentials = super.getCredentials(secretKey);

    // Get custom endpoint for namespace
    String endpoint = ecs.getNamespaceURL(ecs.prefix(namespaceName), service, plan,
            createRequest.getParameters());
    credentials.put("endpoint", endpoint);

    // Add s3 URL
    credentials.put("s3Url", getS3Url(endpoint, secretKey));

    return credentials;
}
 
开发者ID:codedellemc,项目名称:ecs-cf-service-broker,代码行数:21,代码来源:NamespaceBindingWorkflow.java


示例3: deleteServiceInstance

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public DeleteServiceInstanceResponse deleteServiceInstance(final DeleteServiceInstanceRequest request) throws CloudKarafkaServiceException {
    final String instanceId = request.getServiceInstanceId();
    final ServiceInstance instance = repository.findOne(instanceId);

    if (instance == null) {
        throw new ServiceInstanceDoesNotExistException(instanceId);
    }

    cloudKarafkaAdminService.deleteBrokerInstance(instance.getCloudKarafkaId());
    repository.delete(instanceId);

    return new DeleteServiceInstanceResponse();
}
 
开发者ID:ipolyzos,项目名称:cloudkarafka-broker,代码行数:15,代码来源:CloudKarafkaServiceInstanceService.java


示例4: updateServiceInstance

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public UpdateServiceInstanceResponse updateServiceInstance(final UpdateServiceInstanceRequest request) {
    final String instanceId = request.getServiceInstanceId();
    final ServiceInstance instance = repository.findOne(instanceId);

    if (instance == null) {
        throw new ServiceInstanceDoesNotExistException(instanceId);
    }

    if (request.equals(instance)) {
        throw new ServiceInstanceUpdateNotSupportedException("No changes in the change request");
    }

    // extract required values
    final String reqplan = request.getPlanId().split("_")[0];
    final String brkId = instance.getCloudKarafkaId();

    // change instance to a new plan
    cloudKarafkaAdminService.changeInstance(brkId, instance.getServiceInstanceId(), reqplan);
    instance.setPlanId(request.getPlanId());

    //replace old instance
    repository.delete(instanceId);
    repository.save(instance);

    return new UpdateServiceInstanceResponse();
}
 
开发者ID:ipolyzos,项目名称:cloudkarafka-broker,代码行数:28,代码来源:CloudKarafkaServiceInstanceService.java


示例5: deleteServiceInstance

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public DeleteServiceInstanceResponse deleteServiceInstance(DeleteServiceInstanceRequest request) throws MongoServiceException {
	String instanceId = request.getServiceInstanceId();
	ServiceInstance instance = repository.findOne(instanceId);
	if (instance == null) {
		throw new ServiceInstanceDoesNotExistException(instanceId);
	}

	mongo.deleteDatabase(instanceId);
	repository.delete(instanceId);
	return new DeleteServiceInstanceResponse();
}
 
开发者ID:cf-platform-eng,项目名称:mongodb-broker,代码行数:13,代码来源:MongoServiceInstanceService.java


示例6: updateServiceInstance

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public UpdateServiceInstanceResponse updateServiceInstance(UpdateServiceInstanceRequest request) {
	String instanceId = request.getServiceInstanceId();
	ServiceInstance instance = repository.findOne(instanceId);
	if (instance == null) {
		throw new ServiceInstanceDoesNotExistException(instanceId);
	}

	repository.delete(instanceId);
	ServiceInstance updatedInstance = new ServiceInstance(request);
	repository.save(updatedInstance);
	return new UpdateServiceInstanceResponse();
}
 
开发者ID:cf-platform-eng,项目名称:mongodb-broker,代码行数:14,代码来源:MongoServiceInstanceService.java


示例7: unknownServiceInstanceDeleteCallSuccessful

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Test(expected = ServiceInstanceDoesNotExistException.class)
public void unknownServiceInstanceDeleteCallSuccessful() throws Exception {
	when(repository.findOne(any(String.class))).thenReturn(null);

	DeleteServiceInstanceRequest request = buildDeleteRequest();

	DeleteServiceInstanceResponse response = service.deleteServiceInstance(request);

	assertNotNull(response);
	assertFalse(response.isAsync());

	verify(mongo).deleteDatabase(request.getServiceInstanceId());
	verify(repository).delete(request.getServiceInstanceId());
}
 
开发者ID:cf-platform-eng,项目名称:mongodb-broker,代码行数:15,代码来源:MongoServiceInstanceServiceTest.java


示例8: getLastOperation

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public GetLastServiceOperationResponse getLastOperation(GetLastServiceOperationRequest request) {
    VrServiceInstance si = getServiceInstance(request.getServiceInstanceId());
    if (si == null) {
        throw new ServiceInstanceDoesNotExistException(request.getServiceInstanceId());
    }

    return si.getServiceInstanceLastOperation().toResponse();
}
 
开发者ID:cf-platform-eng,项目名称:vrealize-service-broker,代码行数:10,代码来源:VrServiceInstanceService.java


示例9: updateServiceInstance

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public UpdateServiceInstanceResponse updateServiceInstance(UpdateServiceInstanceRequest request) {
    String serviceInstanceId = request.getServiceInstanceId();
    String serviceDefinitionId = request.getServiceDefinitionId();
    String planId = request.getPlanId();
    try {
        ServiceDefinitionProxy service = ecs
                .lookupServiceDefinition(serviceDefinitionId);
        ServiceInstance instance = repository.find(serviceInstanceId);
        if (instance == null)
            throw new ServiceInstanceDoesNotExistException(
                    serviceInstanceId);
        if (instance.getReferences().size() > 1)
            throw new ServiceInstanceUpdateNotSupportedException(
                    "Cannot change plan of service instance with remote references");

        InstanceWorkflow workflow = getWorkflow(service);
        LOG.info("changing instance plan");
        workflow.changePlan(serviceInstanceId, service, service.findPlan(planId), request.getParameters());

        LOG.info("updating service in repo");
        repository.delete(serviceInstanceId);
        instance.update(request);
        repository.save(instance);
        return new UpdateServiceInstanceResponse();
    } catch (Exception e) {
        throw new ServiceBrokerException(e);
    }
}
 
开发者ID:codedellemc,项目名称:ecs-cf-service-broker,代码行数:30,代码来源:EcsServiceInstanceService.java


示例10: checkIfUserExists

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public void checkIfUserExists() throws EcsManagementClientException, IOException {
    ServiceInstance instance = instanceRepository.find(instanceId);
    if (instance == null)
        throw new ServiceInstanceDoesNotExistException(instanceId);
    if (instance.remoteConnectionKeyExists(bindingId))
        throw new ServiceInstanceBindingExistsException(instanceId, bindingId);
}
 
开发者ID:codedellemc,项目名称:ecs-cf-service-broker,代码行数:9,代码来源:RemoteConnectBindingWorkflow.java


示例11: createBindingUser

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public String createBindingUser() throws ServiceBrokerException, IOException, JAXBException {
    ServiceInstance instance = instanceRepository.find(instanceId);
    if (instance == null)
        throw new ServiceInstanceDoesNotExistException(instanceId);

    String secretKey = instance.addRemoteConnectionKey(bindingId);
    instanceRepository.save(instance);
    return secretKey;
}
 
开发者ID:codedellemc,项目名称:ecs-cf-service-broker,代码行数:11,代码来源:RemoteConnectBindingWorkflow.java


示例12: removeBinding

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public void removeBinding(ServiceInstanceBinding binding)
        throws EcsManagementClientException, IOException, JAXBException {
    ServiceInstance instance = instanceRepository.find(instanceId);
    if (instance == null)
        throw new ServiceInstanceDoesNotExistException(instanceId);
    instance.removeRemoteConnectionKey(bindingId);
    instanceRepository.save(instance);
}
 
开发者ID:codedellemc,项目名称:ecs-cf-service-broker,代码行数:10,代码来源:RemoteConnectBindingWorkflow.java


示例13: createBindingUser

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public String createBindingUser() throws EcsManagementClientException, IOException, JAXBException {
    UserSecretKey userSecretKey = ecs.createUser(bindingId);
    Map<String, Object> parameters = createRequest.getParameters();
    ServiceInstance instance = instanceRepository.find(instanceId);
    if (instance == null)
        throw new ServiceInstanceDoesNotExistException(instanceId);

    String bucketName = instance.getName();
    String export = "";
    List<String> permissions = null;
    if (parameters != null) {
        permissions = (List<String>) parameters.get("permissions");
        export = (String) parameters.getOrDefault("export", "");
    }
    
    if (permissions == null) {
        ecs.addUserToBucket(bucketName, bindingId);
    } else {
        ecs.addUserToBucket(bucketName, bindingId, permissions);
    }

    if (ecs.getBucketFileEnabled(bucketName)) {
        volumeMounts = createVolumeExport(export,
                new URL(ecs.getObjectEndpoint()), parameters);
    }

    return userSecretKey.getSecretKey();
}
 
开发者ID:codedellemc,项目名称:ecs-cf-service-broker,代码行数:30,代码来源:BucketBindingWorkflow.java


示例14: getCredentials

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public Map<String, Object> getCredentials(String secretKey, Map<String, Object> parameters)
        throws IOException, EcsManagementClientException {
    ServiceInstance instance = instanceRepository.find(instanceId);
    if (instance == null)
        throw new ServiceInstanceDoesNotExistException(instanceId);
    String bucketName = instance.getName();

    Map<String, Object> credentials = super.getCredentials(secretKey);

    // Add default broker endpoint
    String endpoint = ecs.getObjectEndpoint();
    credentials.put("endpoint", endpoint);

    // Add s3 URL
    URL baseUrl = new URL(endpoint);
    credentials.put("s3Url", getS3Url(baseUrl, secretKey, parameters));

    if (parameters != null && parameters.containsKey("path-style-access") &&
            ! (Boolean) parameters.get("path-style-access"))
    {
        credentials.put("path-style-access", false);
    } else {
        credentials.put("path-style-access", true);
    }

    // Add bucket name from repository
    credentials.put("bucket", ecs.prefix(bucketName));

    return credentials;
}
 
开发者ID:codedellemc,项目名称:ecs-cf-service-broker,代码行数:32,代码来源:BucketBindingWorkflow.java


示例15: createBindingUser

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Override
public String createBindingUser() throws EcsManagementClientException, IOException, JAXBException {
    ServiceInstance instance = instanceRepository.find(instanceId);
    if (instance == null)
        throw new ServiceInstanceDoesNotExistException(instanceId);
    String namespaceName = instance.getName();
    return ecs.createUser(bindingId, namespaceName).getSecretKey();
}
 
开发者ID:codedellemc,项目名称:ecs-cf-service-broker,代码行数:9,代码来源:NamespaceBindingWorkflow.java


示例16: deleteServiceInstanceWithUnknownIdFails

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Test
public void deleteServiceInstanceWithUnknownIdFails() throws Exception {
	when(serviceInstanceService.deleteServiceInstance(eq(syncDeleteRequest)))
			.thenThrow(new ServiceInstanceDoesNotExistException(syncDeleteRequest.getServiceInstanceId()));

	setupCatalogService(syncDeleteRequest.getServiceDefinitionId());

	mockMvc.perform(delete(buildUrl(syncDeleteRequest, false))
			.accept(MediaType.APPLICATION_JSON))
			.andExpect(status().isGone())
			.andExpect(jsonPath("$", is("{}")));
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-cloudfoundry-service-broker,代码行数:13,代码来源:ServiceInstanceControllerIntegrationTest.java


示例17: updateServiceInstanceWithUnknownIdFails

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Test
public void updateServiceInstanceWithUnknownIdFails() throws Exception {
	when(serviceInstanceService.updateServiceInstance(eq(syncUpdateRequest)))
			.thenThrow(new ServiceInstanceDoesNotExistException(syncUpdateRequest.getServiceInstanceId()));

	setupCatalogService(syncUpdateRequest.getServiceDefinitionId());

	mockMvc.perform(patch(buildUrl(syncUpdateRequest, false))
			.content(DataFixture.toJson(syncUpdateRequest))
			.contentType(MediaType.APPLICATION_JSON)
			.accept(MediaType.APPLICATION_JSON))
			.andExpect(status().isUnprocessableEntity())
			.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
			.andExpect(jsonPath("$.description", containsString(syncUpdateRequest.getServiceInstanceId())));
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-cloudfoundry-service-broker,代码行数:16,代码来源:ServiceInstanceControllerIntegrationTest.java


示例18: lastOperationWithUnknownIdFails

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Test
public void lastOperationWithUnknownIdFails() throws Exception {
	when(serviceInstanceService.getLastOperation(eq(lastOperationRequest)))
			.thenThrow(new ServiceInstanceDoesNotExistException(lastOperationRequest.getServiceInstanceId()));

	mockMvc.perform(get(buildUrl(lastOperationRequest, false)))
			.andExpect(status().isUnprocessableEntity())
			.andExpect(jsonPath("$.description", containsString(lastOperationRequest.getServiceInstanceId())));
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-cloudfoundry-service-broker,代码行数:10,代码来源:ServiceInstanceControllerIntegrationTest.java


示例19: createBindingWithUnknownServiceInstanceIdFails

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Test
public void createBindingWithUnknownServiceInstanceIdFails() throws Exception {
	when(serviceInstanceBindingService.createServiceInstanceBinding(eq(createRequest)))
			.thenThrow(new ServiceInstanceDoesNotExistException(createRequest.getServiceInstanceId()));

	setupCatalogService(createRequest.getServiceDefinitionId());

	mockMvc.perform(put(buildCreateUrl(false))
			.content(DataFixture.toJson(createRequest))
			.accept(MediaType.APPLICATION_JSON)
			.contentType(MediaType.APPLICATION_JSON))
			.andExpect(status().isUnprocessableEntity())
			.andExpect(jsonPath("$.description", containsString(createRequest.getServiceInstanceId())));
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-cloudfoundry-service-broker,代码行数:15,代码来源:ServiceInstanceBindingControllerIntegrationTest.java


示例20: deleteBindingWithUnknownInstanceIdFails

import org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException; //导入依赖的package包/类
@Test
public void deleteBindingWithUnknownInstanceIdFails() throws Exception {
	doThrow(new ServiceInstanceDoesNotExistException(deleteRequest.getServiceInstanceId()))
			.when(serviceInstanceBindingService).deleteServiceInstanceBinding(any(DeleteServiceInstanceBindingRequest.class));

	setupCatalogService(serviceDefinition.getId());

	mockMvc.perform(delete(buildDeleteUrl(false))
			.contentType(MediaType.APPLICATION_JSON))
			.andExpect(status().isUnprocessableEntity())
			.andExpect(jsonPath("$.description", containsString(deleteRequest.getServiceInstanceId())));
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-cloudfoundry-service-broker,代码行数:13,代码来源:ServiceInstanceBindingControllerIntegrationTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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