Search in sources :

Example 6 with GlusterVolumeGeoRepSessionVDSParameters

use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters in project ovirt-engine by oVirt.

the class ResumeGeoRepSessionVDSCommand method executeVdsBrokerCommand.

@Override
protected void executeVdsBrokerCommand() {
    GlusterVolumeGeoRepSessionVDSParameters parameters = getParameters();
    status = getBroker().glusterVolumeGeoRepSessionResume(parameters.getVolumeName(), parameters.getSlaveHost(), parameters.getSlaveVolume(), parameters.getUserName(), parameters.getForce());
    proceedProxyReturnValue();
}
Also used : GlusterVolumeGeoRepSessionVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters)

Example 7 with GlusterVolumeGeoRepSessionVDSParameters

use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters in project ovirt-engine by oVirt.

the class ResumeGeoRepSessionCommand method executeCommand.

@Override
protected void executeCommand() {
    GlusterGeoRepSession session = getGeoRepSession();
    VDSReturnValue returnValue = runVdsCommand(VDSCommandType.ResumeGeoRepSession, new GlusterVolumeGeoRepSessionVDSParameters(upServer.getId(), session.getMasterVolumeName(), session.getSlaveHostName(), session.getSlaveVolumeName(), session.getUserName(), parameters.isForce()));
    setSucceeded(returnValue.getSucceeded());
    if (!getSucceeded()) {
        handleVdsError(AuditLogType.GLUSTER_VOLUME_GEO_REP_RESUME_FAILED, returnValue.getVdsError().getMessage());
        return;
    }
}
Also used : GlusterGeoRepSession(org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession) GlusterVolumeGeoRepSessionVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 8 with GlusterVolumeGeoRepSessionVDSParameters

use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters in project ovirt-engine by oVirt.

the class PauseGlusterVolumeGeoRepSessionCommand method executeCommand.

@Override
protected void executeCommand() {
    GlusterGeoRepSession session = getGeoRepSession();
    VDSReturnValue returnValue = runVdsCommand(VDSCommandType.PauseGlusterVolumeGeoRepSession, new GlusterVolumeGeoRepSessionVDSParameters(upServer.getId(), session.getMasterVolumeName(), session.getSlaveHostName(), session.getSlaveVolumeName(), session.getUserName(), getParameters().isForce()));
    setSucceeded(returnValue.getSucceeded());
    if (!getSucceeded()) {
        handleVdsError(AuditLogType.GLUSTER_VOLUME_GEO_REP_PAUSE_FAILED, returnValue.getVdsError().getMessage());
        return;
    } else {
        session.setStatus(GeoRepSessionStatus.PAUSED);
        glusterGeoRepDao.updateSession(session);
    }
}
Also used : GlusterGeoRepSession(org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession) GlusterVolumeGeoRepSessionVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 9 with GlusterVolumeGeoRepSessionVDSParameters

use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters in project ovirt-engine by oVirt.

the class StopGeoRepSessionCommand method executeCommand.

@Override
protected void executeCommand() {
    VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StopGlusterVolumeGeoRepSession, new GlusterVolumeGeoRepSessionVDSParameters(upServer.getId(), getGeoRepSession().getMasterVolumeName(), getGeoRepSession().getSlaveHostName(), getGeoRepSession().getSlaveVolumeName(), getGeoRepSession().getUserName(), getParameters().isForce()));
    setSucceeded(returnValue.getSucceeded());
    if (getSucceeded()) {
        getGeoRepSession().setStatus(GeoRepSessionStatus.STOPPED);
        glusterGeoRepDao.updateSession(getGeoRepSession());
    } else {
        handleVdsError(AuditLogType.GEOREP_SESSION_STOP_FAILED, returnValue.getVdsError().getMessage());
    }
}
Also used : GlusterVolumeGeoRepSessionVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 10 with GlusterVolumeGeoRepSessionVDSParameters

use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters in project ovirt-engine by oVirt.

the class GetGlusterVolumeGeoRepSessionListVDSCommand method executeVdsBrokerCommand.

@Override
protected void executeVdsBrokerCommand() {
    GlusterVolumeGeoRepSessionVDSParameters parameter = getParameters();
    if (parameter.getVolumeName() == null) {
        result = getBroker().glusterVolumeGeoRepSessionList();
    } else if (parameter.getSlaveHost() == null || parameter.getSlaveVolume() == null) {
        result = getBroker().glusterVolumeGeoRepSessionList(parameter.getVolumeName());
    } else {
        result = getBroker().glusterVolumeGeoRepSessionList(parameter.getVolumeName(), parameter.getSlaveHost(), parameter.getSlaveVolume(), parameter.getUserName());
    }
    proceedProxyReturnValue();
    if (getVDSReturnValue().getSucceeded()) {
        setReturnValue(result.getGeoRepSessions());
    }
}
Also used : GlusterVolumeGeoRepSessionVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters)

Aggregations

GlusterVolumeGeoRepSessionVDSParameters (org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters)16 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)9 GlusterGeoRepSession (org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession)5 ArrayList (java.util.ArrayList)4 List (java.util.List)3 VDS (org.ovirt.engine.core.common.businessentities.VDS)3 HashSet (java.util.HashSet)2 SetUpMountBrokerParameters (org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters)2 SetUpPasswordLessSSHParameters (org.ovirt.engine.core.common.action.gluster.SetUpPasswordLessSSHParameters)2 EngineException (org.ovirt.engine.core.common.errors.EngineException)2 Guid (org.ovirt.engine.core.compat.Guid)2 HashMap (java.util.HashMap)1 Callable (java.util.concurrent.Callable)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 GlusterVolumeGeoRepSessionParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters)1 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)1