ofri masad has posted comments on this change.

Change subject: core: Quota refactor - parameters
......................................................................


Patch Set 14: (6 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
Line 540:             }
Line 541:         }
Line 542:     }
Line 543: 
Line 544:     private List<QuotaConsumptionParameter> 
getQuotaConsumptionParameters() {
Done
Line 545:         List<QuotaConsumptionParameter> consumptionParameters = new 
ArrayList<QuotaConsumptionParameter>();
Line 546: 
Line 547:         // This a double marking mechanism which was created to 
ensure Quota dependencies would not be inherited
Line 548:         // by descendants commands. Each Command is both marked by 
the QuotaDependency and implements the required


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaConsumptionParameter.java
Line 4: import org.ovirt.engine.core.compat.Guid;
Line 5: 
Line 6: public abstract class QuotaConsumptionParameter implements Cloneable{
Line 7:     private Guid quotaGuid;
Line 8:     private Quota quota;
Done
Line 9:     private QuotaAction quotaAction = QuotaAction.CONSUME;
Line 10: 
Line 11:     protected QuotaConsumptionParameter(Guid quotaGuid, Quota quota, 
QuotaAction quotaAction) {
Line 12:         this.quotaGuid = quotaGuid;


Line 38:         this.quotaAction = quotaAction;
Line 39:     }
Line 40: 
Line 41:     public abstract ParameterType getParameterType();
Line 42: 
Done
Line 43:     public enum QuotaAction {
Line 44:         CONSUME, RELEASE
Line 45:     }
Line 46: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaConsumptionParametersWrapper.java
Line 55:     public QuotaConsumptionParametersWrapper clone() throws 
CloneNotSupportedException {
Line 56:         QuotaConsumptionParametersWrapper cloneWrapper = new 
QuotaConsumptionParametersWrapper(getAuditLogable(),
Line 57:                 canDoActionMessages);
Line 58:         cloneWrapper.setParameters(new 
ArrayList<QuotaConsumptionParameter>());
Line 59: 
Done
Line 60:         for (QuotaConsumptionParameter parameter : getParameters()) {
Line 61:             cloneWrapper.getParameters().add(parameter.clone());
Line 62:         }
Line 63: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaStorageConsumptionParameter.java
Line 10: 
Line 11:     public QuotaStorageConsumptionParameter(Guid quotaGuid,
Line 12:             Quota quota,
Line 13:             QuotaAction quotaAction,
Line 14:             Guid storageDomainId,
Done
Line 15:             Double requestedStorageGB) {
Line 16:         super(quotaGuid, quota, quotaAction);
Line 17:         this.storageDomainId = storageDomainId;
Line 18:         this.requestedStorageGB = requestedStorageGB;


Line 36: 
Line 37:     @Override
Line 38:     public QuotaStorageConsumptionParameter clone() throws 
CloneNotSupportedException {
Line 39:         return new QuotaStorageConsumptionParameter(
Line 40:                 getQuotaGuid(),
Quota is mutable but it should not be cloned in order to prevent simultaneous 
consumption of same quota.
Line 41:                 getQuota(),
Line 42:                 getQuotaAction(),
Line 43:                 storageDomainId,
Line 44:                 requestedStorageGB);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iebfc85569ba1aa8bd840f7239f83b7f921a4bd8e
Gerrit-PatchSet: 14
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <oma...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Laszlo Hornyak <lhorn...@redhat.com>
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com>
Gerrit-Reviewer: Sharad Mishra <snmis...@linux.vnet.ibm.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: ofri masad <oma...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to