Search in sources :

Example 21 with GlusterBrick

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

GlusterBrick (org.ovirt.engine.api.model.GlusterBrick)21 GlusterBricks (org.ovirt.engine.api.model.GlusterBricks)7 GlusterVolume (org.ovirt.engine.api.model.GlusterVolume)7 GlusterBrickEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity)6 GlusterVolumeRemoveBricksParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters)5 Action (org.ovirt.engine.api.model.Action)4 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 AbstractBackendCollectionResourceTest (org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResourceTest)3 Cluster (org.ovirt.engine.api.model.Cluster)2 GlusterClients (org.ovirt.engine.api.model.GlusterClients)2 GlusterMemoryPools (org.ovirt.engine.api.model.GlusterMemoryPools)2 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)2 WebApplicationException (javax.ws.rs.WebApplicationException)1 BrickProfileDetail (org.ovirt.engine.api.model.BrickProfileDetail)1 BrickProfileDetails (org.ovirt.engine.api.model.BrickProfileDetails)1 Fault (org.ovirt.engine.api.model.Fault)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