Search in sources :

Example 1 with Agents

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

the class V3AgentsInAdapter method adapt.

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

Example 2 with Agents

use of org.ovirt.engine.api.model.Agents 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 Agents

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

the class BackendFenceAgentsResource method mapCollection.

private Agents mapCollection(List<FenceAgent> fenceAgents) {
    Agents agents = new Agents();
    for (FenceAgent fenceAgent : fenceAgents) {
        Agent agent = map(fenceAgent, null);
        agents.getAgents().add(addLinks(populate(agent, fenceAgent)));
    }
    return agents;
}
Also used : Agent(org.ovirt.engine.api.model.Agent) FenceAgent(org.ovirt.engine.core.common.businessentities.pm.FenceAgent) Agents(org.ovirt.engine.api.model.Agents) FenceAgent(org.ovirt.engine.core.common.businessentities.pm.FenceAgent)

Aggregations

Agents (org.ovirt.engine.api.model.Agents)3 Agent (org.ovirt.engine.api.model.Agent)1 Options (org.ovirt.engine.api.model.Options)1 PmProxies (org.ovirt.engine.api.model.PmProxies)1 PowerManagement (org.ovirt.engine.api.model.PowerManagement)1 V3Agents (org.ovirt.engine.api.v3.types.V3Agents)1 V3PowerManagement (org.ovirt.engine.api.v3.types.V3PowerManagement)1 FenceAgent (org.ovirt.engine.core.common.businessentities.pm.FenceAgent)1