use of io.apiman.manager.api.beans.summary.ApiPlanSummaryBean in project apiman by apiman.
the class JpaStorage method getApiVersionPlans.
/**
* {@inheritDoc}
*/
@Override
public // TODO(msavy): rewrite using projection
List<ApiPlanSummaryBean> getApiVersionPlans(String organizationId, String apiId, String version) throws StorageException {
List<ApiPlanSummaryBean> plans = new ArrayList<>();
ApiVersionBean versionBean = getApiVersion(organizationId, apiId, version);
Set<ApiPlanBean> apiPlans = versionBean.getPlans();
if (apiPlans != null) {
for (ApiPlanBean spb : apiPlans) {
PlanVersionBean planVersion = getPlanVersion(organizationId, spb.getPlanId(), spb.getVersion());
ApiPlanSummaryBean summary = new ApiPlanSummaryBean();
summary.setPlanId(planVersion.getPlan().getId());
summary.setPlanName(planVersion.getPlan().getName());
summary.setPlanDescription(planVersion.getPlan().getDescription());
summary.setVersion(spb.getVersion());
summary.setRequiresApproval(spb.getRequiresApproval());
summary.setDiscoverability(spb.getDiscoverability());
plans.add(summary);
}
}
return plans;
}
use of io.apiman.manager.api.beans.summary.ApiPlanSummaryBean in project apiman by apiman.
the class EsStorage method getApiVersionPlans.
/**
* @see io.apiman.manager.api.core.IStorageQuery#getApiVersionPlans(java.lang.String, java.lang.String, java.lang.String)
*/
@Override
public List<ApiPlanSummaryBean> getApiVersionPlans(String organizationId, String apiId, String version) throws StorageException {
List<ApiPlanSummaryBean> rval = new ArrayList<>();
ApiVersionBean versionBean = getApiVersion(organizationId, apiId, version);
if (versionBean != null) {
Set<ApiPlanBean> plans = versionBean.getPlans();
if (plans != null) {
for (ApiPlanBean spb : plans) {
PlanBean planBean = getPlan(organizationId, spb.getPlanId());
ApiPlanSummaryBean plan = new ApiPlanSummaryBean();
plan.setPlanId(spb.getPlanId());
plan.setVersion(spb.getVersion());
plan.setPlanName(planBean.getName());
plan.setPlanDescription(planBean.getDescription());
rval.add(plan);
}
}
}
return rval;
}
Aggregations