Yair Zaslavsky has uploaded a new change for review. Change subject: aaa: fixing more context issues ......................................................................
aaa: fixing more context issues Change-Id: I793344d07b1a60eac50df81ed3fdca04e5a7851a Topic: AAA Signed-off-by: Yair Zaslavsky <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ActivateVdsCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ApproveVdsCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmPoolCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StartVdsCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsNotRespondingTreatmentCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsPowerDownCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/SetStoragePoolStatusCommand.java 9 files changed, 58 insertions(+), 10 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/20/30620/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ActivateVdsCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ActivateVdsCommand.java index 9a147ea..37511d3 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ActivateVdsCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ActivateVdsCommand.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Map; +import org.ovirt.engine.core.bll.context.CommandContext; import org.ovirt.engine.core.bll.job.ExecutionHandler; import org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper; import org.ovirt.engine.core.common.AuditLogType; @@ -32,10 +33,14 @@ private boolean haMaintenanceFailed; public ActivateVdsCommand(T parameters) { - super(parameters); - haMaintenanceFailed = false; + this(parameters, null); } + public ActivateVdsCommand(T parameters, CommandContext commandContext) { + super(parameters, commandContext); + } + + /** * Constructor for command creation when compensation is applied on startup * diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ApproveVdsCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ApproveVdsCommand.java index 2964e8a..1a4f93b 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ApproveVdsCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ApproveVdsCommand.java @@ -1,5 +1,6 @@ package org.ovirt.engine.core.bll; +import org.ovirt.engine.core.bll.context.CommandContext; import org.ovirt.engine.core.common.AuditLogType; import org.ovirt.engine.core.common.action.ApproveVdsParameters; import org.ovirt.engine.core.common.action.LockProperties; @@ -14,9 +15,14 @@ public class ApproveVdsCommand<T extends ApproveVdsParameters> extends InstallVdsInternalCommand<T> { public ApproveVdsCommand(T parameters) { - super(parameters); + this(parameters, null); } + public ApproveVdsCommand(T parameters, CommandContext commandContext) { + super(parameters, commandContext); + } + + @Override protected LockProperties applyLockProperties(LockProperties lockProperties) { return lockProperties; diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java index dc00027..e252ca7 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Map; +import org.ovirt.engine.core.bll.context.CommandContext; import org.ovirt.engine.core.common.VdcObjectType; import org.ovirt.engine.core.common.action.LockProperties; import org.ovirt.engine.core.common.action.LockProperties.Scope; @@ -16,7 +17,11 @@ @NonTransactiveCommandAttribute public class MigrateVmToServerCommand<T extends MigrateVmToServerParameters> extends MigrateVmCommand<T> { public MigrateVmToServerCommand(T parameters) { - super(parameters); + this(parameters, null); + } + + public MigrateVmToServerCommand(T parameters, CommandContext commandContext) { + super(parameters, commandContext); setDestinationVdsId(parameters.getVdsId()); } diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmPoolCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmPoolCommand.java index 873e601..0c28e6e 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmPoolCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmPoolCommand.java @@ -3,6 +3,7 @@ import java.util.ArrayList; import java.util.Map; +import org.ovirt.engine.core.bll.context.CommandContext; import org.ovirt.engine.core.common.AuditLogType; import org.ovirt.engine.core.common.VdcObjectType; import org.ovirt.engine.core.common.action.VmPoolParametersBase; @@ -12,7 +13,11 @@ public class RemoveVmPoolCommand<T extends VmPoolParametersBase> extends VmPoolCommandBase<T> { public RemoveVmPoolCommand(T parameters) { - super(parameters); + this(parameters, null); + } + + public RemoveVmPoolCommand(T parameters, CommandContext commandContext) { + super(parameters, commandContext); // set group id for logging and job if (getVmPool() != null) { setVdsGroupId(getVmPool().getVdsGroupId()); diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java index a2f8f4c..be63dc6 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java @@ -61,9 +61,14 @@ } public RestartVdsCommand(T parameters) { - super(parameters); + this(parameters, null); } + public RestartVdsCommand(T parameters, CommandContext commandContext) { + super(parameters, commandContext); + } + + @Override protected LockProperties applyLockProperties(LockProperties lockProperties) { return lockProperties.withScope(Scope.Execution); diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StartVdsCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StartVdsCommand.java index 7f73b65..7725495 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StartVdsCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StartVdsCommand.java @@ -1,5 +1,6 @@ package org.ovirt.engine.core.bll; +import org.ovirt.engine.core.bll.context.CommandContext; import org.ovirt.engine.core.common.AuditLogType; import org.ovirt.engine.core.common.action.FenceVdsActionParameters; import org.ovirt.engine.core.common.action.LockProperties; @@ -23,9 +24,14 @@ @NonTransactiveCommandAttribute public class StartVdsCommand<T extends FenceVdsActionParameters> extends FenceVdsBaseCommand<T> { public StartVdsCommand(T parameters) { - super(parameters); + this(parameters, null); } + public StartVdsCommand(T parameters, CommandContext commandContext) { + super(parameters, commandContext); + } + + @Override protected LockProperties applyLockProperties(LockProperties lockProperties) { return lockProperties.withScope(Scope.Execution); diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsNotRespondingTreatmentCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsNotRespondingTreatmentCommand.java index bc67b1c..b2a9de4 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsNotRespondingTreatmentCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsNotRespondingTreatmentCommand.java @@ -4,6 +4,7 @@ import java.util.Map; import org.apache.commons.lang.ObjectUtils; +import org.ovirt.engine.core.bll.context.CommandContext; import org.ovirt.engine.core.bll.job.ExecutionContext; import org.ovirt.engine.core.bll.job.ExecutionHandler; import org.ovirt.engine.core.common.AuditLogType; @@ -28,9 +29,14 @@ private static final String RESTART = "Restart"; public VdsNotRespondingTreatmentCommand(T parameters) { - super(parameters); + this(parameters, null); } + public VdsNotRespondingTreatmentCommand(T parameters, CommandContext commandContext) { + super(parameters, commandContext); + } + + @Override protected LockProperties applyLockProperties(LockProperties lockProperties) { return lockProperties.withScope(Scope.Execution); diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsPowerDownCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsPowerDownCommand.java index 111f3c8..57c3229 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsPowerDownCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsPowerDownCommand.java @@ -3,6 +3,7 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; +import org.ovirt.engine.core.bll.context.CommandContext; import org.ovirt.engine.core.bll.job.ExecutionHandler; import org.ovirt.engine.core.bll.utils.EngineSSHClient; import org.ovirt.engine.core.common.action.FenceVdsActionParameters; @@ -19,7 +20,11 @@ @NonTransactiveCommandAttribute public class VdsPowerDownCommand<T extends VdsPowerDownParameters> extends VdsCommand<T> { public VdsPowerDownCommand(T parameters) { - super(parameters); + this(parameters, null); + } + + public VdsPowerDownCommand(T parameters, CommandContext commandContext) { + super(parameters, commandContext); } @Override diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/SetStoragePoolStatusCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/SetStoragePoolStatusCommand.java index 94fe74e..7cea103 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/SetStoragePoolStatusCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/SetStoragePoolStatusCommand.java @@ -4,6 +4,7 @@ import org.apache.commons.lang.StringUtils; import org.ovirt.engine.core.bll.Backend; +import org.ovirt.engine.core.bll.context.CommandContext; import org.ovirt.engine.core.common.AuditLogType; import org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters; import org.ovirt.engine.core.common.businessentities.StorageDomainStatus; @@ -14,7 +15,11 @@ public class SetStoragePoolStatusCommand<T extends SetStoragePoolStatusParameters> extends StorageHandlingCommandBase<T> { public SetStoragePoolStatusCommand(T parameters) { - super(parameters); + this(parameters, null); + } + + public SetStoragePoolStatusCommand(T parameters, CommandContext commandContext) { + super(parameters, commandContext); } @Override -- To view, visit http://gerrit.ovirt.org/30620 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I793344d07b1a60eac50df81ed3fdca04e5a7851a Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
