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


Java CreateServiceInstanceBindingRequest.getServiceInstanceId方法代码示例

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


在下文中一共展示了CreateServiceInstanceBindingRequest.getServiceInstanceId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createServiceInstanceBinding

import org.cloudfoundry.community.servicebroker.model.CreateServiceInstanceBindingRequest; //导入方法依赖的package包/类
@Override
public ServiceInstanceBinding createServiceInstanceBinding(
        CreateServiceInstanceBindingRequest request)
        throws ServiceInstanceBindingExistsException,
        ServiceBrokerException {

    String bindingId = request.getBindingId(); // user
    String instanceId = request.getServiceInstanceId(); // workspace

    log.info(String.format("attempting to provision an FTP for workspace " +
            "(serviceInstanceId) %s and user (bindingId) %s", instanceId, bindingId));

    FtpServerProvisionerRequest r = new FtpServerProvisionerRequest(bindingId, instanceId);

    String response = this.client.provisionFtpServer(r);

    log.info(String.format("received FTP service provision response %s", response));

    PersistableServiceInstanceBinding psb = new PersistableServiceInstanceBinding(
            request.getBindingId(),
            request.getServiceInstanceId(),
            response,
            null, request.getAppGuid());

    return this.bindingRepository.save(psb);
}
 
开发者ID:joshlong,项目名称:cloudfoundry-ftp-service-broker,代码行数:27,代码来源:FtpServiceInstanceBindingService.java

示例2: createServiceInstanceBinding

import org.cloudfoundry.community.servicebroker.model.CreateServiceInstanceBindingRequest; //导入方法依赖的package包/类
@Override
public ServiceInstanceBinding createServiceInstanceBinding(CreateServiceInstanceBindingRequest createServiceInstanceBindingRequest)
        throws ServiceInstanceBindingExistsException, ServiceBrokerException {
    String bindingId = createServiceInstanceBindingRequest.getBindingId();
    String serviceInstanceId = createServiceInstanceBindingRequest.getServiceInstanceId();
    String appGuid = createServiceInstanceBindingRequest.getAppGuid();
    String passwd = "";

    try {
        passwd = this.role.bindRoleToDatabase(serviceInstanceId);
    } catch (SQLException e) {
        logger.error("Error while creating service instance binding '" + bindingId + "'", e);
        throw new ServiceBrokerException(e.getMessage());
    }

    String dbURL = String.format("postgres://%s:%[email protected]%s:%d/%s", serviceInstanceId, passwd, PostgreSQLDatabase.getDatabaseHost(), PostgreSQLDatabase.getDatabasePort(), serviceInstanceId);

    Map<String, Object> credentials = new HashMap<String, Object>();
    credentials.put("uri", dbURL);

    return new ServiceInstanceBinding(bindingId, serviceInstanceId, credentials, null, appGuid);
}
 
开发者ID:cloudfoundry-community,项目名称:postgresql-cf-service-broker,代码行数:23,代码来源:PostgreSQLServiceInstanceBindingService.java

示例3: createServiceInstanceBinding

import org.cloudfoundry.community.servicebroker.model.CreateServiceInstanceBindingRequest; //导入方法依赖的package包/类
@Override
public ServiceInstanceBinding createServiceInstanceBinding(
		CreateServiceInstanceBindingRequest request)
		throws ServiceInstanceBindingExistsException,
		ServiceBrokerException {

	String bindingId = request.getBindingId();
	String appGuid = request.getAppGuid();
	log(bindingId, "Creating service binding for app " + appGuid,
			IN_PROGRESS);

	throwIfDuplicateBinding(bindingId);
	throwIfCopyAlreadyBoundToApp(appGuid, request.getServiceInstanceId());

	try {
		String instance = instanceService
				.getInstanceIdForServiceInstance(request
						.getServiceInstanceId());

		ServiceInstanceBinding binding = new ServiceInstanceBinding(
				bindingId, request.getServiceInstanceId(),
				provider.getCreds(instance), null, appGuid);

		bindings.saveBinding(binding);
		log(bindingId, "Created service binding for app " + appGuid,
				COMPLETE);
		return binding;
	} catch (Exception e) {
		log(bindingId, "Failed to bind app " + appGuid, FAILED);
		throw e;
	}
}
 
开发者ID:krujos,项目名称:data-lifecycle-service-broker,代码行数:33,代码来源:LCServiceInstanceBindingService.java

示例4: getServiceInstanceBinding

import org.cloudfoundry.community.servicebroker.model.CreateServiceInstanceBindingRequest; //导入方法依赖的package包/类
private ServiceInstanceBinding getServiceInstanceBinding(CreateServiceInstanceBindingRequest request) {
    return new ServiceInstanceBinding(request.getBindingId(), request.getServiceInstanceId(),
            Collections.emptyMap(), null, request.getAppGuid());

}
 
开发者ID:trustedanalytics,项目名称:broker-store,代码行数:6,代码来源:ServiceInstanceBindingServiceStore.java


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