Search in sources :

Example 1 with GlusterBrickMemoryInfo

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

the class V3GlusterBrickMemoryInfoInAdapter method adapt.

@Override
public GlusterBrickMemoryInfo adapt(V3GlusterBrickMemoryInfo from) {
    GlusterBrickMemoryInfo to = new GlusterBrickMemoryInfo();
    if (from.isSetMemoryPools()) {
        to.setMemoryPools(new GlusterMemoryPools());
        to.getMemoryPools().getGlusterMemoryPools().addAll(adaptIn(from.getMemoryPools().getGlusterMemoryPools()));
    }
    return to;
}
Also used : GlusterMemoryPools(org.ovirt.engine.api.model.GlusterMemoryPools) GlusterBrickMemoryInfo(org.ovirt.engine.api.model.GlusterBrickMemoryInfo) V3GlusterBrickMemoryInfo(org.ovirt.engine.api.v3.types.V3GlusterBrickMemoryInfo)

Example 2 with GlusterBrickMemoryInfo

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

the class GlusterBrickDetailMapper method map.

@Mapping(from = MemoryStatus.class, to = GlusterBrickMemoryInfo.class)
public static GlusterBrickMemoryInfo map(MemoryStatus memoryStatusEntity) {
    GlusterBrickMemoryInfo memInfo = new GlusterBrickMemoryInfo();
    if (memoryStatusEntity == null) {
        return null;
    }
    memInfo.setMemoryPools(new GlusterMemoryPools());
    for (Mempool pool : memoryStatusEntity.getMemPools()) {
        memInfo.getMemoryPools().getGlusterMemoryPools().add(map(pool));
    }
    return memInfo;
}
Also used : GlusterMemoryPools(org.ovirt.engine.api.model.GlusterMemoryPools) GlusterBrickMemoryInfo(org.ovirt.engine.api.model.GlusterBrickMemoryInfo) Mempool(org.ovirt.engine.core.common.businessentities.gluster.Mempool)

Aggregations

GlusterBrickMemoryInfo (org.ovirt.engine.api.model.GlusterBrickMemoryInfo)2 GlusterMemoryPools (org.ovirt.engine.api.model.GlusterMemoryPools)2 V3GlusterBrickMemoryInfo (org.ovirt.engine.api.v3.types.V3GlusterBrickMemoryInfo)1 Mempool (org.ovirt.engine.core.common.businessentities.gluster.Mempool)1