当前位置: 首页>>代码示例>>Java>>正文


Java ServiceInstanceDoesNotExistException类代码示例

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


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


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