anmolbabu has uploaded a new change for review. Change subject: engine : Bll command to start geo-rep session ......................................................................
engine : Bll command to start geo-rep session Bll command to start geo-rep session Change-Id: Ib74c515d23218bb2e30403e0e0042c84b74dc2bb Signed-off-by: Anmol Babu <[email protected]> --- A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeGeoRepStartCommand.java A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/gluster/GlusterVolumeGeoRepSessionStartParameters.java 2 files changed, 81 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/37/32537/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeGeoRepStartCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeGeoRepStartCommand.java new file mode 100644 index 0000000..5241d56 --- /dev/null +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeGeoRepStartCommand.java @@ -0,0 +1,40 @@ +package org.ovirt.engine.core.bll.gluster; + +import org.ovirt.engine.core.common.AuditLogType; +import org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionStartParameters; +import org.ovirt.engine.core.common.errors.VdcBllMessages; +import org.ovirt.engine.core.common.vdscommands.VDSCommandType; +import org.ovirt.engine.core.common.vdscommands.VDSReturnValue; +import org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionStartVDSParameters; + +public class GlusterVolumeGeoRepStartCommand extends GlusterVolumeCommandBase<GlusterVolumeGeoRepSessionStartParameters> { + public GlusterVolumeGeoRepStartCommand(GlusterVolumeGeoRepSessionStartParameters params) { + super(params); + } + + @Override + protected void setActionMessageParameters() { + addCanDoActionMessage(VdcBllMessages.VAR_ACTION_GEO_REP_START); + addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_VOLUME); + } + + @Override + protected void executeCommand() { + GlusterVolumeGeoRepSessionStartParameters parameters = getParameters(); + setGlusterVolumeId(parameters.getVolumeId()); + VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GlusterVolumeGeoRepStart, new GlusterVolumeGeoRepSessionStartVDSParameters(upServer.getId(), getGlusterVolumeName(), parameters.getSlaveVolumeName(), parameters.getSlaveHost())); + setSucceeded(returnValue.getSucceeded()); + if(! getSucceeded()) { + handleVdsError(AuditLogType.GLUSTER_VOLUME_GEO_REP_START_FAILED_EXCEPTION, returnValue.getVdsError().getMessage()); + } + } + + @Override + public AuditLogType getAuditLogTypeValue() { + if(getSucceeded()) { + return AuditLogType.GLUSTER_VOLUME_GEO_REP_START; + } else { + return errorType == null ? AuditLogType.GLUSTER_VOLUME_GEO_REP_START_FAILED_EXCEPTION : errorType; + } + } +} diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/gluster/GlusterVolumeGeoRepSessionStartParameters.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/gluster/GlusterVolumeGeoRepSessionStartParameters.java new file mode 100644 index 0000000..bb83ba5 --- /dev/null +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/gluster/GlusterVolumeGeoRepSessionStartParameters.java @@ -0,0 +1,41 @@ +package org.ovirt.engine.core.common.action.gluster; + +import org.ovirt.engine.core.compat.Guid; + +public class GlusterVolumeGeoRepSessionStartParameters extends GlusterVolumeParameters{ + + private static final long serialVersionUID = -881348048838907389L; + + private String slaveVolumeName; + private String slaveHost; + private boolean force; + + public GlusterVolumeGeoRepSessionStartParameters() { + super(); + } + + public GlusterVolumeGeoRepSessionStartParameters(Guid volumeId, String slaveVolumeName, String slaveHost) { + super(volumeId); + this.slaveVolumeName = slaveVolumeName; + this.slaveHost = slaveHost; + } + + public String getSlaveVolumeName() { + return slaveVolumeName; + } + public void setSlaveVolumeName(String slaveVolumeName) { + this.slaveVolumeName = slaveVolumeName; + } + public String getSlaveHost() { + return slaveHost; + } + public void setSlaveHost(String slaveHost) { + this.slaveHost = slaveHost; + } + public boolean isForce() { + return force; + } + public void setForce(boolean force) { + this.force = force; + } +} -- To view, visit http://gerrit.ovirt.org/32537 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib74c515d23218bb2e30403e0e0042c84b74dc2bb Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: anmolbabu <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
