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


Java CloudServiceOffering.getCloudServicePlans方法代码示例

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


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

示例1: findPlanForService

import org.cloudfoundry.client.lib.domain.CloudServiceOffering; //导入方法依赖的package包/类
private CloudServicePlan findPlanForService(CloudService service) {
    List<CloudServiceOffering> offerings = getServiceOfferings(service.getLabel());
    for (CloudServiceOffering offering : offerings) {
        if (service.getVersion() == null || service.getVersion().equals(offering.getVersion())) {
            for (CloudServicePlan plan : offering.getCloudServicePlans()) {
                if (service.getPlan() != null && service.getPlan().equals(plan.getName())) {
                    return plan;
                }
            }
        }
    }
    throw new CloudFoundryException(HttpStatus.NOT_FOUND, "Not Found", "Service plan " + service.getPlan() + " not found.");
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:14,代码来源:CloudControllerClientImpl.java

示例2: findPlanForService

import org.cloudfoundry.client.lib.domain.CloudServiceOffering; //导入方法依赖的package包/类
protected CloudServicePlan findPlanForService(CloudService service, String newServicePlan, RestTemplate restTemplate,
    String cloudControllerUrl) {
    List<CloudServiceOffering> offerings = getServiceOfferings(service.getLabel(), restTemplate, cloudControllerUrl);
    offerings = filterByVersion(offerings, service);
    for (CloudServiceOffering offering : offerings) {
        for (CloudServicePlan plan : offering.getCloudServicePlans()) {
            if (plan.getName().equals(newServicePlan)) {
                return plan;
            }
        }
    }
    throw new SLException(MessageFormat.format(Messages.NO_SERVICE_PLAN_FOUND, service.getName(), newServicePlan, service.getLabel()));
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:14,代码来源:CloudServiceOperator.java

示例3: isServiceExist

import org.cloudfoundry.client.lib.domain.CloudServiceOffering; //导入方法依赖的package包/类
public boolean isServiceExist(String serviceName, String plan) {
    List<CloudServiceOffering> offeringList = cfClientToPopulate.getServiceOfferings();
    for (CloudServiceOffering offering : offeringList) {
        if (!offering.getName().equals(serviceName)) {
            continue;
        }
        for (CloudServicePlan servicePlan : offering.getCloudServicePlans()) {
            if (servicePlan.getName().equals(plan)) {

                return true;
            }
        }
    }
    return false;
}
 
开发者ID:orange-cloudfoundry,项目名称:db-dumper-service,代码行数:16,代码来源:AbstractIntegrationWithRealCfClientTest.java

示例4: addServiceOfferingPlans

import org.cloudfoundry.client.lib.domain.CloudServiceOffering; //导入方法依赖的package包/类
private static void addServiceOfferingPlans(CloudServiceOffering offering, CFServiceOffering cfOffering) {
	List<CloudServicePlan> offeringPlans = offering.getCloudServicePlans();
	List<CFServicePlan> cfOfferingPlans = new ArrayList<CFServicePlan>();
	if (offeringPlans != null) {
		for (CloudServicePlan plan : offeringPlans) {
			CFServicePlan cfPlan = new CFServicePlan(plan.getName(), plan.getDescription(), plan.isFree(),
					plan.isPublic(), plan.getExtra(), plan.getUniqueId());
			cfPlan.setServiceOffering(cfOffering);
			cfOfferingPlans.add(cfPlan);
		}
	}
	cfOffering.setServicePlans(cfOfferingPlans);
}
 
开发者ID:eclipse,项目名称:cft,代码行数:14,代码来源:CloudServicesUtil.java

示例5: findPlanForService

import org.cloudfoundry.client.lib.domain.CloudServiceOffering; //导入方法依赖的package包/类
private CloudServicePlan findPlanForService(CloudService service) throws CloudFoundryException {
	List<CloudServiceOffering> offerings = getServiceOfferings(service.getLabel());
	for (CloudServiceOffering offering : offerings) {
		if (service.getVersion() == null || service.getVersion().equals(offering.getVersion())) {
			for (CloudServicePlan plan : offering.getCloudServicePlans()) {
				if (service.getPlan() != null && service.getPlan().equals(plan.getName())) {
					return plan;
				}
			}
		}
	}
	throw new IllegalArgumentException("Service plan " + service.getPlan() + " not found");
}
 
开发者ID:stephen-kruger,项目名称:cloudfoundry-liteclient-lib,代码行数:14,代码来源:CloudFoundryClient.java

示例6: findFreePlan

import org.cloudfoundry.client.lib.domain.CloudServiceOffering; //导入方法依赖的package包/类
private String findFreePlan(CloudServiceOffering serviceOffering){
    String freePlan=null;

    for(CloudServicePlan plan: serviceOffering.getCloudServicePlans()) {
        if(plan.isFree()){
            return plan.getName();
        }
    }
    return freePlan;
}
 
开发者ID:SeaCloudsEU,项目名称:SeaCloudsPlatform,代码行数:11,代码来源:ServiceCredentialLiveTest.java


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