Alon Bar-Lev has posted comments on this change.

Change subject: aaa: Adding engineSessionId on CommandContext
......................................................................


Patch Set 17:

(6 comments)

almost there, right?

http://gerrit.ovirt.org/#/c/28829/17/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddImageFromScratchCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddImageFromScratchCommand.java:

Line 22: @NonTransactiveCommandAttribute(forceCompensation=true)
Line 23: public class AddImageFromScratchCommand<T extends 
AddImageFromScratchParameters> extends CreateSnapshotCommand<T> {
Line 24: 
Line 25:     public AddImageFromScratchCommand(T parameters, CommandContext 
parentCommandContext) {
Line 26:         super(parameters, parentCommandContext);
as you expect to call this after duplicate, I think this is context not 
parentCommandContext, as this context belongs to the command.
Line 27:         setVmId(getParameters().getMasterVmId());
Line 28:         getParameters().setCommandType(getActionType());
Line 29:     }
Line 30: 


http://gerrit.ovirt.org/#/c/28829/17/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java:

Line 2175:     protected VdcQueryReturnValue runInternalQuery(VdcQueryType 
type, VdcQueryParametersBase queryParams) {
Line 2176:         return getBackend().runInternalQuery(type, queryParams, 
createQueryContext());
Line 2177:     }
Line 2178: 
Line 2179:     protected void handleParentCommandContext(CommandContext 
parentCommandContext) {
I almost sure this is your context, not the parent, so you can just store it.
Line 2180:         if (parentCommandContext == null) {
Line 2181:             return;
Line 2182:         }
Line 2183: 


Line 2189:         }
Line 2190: 
Line 2191:         CompensationContext compensationContext = 
parentCommandContext.getCompensationContext();
Line 2192:         if (compensationContext != null) {
Line 2193:             setCompensationContext(compensationContext);
can't we just always take it from these context?
Line 2194:         }
Line 2195: 
Line 2196:         ExecutionContext executionContext = 
parentCommandContext.getExecutionContext();
Line 2197:         if (executionContext != null) {


http://gerrit.ovirt.org/#/c/28829/17/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/context/CommandContext.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/context/CommandContext.java:

Line 23: 
Line 24:     public CommandContext setEngineContext(EngineContext 
engineContext) {
Line 25:         this.engineContext = engineContext;
Line 26:         return this;
Line 27:     }
if we can avoid set context it would be great. please put all methods at one 
place.
Line 28: 
Line 29:     /**
Line 30:      * The Lock in the command context is used by the parent command 
to pass to the child command locks the child needs
Line 31:      * to acquire.


http://gerrit.ovirt.org/#/c/28829/17/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/context/EngineContext.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/context/EngineContext.java:

Line 5:     private String sessionId;
Line 6: 
Line 7:     public EngineContext(String sessionId) {
Line 8:         this.sessionId = sessionId;
Line 9:     }
I think we should be consistent and always use chaining.

 new EngineContext().setSessionId(xx)
Line 10: 
Line 11:     public String getSessionId() {
Line 12:         return sessionId;
Line 13:     }


http://gerrit.ovirt.org/#/c/28829/17/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/context/QueryContext.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/context/QueryContext.java:

Line 11:     public EngineContext getEngineContext() {
Line 12:         return engineContext;
Line 13:     }
Line 14: 
Line 15:     public void setEngineContext(EngineContext engineContext) {
if we can avoid set context it will be great.
Line 16:         this.engineContext = engineContext;
Line 17:     }
Line 18: 


-- 
To view, visit http://gerrit.ovirt.org/28829
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I310f5f77fff78b3232ee77fe63791425fd521516
Gerrit-PatchSet: 17
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to