Search in sources :

Example 1 with BrickProfileDetails

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

the class V3GlusterVolumeProfileDetailsInAdapter method adapt.

@Override
public GlusterVolumeProfileDetails adapt(V3GlusterVolumeProfileDetails from) {
    GlusterVolumeProfileDetails to = new GlusterVolumeProfileDetails();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetBrickProfileDetails()) {
        to.setBrickProfileDetails(new BrickProfileDetails());
        to.getBrickProfileDetails().getBrickProfileDetails().addAll(adaptIn(from.getBrickProfileDetails().getBrickProfileDetail()));
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetNfsProfileDetails()) {
        to.setNfsProfileDetails(new NfsProfileDetails());
        to.getNfsProfileDetails().getNfsProfileDetails().addAll(adaptIn(from.getNfsProfileDetails().getNfsProfileDetail()));
    }
    return to;
}
Also used : NfsProfileDetails(org.ovirt.engine.api.model.NfsProfileDetails) GlusterVolumeProfileDetails(org.ovirt.engine.api.model.GlusterVolumeProfileDetails) V3GlusterVolumeProfileDetails(org.ovirt.engine.api.v3.types.V3GlusterVolumeProfileDetails) BrickProfileDetails(org.ovirt.engine.api.model.BrickProfileDetails)

Example 2 with BrickProfileDetails

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

the class GlusterVolumeProfileInfoMapper method map.

@Mapping(from = GlusterVolumeProfileInfo.class, to = GlusterVolumeProfileDetails.class)
public static GlusterVolumeProfileDetails map(GlusterVolumeProfileInfo fromEntity, GlusterVolumeProfileDetails toModel) {
    GlusterVolumeProfileDetails model = new GlusterVolumeProfileDetails();
    BrickProfileDetails brickprofileDetails = new BrickProfileDetails();
    if (fromEntity.getBrickProfileDetails() != null) {
        for (org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails brickDetailEntity : fromEntity.getBrickProfileDetails()) {
            BrickProfileDetail brickprofileDetail = new BrickProfileDetail();
            brickprofileDetail.setBrick(new GlusterBrick());
            brickprofileDetail.getBrick().setBrickDir(brickDetailEntity.getName());
            mapProfileDetails(brickDetailEntity.getProfileStats(), brickprofileDetail);
            brickprofileDetails.getBrickProfileDetails().add(brickprofileDetail);
        }
    }
    model.setBrickProfileDetails(brickprofileDetails);
    NfsProfileDetails nfsprofileDetails = new NfsProfileDetails();
    if (fromEntity.getNfsProfileDetails() != null) {
        for (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats nfsDetailEntity : fromEntity.getNfsProfileDetails()) {
            NfsProfileDetail nfsprofileDetail = new NfsProfileDetail();
            nfsprofileDetail.setNfsServerIp(nfsDetailEntity.getName());
            mapProfileDetails(nfsDetailEntity.getProfileStats(), nfsprofileDetail);
            nfsprofileDetails.getNfsProfileDetails().add(nfsprofileDetail);
        }
    }
    model.setNfsProfileDetails(nfsprofileDetails);
    return model;
}
Also used : NfsProfileDetails(org.ovirt.engine.api.model.NfsProfileDetails) NfsProfileDetail(org.ovirt.engine.api.model.NfsProfileDetail) GlusterVolumeProfileDetails(org.ovirt.engine.api.model.GlusterVolumeProfileDetails) BrickProfileDetails(org.ovirt.engine.api.model.BrickProfileDetails) BrickProfileDetail(org.ovirt.engine.api.model.BrickProfileDetail) GlusterBrick(org.ovirt.engine.api.model.GlusterBrick)

Aggregations

BrickProfileDetails (org.ovirt.engine.api.model.BrickProfileDetails)2 GlusterVolumeProfileDetails (org.ovirt.engine.api.model.GlusterVolumeProfileDetails)2 NfsProfileDetails (org.ovirt.engine.api.model.NfsProfileDetails)2 BrickProfileDetail (org.ovirt.engine.api.model.BrickProfileDetail)1 GlusterBrick (org.ovirt.engine.api.model.GlusterBrick)1 NfsProfileDetail (org.ovirt.engine.api.model.NfsProfileDetail)1 V3GlusterVolumeProfileDetails (org.ovirt.engine.api.v3.types.V3GlusterVolumeProfileDetails)1