Search in sources :

Example 1 with Balance

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;
}
Also used : Balances(org.ovirt.engine.api.model.Balances) ClusterPolicy(org.ovirt.engine.core.common.scheduling.ClusterPolicy) Balance(org.ovirt.engine.api.model.Balance)

Example 2 with Balance

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;
}
Also used : Balance(org.ovirt.engine.api.model.Balance)

Example 3 with 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;
}
Also used : SchedulingPolicyUnit(org.ovirt.engine.api.model.SchedulingPolicyUnit) Balance(org.ovirt.engine.api.model.Balance)

Aggregations

Balance (org.ovirt.engine.api.model.Balance)3 Balances (org.ovirt.engine.api.model.Balances)1 SchedulingPolicyUnit (org.ovirt.engine.api.model.SchedulingPolicyUnit)1 ClusterPolicy (org.ovirt.engine.core.common.scheduling.ClusterPolicy)1