Moti Asayag has posted comments on this change.

Change subject: core: adding AbstractVmInterfaceCommand
......................................................................


Patch Set 15: (4 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractVmInterfaceCommand.java
Line 7: import org.ovirt.engine.core.common.action.VmOperationParameterBase;
Line 8: import org.ovirt.engine.core.compat.Guid;
Line 9: 
Line 10: public abstract class AbstractVmInterfaceCommand<T extends 
VmOperationParameterBase> extends VmCommand<T> {
Line 11: 
the command isn't serialized so you can replace the serialization 
implementation with warnings ignore annotation.
Line 12:     private static final long serialVersionUID = -7225784533944857839L;
Line 13: 
Line 14:     public AbstractVmInterfaceCommand(T parameters) {
Line 15:         super(parameters);


Line 15:         super(parameters);
Line 16:     }
Line 17: 
Line 18:     protected boolean activateOrDeactivateNic(Guid nicId, PlugAction 
plugAction) {
Line 19:         VdcReturnValueBase activateVmNicReturnValue =
since the return value might be either activate or deactivate, this variable 
name could be generalized just to returnValue, without stating the action.
Line 20:                 
getBackend().runInternalAction(VdcActionType.ActivateDeactivateVmNic,
Line 21:                         createActivateDeactivateParameters(nicId, 
plugAction));
Line 22:         if (!activateVmNicReturnValue.getSucceeded()) {
Line 23:             propagateFailure(activateVmNicReturnValue);


Line 29:     private ActivateDeactivateVmNicParameters 
createActivateDeactivateParameters(Guid nicId,
Line 30:             PlugAction plugAction) {
Line 31:         ActivateDeactivateVmNicParameters parameters =
Line 32:                 new ActivateDeactivateVmNicParameters(nicId, 
plugAction);
Line 33:         parameters.setVmId(getParameters().getVmId());
this space line could be removed.
Line 34: 
Line 35:         return parameters;
Line 36:     }
Line 37: 


Line 34: 
Line 35:         return parameters;
Line 36:     }
Line 37: 
Line 38:     private void propagateFailure(VdcReturnValueBase 
internalReturnValue) {
perhaps this method should be protected to allow the extended commands how to 
handle a failure of this operation ?
Line 39:         
getReturnValue().getExecuteFailedMessages().addAll(internalReturnValue.getExecuteFailedMessages());
Line 40:         getReturnValue().setFault(internalReturnValue.getFault());
Line 41:         
getReturnValue().getCanDoActionMessages().addAll(internalReturnValue.getCanDoActionMessages());
Line 42:         
getReturnValue().setCanDoAction(internalReturnValue.getCanDoAction());


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I15acf7c715703582e96274f4621239b33d263172
Gerrit-PatchSet: 15
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkole...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to