use of org.ovirt.engine.api.model.Balance 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.Balance in project ovirt-engine by oVirt.
the class SchedulingBalanceMapperTest method getModel.
@Override
protected Balance getModel(Balance Balance) {
Balance = new Balance();
Balance.setId(ID);
return Balance;
}
use of org.ovirt.engine.api.model.Balance in project ovirt-engine by oVirt.
the class SchedulingPolicyMapper method map.
@Mapping(from = ClusterPolicy.class, to = Balance.class)
public static Balance map(ClusterPolicy entity, Balance template) {
if (template == null) {
assert false : "scheduling balance cannot be null";
return null;
}
Balance model = template;
SchedulingPolicyUnit schedulingPolicyUnit = new SchedulingPolicyUnit();
schedulingPolicyUnit.setId(model.getId());
model.setSchedulingPolicyUnit(schedulingPolicyUnit);
return model;
}
Aggregations