Gilad Chaplik has posted comments on this change.

Change subject: core: Cpu Profile CRUD commands and queries
......................................................................


Patch Set 1:

(5 comments)

http://gerrit.ovirt.org/#/c/31625/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetCpuProfilesByCpuQosIdQuery.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetCpuProfilesByCpuQosIdQuery.java:

Line 9:     }
Line 10: 
Line 11:     @Override
Line 12:     protected void executeQueryCommand() {
Line 13:         
getQueryReturnValue().setReturnValue(getDbFacade().getDiskProfileDao()
> s\getDiskProfileDao\getCpuProfileDao
Done
Line 14:                 .getAllForQos(getParameters().getId()));
Line 15:     }
Line 16: 


http://gerrit.ovirt.org/#/c/31625/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/profiles/CpuProfileValidator.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/profiles/CpuProfileValidator.java:

Line 23:     }
Line 24: 
Line 25:     @Override
Line 26:     public ValidationResult parentEntityExists() {
Line 27:         // TODO:
> when? :)
some day, 
Done.
Line 28:         return ValidationResult.VALID;
Line 29:     }
Line 30: 
Line 31:     @Override


Line 53:         Guid id = getProfile().getId();
Line 54:         if (id == null) {
Line 55:             return new 
ValidationResult(VdcBllMessages.ACTION_TYPE_CPU_PROFILE_EMPTY);
Line 56:         }
Line 57:         CpuProfile fetchedDiskProfile = getProfileDao().get(id);
> s\fetchedDiskProfile\fetchedCpuProfile
Done
Line 58:         if (fetchedDiskProfile == null) {
Line 59:             return new 
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_CPU_PROFILE_NOT_FOUND);
Line 60:         }
Line 61:         if (!clusterId.equals(fetchedDiskProfile.getClusterId())) {


http://gerrit.ovirt.org/#/c/31625/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/profiles/ProfileValidator.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/profiles/ProfileValidator.java:

Line 38:     }
Line 39: 
Line 40:     public ValidationResult profileExists() {
Line 41:         return getProfileFromDb() == null
Line 42:                 ? new 
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_PROFILE_NOT_EXISTS)
> using the same error message in #36 and here might confused us in the futur
Done
Line 43:                 : ValidationResult.VALID;
Line 44:     }
Line 45: 
Line 46:     public ValidationResult qosExistsOrNull() {


http://gerrit.ovirt.org/#/c/31625/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/profiles/UpdateProfileCommandBase.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/profiles/UpdateProfileCommandBase.java:

Line 21: 
Line 22:     @Override
Line 23:     protected void executeCommand() {
Line 24:         getProfileDao().update(getParameters().getProfile());
Line 25:         
getReturnValue().setActionReturnValue(getParameters().getProfile().getId());
> not that important, but don't you prefer to return the updated profile inst
actually that's important, and part of the convention :)

when adding an element in REST, that's how we show it when command succeed.
Line 26:         setSucceeded(true);
Line 27:     }
Line 28: 
Line 29:     protected abstract Q getProfileValidator();


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6be41103ad9b04fc7d0b530439ab4a2c731bbded
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@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