use of org.ovirt.engine.api.model.Balances in project ovirt-engine by oVirt.
the class BackendBalancesResource method list.
@Override
public Balances list() {
ClusterPolicy clusterPolicy = getClusterPolicy();
Balances balances = new Balances();
if (clusterPolicy.getBalance() != null) {
Balance balance = new Balance();
balance.setId(clusterPolicy.getBalance().toString());
balances.getBalances().add(addLinks(map(clusterPolicy, balance)));
}
return balances;
}
use of org.ovirt.engine.api.model.Balances in project ovirt-engine by oVirt.
the class V3BalancesInAdapter method adapt.
@Override
public Balances adapt(V3Balances from) {
Balances to = new Balances();
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.getBalances().addAll(adaptIn(from.getBalances()));
return to;
}
Aggregations