Search in sources :

Example 1 with V3GlusterBrick

use of org.ovirt.engine.api.v3.types.V3GlusterBrick in project ovirt-engine by oVirt.

the class V3GlusterBrickInAdapter method adapt.

@Override
public GlusterBrick adapt(V3GlusterBrick from) {
    GlusterBrick to = new GlusterBrick();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetBrickDir()) {
        to.setBrickDir(from.getBrickDir());
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetDevice()) {
        to.setDevice(from.getDevice());
    }
    if (from.isSetFsName()) {
        to.setFsName(from.getFsName());
    }
    if (from.isSetGlusterClients()) {
        to.setGlusterClients(new GlusterClients());
        to.getGlusterClients().getGlusterClients().addAll(adaptIn(from.getGlusterClients().getGlusterClients()));
    }
    if (from.isSetGlusterVolume()) {
        to.setGlusterVolume(adaptIn(from.getGlusterVolume()));
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetMemoryPools()) {
        to.setMemoryPools(new GlusterMemoryPools());
        to.getMemoryPools().getGlusterMemoryPools().addAll(adaptIn(from.getMemoryPools().getGlusterMemoryPools()));
    }
    if (from.isSetMntOptions()) {
        to.setMntOptions(from.getMntOptions());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetPid()) {
        to.setPid(from.getPid());
    }
    if (from.isSetPort()) {
        to.setPort(from.getPort());
    }
    if (from.isSetServerId()) {
        to.setServerId(from.getServerId());
    }
    if (from.isSetStatus() && from.getStatus().isSetState()) {
        to.setStatus(GlusterBrickStatus.fromValue(from.getStatus().getState()));
    }
    return to;
}
Also used : GlusterMemoryPools(org.ovirt.engine.api.model.GlusterMemoryPools) GlusterClients(org.ovirt.engine.api.model.GlusterClients) V3GlusterBrick(org.ovirt.engine.api.v3.types.V3GlusterBrick) GlusterBrick(org.ovirt.engine.api.model.GlusterBrick)

Example 2 with V3GlusterBrick

use of org.ovirt.engine.api.v3.types.V3GlusterBrick in project ovirt-engine by oVirt.

the class V3GlusterBrickOutAdapter method adapt.

@Override
public V3GlusterBrick adapt(GlusterBrick from) {
    V3GlusterBrick to = new V3GlusterBrick();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptOut(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptOut(from.getActions()));
    }
    if (from.isSetBrickDir()) {
        to.setBrickDir(from.getBrickDir());
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetDevice()) {
        to.setDevice(from.getDevice());
    }
    if (from.isSetFsName()) {
        to.setFsName(from.getFsName());
    }
    if (from.isSetGlusterClients()) {
        to.setGlusterClients(new V3GlusterClients());
        to.getGlusterClients().getGlusterClients().addAll(adaptOut(from.getGlusterClients().getGlusterClients()));
    }
    if (from.isSetGlusterVolume()) {
        to.setGlusterVolume(adaptOut(from.getGlusterVolume()));
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetMemoryPools()) {
        to.setMemoryPools(new V3GlusterMemoryPools());
        to.getMemoryPools().getGlusterMemoryPools().addAll(adaptOut(from.getMemoryPools().getGlusterMemoryPools()));
    }
    if (from.isSetMntOptions()) {
        to.setMntOptions(from.getMntOptions());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetPid()) {
        to.setPid(from.getPid());
    }
    if (from.isSetPort()) {
        to.setPort(from.getPort());
    }
    if (from.isSetServerId()) {
        to.setServerId(from.getServerId());
    }
    if (from.isSetStatus()) {
        V3Status status = new V3Status();
        status.setState(from.getStatus().value());
        to.setStatus(status);
    }
    return to;
}
Also used : V3GlusterBrick(org.ovirt.engine.api.v3.types.V3GlusterBrick) V3GlusterClients(org.ovirt.engine.api.v3.types.V3GlusterClients) V3Status(org.ovirt.engine.api.v3.types.V3Status) V3GlusterMemoryPools(org.ovirt.engine.api.v3.types.V3GlusterMemoryPools)

Aggregations

V3GlusterBrick (org.ovirt.engine.api.v3.types.V3GlusterBrick)2 GlusterBrick (org.ovirt.engine.api.model.GlusterBrick)1 GlusterClients (org.ovirt.engine.api.model.GlusterClients)1 GlusterMemoryPools (org.ovirt.engine.api.model.GlusterMemoryPools)1 V3GlusterClients (org.ovirt.engine.api.v3.types.V3GlusterClients)1 V3GlusterMemoryPools (org.ovirt.engine.api.v3.types.V3GlusterMemoryPools)1 V3Status (org.ovirt.engine.api.v3.types.V3Status)1