Search in sources :

Example 1 with PmProxies

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

the class HostMapperTest method postPopulate.

@Override
protected Host postPopulate(Host from) {
    while (from.getPort() == 0) {
        from.setPort(MappingTestHelper.rand(65535));
    }
    from.getSpm().setPriority(3);
    from.getPowerManagement().setPmProxies(new PmProxies());
    return from;
}
Also used : PmProxies(org.ovirt.engine.api.model.PmProxies)

Example 2 with PmProxies

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

the class V3PowerManagementInAdapter method adapt.

@Override
public PowerManagement adapt(V3PowerManagement from) {
    PowerManagement to = new PowerManagement();
    if (from.isSetAddress()) {
        to.setAddress(from.getAddress());
    }
    if (from.isSetAgents()) {
        to.setAgents(new Agents());
        to.getAgents().getAgents().addAll(adaptIn(from.getAgents().getAgents()));
    }
    if (from.isSetAutomaticPmEnabled()) {
        to.setAutomaticPmEnabled(from.isAutomaticPmEnabled());
    }
    if (from.isSetEnabled()) {
        to.setEnabled(from.isEnabled());
    }
    if (from.isSetKdumpDetection()) {
        to.setKdumpDetection(from.isKdumpDetection());
    }
    if (from.isSetOptions()) {
        to.setOptions(new Options());
        to.getOptions().getOptions().addAll(adaptIn(from.getOptions().getOptions()));
    }
    if (from.isSetPassword()) {
        to.setPassword(from.getPassword());
    }
    if (from.isSetPmProxies()) {
        to.setPmProxies(new PmProxies());
        to.getPmProxies().getPmProxies().addAll(adaptIn(from.getPmProxies().getPmProxy()));
    }
    if (from.isSetStatus() && from.getStatus().isSetState()) {
        to.setStatus(PowerManagementStatus.fromValue(from.getStatus().getState()));
    }
    if (from.isSetType()) {
        to.setType(from.getType());
    }
    if (from.isSetUsername()) {
        to.setUsername(from.getUsername());
    }
    return to;
}
Also used : PowerManagement(org.ovirt.engine.api.model.PowerManagement) V3PowerManagement(org.ovirt.engine.api.v3.types.V3PowerManagement) Options(org.ovirt.engine.api.model.Options) Agents(org.ovirt.engine.api.model.Agents) PmProxies(org.ovirt.engine.api.model.PmProxies)

Example 3 with PmProxies

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

the class HostMapper method map.

@Mapping(from = VDS.class, to = PowerManagement.class)
public static PowerManagement map(VDS entity, PowerManagement template) {
    PowerManagement model = template != null ? template : new PowerManagement();
    if (entity.getFenceProxySources() != null) {
        PmProxies pmProxies = new PmProxies();
        for (FenceProxySourceType fenceProxySource : entity.getFenceProxySources()) {
            PmProxy pmProxy = new PmProxy();
            pmProxy.setType(map(fenceProxySource, null));
            pmProxies.getPmProxies().add(pmProxy);
        }
        model.setPmProxies(pmProxies);
    }
    model.setKdumpDetection(entity.isPmKdumpDetection());
    model.setEnabled(entity.isPmEnabled());
    model.setAutomaticPmEnabled(!entity.isDisablePowerManagementPolicy());
    return model;
}
Also used : PowerManagement(org.ovirt.engine.api.model.PowerManagement) FenceProxySourceType(org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType) PmProxies(org.ovirt.engine.api.model.PmProxies) PmProxy(org.ovirt.engine.api.model.PmProxy)

Aggregations

PmProxies (org.ovirt.engine.api.model.PmProxies)3 PowerManagement (org.ovirt.engine.api.model.PowerManagement)2 Agents (org.ovirt.engine.api.model.Agents)1 Options (org.ovirt.engine.api.model.Options)1 PmProxy (org.ovirt.engine.api.model.PmProxy)1 V3PowerManagement (org.ovirt.engine.api.v3.types.V3PowerManagement)1 FenceProxySourceType (org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType)1