Search in sources :

Example 21 with V3Status

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

the class V3GlusterServerHookOutAdapter method adapt.

@Override
public V3GlusterServerHook adapt(GlusterServerHook from) {
    V3GlusterServerHook to = new V3GlusterServerHook();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptOut(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptOut(from.getActions()));
    }
    if (from.isSetChecksum()) {
        to.setChecksum(from.getChecksum());
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetContentType()) {
        to.setContentType(from.getContentType().value());
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetHost()) {
        to.setHost(adaptOut(from.getHost()));
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetStatus()) {
        V3Status status = new V3Status();
        status.setState(from.getStatus().value());
        to.setStatus(status);
    }
    return to;
}
Also used : V3GlusterServerHook(org.ovirt.engine.api.v3.types.V3GlusterServerHook) V3Status(org.ovirt.engine.api.v3.types.V3Status)

Example 22 with V3Status

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

the class V3GlusterVolumeOutAdapter method adapt.

@Override
public V3GlusterVolume adapt(GlusterVolume from) {
    V3GlusterVolume to = new V3GlusterVolume();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptOut(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptOut(from.getActions()));
    }
    if (from.isSetBricks()) {
        to.setBricks(new V3GlusterBricks());
        to.getBricks().getGlusterBricks().addAll(adaptOut(from.getBricks().getGlusterBricks()));
    }
    if (from.isSetCluster()) {
        to.setCluster(adaptOut(from.getCluster()));
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetDisperseCount()) {
        to.setDisperseCount(from.getDisperseCount());
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetOptions()) {
        to.setOptions(new V3Options());
        to.getOptions().getOptions().addAll(adaptOut(from.getOptions().getOptions()));
    }
    if (from.isSetRedundancyCount()) {
        to.setRedundancyCount(from.getRedundancyCount());
    }
    if (from.isSetReplicaCount()) {
        to.setReplicaCount(from.getReplicaCount());
    }
    if (from.isSetStatus()) {
        V3Status status = new V3Status();
        status.setState(from.getStatus().value());
        to.setStatus(status);
    }
    if (from.isSetStripeCount()) {
        to.setStripeCount(from.getStripeCount());
    }
    if (from.isSetTransportTypes()) {
        to.setTransportTypes(new V3TransportTypes());
        to.getTransportTypes().getTransportTypes().addAll(adaptTransportTypes(from));
    }
    if (from.isSetVolumeType()) {
        to.setVolumeType(from.getVolumeType().value());
    }
    return to;
}
Also used : V3TransportTypes(org.ovirt.engine.api.v3.types.V3TransportTypes) V3GlusterBricks(org.ovirt.engine.api.v3.types.V3GlusterBricks) V3Options(org.ovirt.engine.api.v3.types.V3Options) V3Status(org.ovirt.engine.api.v3.types.V3Status) V3GlusterVolume(org.ovirt.engine.api.v3.types.V3GlusterVolume)

Example 23 with V3Status

use of org.ovirt.engine.api.v3.types.V3Status 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

V3Status (org.ovirt.engine.api.v3.types.V3Status)23 V3Statistics (org.ovirt.engine.api.v3.types.V3Statistics)6 DiskAttachment (org.ovirt.engine.api.model.DiskAttachment)4 TimeZone (org.ovirt.engine.api.model.TimeZone)4 V3CustomProperties (org.ovirt.engine.api.v3.types.V3CustomProperties)4 V3Disk (org.ovirt.engine.api.v3.types.V3Disk)4 HashSet (java.util.HashSet)3 List (java.util.List)3 Set (java.util.Set)3 Collectors.toList (java.util.stream.Collectors.toList)3 Link (org.ovirt.engine.api.model.Link)3 V3Adapter (org.ovirt.engine.api.v3.V3Adapter)3 V3OutAdapters.adaptOut (org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut)3 V3KatelloErrata (org.ovirt.engine.api.v3.types.V3KatelloErrata)3 Disk (org.ovirt.engine.api.model.Disk)2 Host (org.ovirt.engine.api.model.Host)2 HostType (org.ovirt.engine.api.model.HostType)2 Spm (org.ovirt.engine.api.model.Spm)2 Vm (org.ovirt.engine.api.model.Vm)2 V3CdRoms (org.ovirt.engine.api.v3.types.V3CdRoms)2