use of org.ovirt.engine.api.model.GlusterClients in project ovirt-engine by oVirt.
the class V3GlusterBrickAdvancedDetailsInAdapter method adapt.
@Override
public GlusterBrickAdvancedDetails adapt(V3GlusterBrickAdvancedDetails from) {
GlusterBrickAdvancedDetails to = new GlusterBrickAdvancedDetails();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetDevice()) {
to.setDevice(from.getDevice());
}
if (from.isSetFsName()) {
to.setFsName(from.getFsName());
}
if (from.isSetGlusterClients()) {
to.setGlusterClients(new GlusterClients());
to.getGlusterClients().getGlusterClients().addAll(adaptIn(from.getGlusterClients().getGlusterClients()));
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetMemoryPools()) {
to.setMemoryPools(new GlusterMemoryPools());
to.getMemoryPools().getGlusterMemoryPools().addAll(adaptIn(from.getMemoryPools().getGlusterMemoryPools()));
}
if (from.isSetMntOptions()) {
to.setMntOptions(from.getMntOptions());
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetPid()) {
to.setPid(from.getPid());
}
if (from.isSetPort()) {
to.setPort(from.getPort());
}
return to;
}
use of org.ovirt.engine.api.model.GlusterClients in project ovirt-engine by oVirt.
the class V3GlusterBrickInAdapter method adapt.
@Override
public GlusterBrick adapt(V3GlusterBrick from) {
GlusterBrick to = new GlusterBrick();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetBrickDir()) {
to.setBrickDir(from.getBrickDir());
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetDevice()) {
to.setDevice(from.getDevice());
}
if (from.isSetFsName()) {
to.setFsName(from.getFsName());
}
if (from.isSetGlusterClients()) {
to.setGlusterClients(new GlusterClients());
to.getGlusterClients().getGlusterClients().addAll(adaptIn(from.getGlusterClients().getGlusterClients()));
}
if (from.isSetGlusterVolume()) {
to.setGlusterVolume(adaptIn(from.getGlusterVolume()));
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetMemoryPools()) {
to.setMemoryPools(new GlusterMemoryPools());
to.getMemoryPools().getGlusterMemoryPools().addAll(adaptIn(from.getMemoryPools().getGlusterMemoryPools()));
}
if (from.isSetMntOptions()) {
to.setMntOptions(from.getMntOptions());
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetPid()) {
to.setPid(from.getPid());
}
if (from.isSetPort()) {
to.setPort(from.getPort());
}
if (from.isSetServerId()) {
to.setServerId(from.getServerId());
}
if (from.isSetStatus() && from.getStatus().isSetState()) {
to.setStatus(GlusterBrickStatus.fromValue(from.getStatus().getState()));
}
return to;
}
use of org.ovirt.engine.api.model.GlusterClients in project ovirt-engine by oVirt.
the class GlusterBrickDetailMapper method map.
@Mapping(from = GlusterVolumeAdvancedDetails.class, to = GlusterBrick.class)
public static GlusterBrick map(GlusterVolumeAdvancedDetails fromEntity, GlusterBrick toModel) {
GlusterBrick model = (toModel == null) ? new GlusterBrick() : toModel;
if (fromEntity.getBrickDetails() == null) {
return model;
}
// Since the getDetails call is for a single brick the list size will always be 1 - so get the first element
BrickDetails detail = (fromEntity.getBrickDetails().size() > 0) ? fromEntity.getBrickDetails().get(0) : null;
if (detail == null) {
return model;
}
model = mapBrickProperties(detail, model);
if (detail.getClients() != null) {
model.setGlusterClients(new GlusterClients());
for (GlusterClientInfo clientEntity : detail.getClients()) {
model.getGlusterClients().getGlusterClients().add(map(clientEntity));
}
}
if (detail.getMemoryStatus() != null && detail.getMemoryStatus().getMemPools() != null) {
model.setMemoryPools(new GlusterMemoryPools());
for (Mempool pool : detail.getMemoryStatus().getMemPools()) {
model.getMemoryPools().getGlusterMemoryPools().add(map(pool));
}
}
return model;
}
Aggregations