Search in sources :

Example 1 with Filters

use of org.ovirt.engine.api.model.Filters in project ovirt-engine by oVirt.

the class BackendFiltersResource method list.

@Override
public Filters list() {
    ClusterPolicy clusterPolicy = getClusterPolicy();
    Filters filters = new Filters();
    if (clusterPolicy.getFilters() != null) {
        for (Guid filterGuid : clusterPolicy.getFilters()) {
            Filter filter = new Filter();
            filter.setId(filterGuid.toString());
            filters.getFilters().add(addLinks(map(clusterPolicy, filter)));
        }
    }
    return filters;
}
Also used : Filters(org.ovirt.engine.api.model.Filters) Filter(org.ovirt.engine.api.model.Filter) Guid(org.ovirt.engine.core.compat.Guid) ClusterPolicy(org.ovirt.engine.core.common.scheduling.ClusterPolicy)

Example 2 with Filters

use of org.ovirt.engine.api.model.Filters in project ovirt-engine by oVirt.

the class V3FiltersInAdapter method adapt.

@Override
public Filters adapt(V3Filters from) {
    Filters to = new Filters();
    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.getFilters().addAll(adaptIn(from.getFilters()));
    return to;
}
Also used : Filters(org.ovirt.engine.api.model.Filters) V3Filters(org.ovirt.engine.api.v3.types.V3Filters)

Aggregations

Filters (org.ovirt.engine.api.model.Filters)2 Filter (org.ovirt.engine.api.model.Filter)1 V3Filters (org.ovirt.engine.api.v3.types.V3Filters)1 ClusterPolicy (org.ovirt.engine.core.common.scheduling.ClusterPolicy)1 Guid (org.ovirt.engine.core.compat.Guid)1