use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession in project ovirt-engine by oVirt.
the class GetGlusterVolumeGeoRepSessionByIdQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
GlusterGeoRepSession geoRepSession = glusterGeoRepDao.getById(getParameters().getId());
getQueryReturnValue().setReturnValue(geoRepSession);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession in project ovirt-engine by oVirt.
the class GetGlusterVolumeGeoRepSessionsQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
List<GlusterGeoRepSession> geoRepSessions = glusterGeoRepDao.getGeoRepSessions(getParameters().getId());
/*
* If master volume has sessions, update the master server names in accordance with masterBrickId in sessionDetails.
*/
if (geoRepSessions != null) {
for (GlusterGeoRepSession currentSession : geoRepSessions) {
// For each session get corresponding session details.
List<GlusterGeoRepSessionDetails> geoRepSessionDetails = glusterGeoRepDao.getGeoRepSessionDetails(currentSession.getId());
/*
* Session details could be null, if they are not yet synced. possible if session detail command failed for some unexpected reason
* such as network failure even though the sessions in the cluster are synced(sessionListCommand)
*/
if (geoRepSessionDetails == null) {
continue;
}
/*
* If non null session detail, set masterBrick servername in accordance with that in brick
* as obtained by using masterbrickId
*/
for (GlusterGeoRepSessionDetails currentDetail : geoRepSessionDetails) {
if (currentDetail == null) {
continue;
}
Guid currentMasterBrickId = currentDetail.getMasterBrickId();
if (currentMasterBrickId == null) {
continue;
}
GlusterBrickEntity currentBrick = glusterBrickDao.getById(currentMasterBrickId);
if (currentBrick != null) {
currentDetail.setMasterBrickHostName(currentBrick.getServerName());
}
}
/*
* Finally set session details to the current session
*/
currentSession.setSessionDetails((ArrayList<GlusterGeoRepSessionDetails>) geoRepSessionDetails);
}
}
getQueryReturnValue().setReturnValue(geoRepSessions);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession in project ovirt-engine by oVirt.
the class GlusterGeoRepSyncJobTest method getSession.
private GlusterGeoRepSession getSession(boolean populateVoId) {
GlusterGeoRepSession session = new GlusterGeoRepSession();
session.setMasterVolumeName("VOL1");
if (populateVoId) {
session.setMasterVolumeId(Guid.newGuid());
}
session.setId(Guid.newGuid());
session.setSessionKey(session.getId() + session.getMasterVolumeName());
session.setStatus(GeoRepSessionStatus.ACTIVE);
session.setSessionDetails(getSessionDetailsList());
return session;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession in project ovirt-engine by oVirt.
the class GetGlusterVolumeGeoRepSessionsQueryTest method getMockGeoRepSessions.
private List<GlusterGeoRepSession> getMockGeoRepSessions() {
List<GlusterGeoRepSession> sessions = new ArrayList<>();
GlusterGeoRepSession session = new GlusterGeoRepSession();
session.setId(sessionId);
session.setMasterVolumeId(masterVolumeId);
session.setSessionKey("");
session.setSlaveHostName("slave-host-1");
session.setSlaveVolumeId(slaveVolumeId);
session.setSlaveNodeUuid(slaveNodeUuid);
session.setSlaveVolumeName("");
session.setStatus(GeoRepSessionStatus.ACTIVE);
sessions.add(session);
return sessions;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession in project ovirt-engine by oVirt.
the class PauseGlusterVolumeGeoRepSessionCommandTest method getGeoRepSession.
protected GlusterGeoRepSession getGeoRepSession(Guid gSessionId, GeoRepSessionStatus status, Guid masterVolumeID) {
GlusterGeoRepSession session = super.getGeoRepSession(gSessionId, status);
session.setMasterVolumeId(startedVolumeId);
return session;
}
Aggregations