@Override protected List<Template> getCollection() { return collection.list().getTemplates(); }
@Override protected List<Template> getCollection() { return collection.list().getTemplates(); }
@Override public Templates list() { Templates templates = new Templates(); boolean unregistered = ParametersHelper.getBooleanParameter(httpHeaders, uriInfo, UNREGISTERED_CONSTRAINT_PARAMETER, true, false); if (unregistered) { List<org.ovirt.engine.core.common.businessentities.VmTemplate> unregisteredTemplates = getBackendCollection(QueryType.GetUnregisteredVmTemplates, new IdQueryParameters(storageDomainId)); List<Template> collection = new ArrayList<>(); for (org.ovirt.engine.core.common.businessentities.VmTemplate entity : unregisteredTemplates) { Template vmTemplate = map(entity); collection.add(addLinks(populate(vmTemplate, entity))); } templates.getTemplates().addAll(collection); } else { templates.getTemplates().addAll(getCollection()); } return templates; }
for (VmTemplate entity : entities) { Template template = map(entity); collection.getTemplates().add(addLinks(populate(template, entity))); DisplayHelper.adjustDisplayData(this, template);
@Override public Templates adapt(V3Templates from) { Templates to = new Templates(); if (from.isSetActions()) { to.setActions(adaptIn(from.getActions())); } if (from.isSetActive()) { to.setActive(from.getActive()); } if (from.isSetSize()) { to.setSize(from.getSize()); } if (from.isSetTotal()) { to.setTotal(from.getTotal()); } to.getTemplates().addAll(adaptIn(from.getTemplates())); return to; } }
@Override public V3Templates adapt(Templates from) { V3Templates to = new V3Templates(); if (from.isSetActions()) { to.setActions(adaptOut(from.getActions())); } if (from.isSetActive()) { to.setActive(from.getActive()); } if (from.isSetSize()) { to.setSize(from.getSize()); } if (from.isSetTotal()) { to.setTotal(from.getTotal()); } to.getTemplates().addAll(adaptOut(from.getTemplates())); return to; } }