本文整理汇总了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.");
}
示例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()));
}
示例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);
}
示例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");
}
示例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;
}