Search in sources :

Example 1 with BrickProfileDetail

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

the class V3BrickProfileDetailInAdapter method adapt.

@Override
public BrickProfileDetail adapt(V3BrickProfileDetail from) {
    BrickProfileDetail to = new BrickProfileDetail();
    if (from.isSetBrick()) {
        to.setBrick(adaptIn(from.getBrick()));
    }
    if (from.isSetProfileDetail()) {
        to.setProfileDetails(new ProfileDetails());
        to.getProfileDetails().getProfileDetails().addAll(adaptIn(from.getProfileDetail()));
    }
    return to;
}
Also used : V3BrickProfileDetail(org.ovirt.engine.api.v3.types.V3BrickProfileDetail) BrickProfileDetail(org.ovirt.engine.api.model.BrickProfileDetail) ProfileDetails(org.ovirt.engine.api.model.ProfileDetails)

Example 2 with BrickProfileDetail

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

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