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;
}
Aggregations