}
return cloudService;
}
private CloudServiceOffering mapServiceResource(Map<String, Object> resource) {
CloudServiceOffering cloudServiceOffering = new CloudServiceOffering(
getMeta(resource),
getEntityAttribute(resource, "label", String.class),
getEntityAttribute(resource, "provider", String.class),
getEntityAttribute(resource, "version", String.class),
getEntityAttribute(resource, "description", String.class),
getEntityAttribute(resource, "active", Boolean.class),
getEntityAttribute(resource, "bindable", Boolean.class),
getEntityAttribute(resource, "url", String.class),
getEntityAttribute(resource, "info_url", String.class),
getEntityAttribute(resource, "unique_id", String.class),
getEntityAttribute(resource, "extra", String.class),
getEntityAttribute(resource, "documentation_url", String.class));
List<Map<String, Object>> servicePlanList = getEmbeddedResourceList(getEntity(resource), "service_plans");
if (servicePlanList != null) {
for (Map<String, Object> servicePlanResource : servicePlanList) {
Boolean publicPlan = getEntityAttribute(servicePlanResource, "public", Boolean.class);
CloudServicePlan servicePlan =
new CloudServicePlan(
getMeta(servicePlanResource),
getEntityAttribute(servicePlanResource, "name", String.class),
getEntityAttribute(servicePlanResource, "description", String.class),
getEntityAttribute(servicePlanResource, "free", Boolean.class),
publicPlan == null ? true : publicPlan,
getEntityAttribute(servicePlanResource, "extra", String.class),
getEntityAttribute(servicePlanResource, "unique_id", String.class),
cloudServiceOffering);
cloudServiceOffering.addCloudServicePlan(servicePlan);
}
}
return cloudServiceOffering;
}