Tomas Jelinek has posted comments on this change.
Change subject: engine: Added IsDisplayAddressConsistentInClusterQuery
......................................................................
Patch Set 1: (4 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetHostsInClusterPartiallyOverriddenQuery.java
Line 7: import
org.ovirt.engine.core.common.queries.GetHostsInClusterPartiallyOverriddenParameters;
Line 8: import org.ovirt.engine.core.common.queries.VdcQueryReturnValue;
Line 9: import org.ovirt.engine.core.common.queries.VdcQueryType;
Line 10:
Line 11: public class GetHostsInClusterPartiallyOverriddenQuery<P extends
GetHostsInClusterPartiallyOverriddenParameters> extends QueriesCommandBase<P> {
renamed to IsDisplayAddressConsistentInClusterQuery - also changed to return
the correct state as true.
Line 12:
Line 13: public GetHostsInClusterPartiallyOverriddenQuery(P parameters) {
Line 14: super(parameters);
Line 15: }
Line 18: protected void executeQueryCommand() {
Line 19: GetHostsByClusterIdParameters params = new
GetHostsByClusterIdParameters(getParameters().getId());
Line 20: params.setFiltered(getParameters().isFiltered());
Line 21:
Line 22: VdcQueryReturnValue hostsReturnValue =
Backend.getInstance().RunQuery(VdcQueryType.GetHostsByClusterId, params);
I would say it is better to use encapsulated logic than directly touching the
DB.
Line 23: @SuppressWarnings("unchecked")
Line 24: List<VDS> hosts = (List<VDS>)
hostsReturnValue.getReturnValue();
Line 25:
getQueryReturnValue().setReturnValue(isConsoleAddressPartiallyOverridden(hosts));
Line 26: }
Line 25:
getQueryReturnValue().setReturnValue(isConsoleAddressPartiallyOverridden(hosts));
Line 26: }
Line 27:
Line 28: boolean isConsoleAddressPartiallyOverridden(List<VDS> hosts) {
Line 29:
I have added a TODO to consider :)
I don't really like the idea of having this kind of logic in SP where you can
not have any unit tests, you are directly dependent on the DB structure and the
commands are here not to provide business logic but to be a bridge to DB...
Line 30: if (hosts == null) {
Line 31: return false;
Line 32: }
Line 33:
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetHostsInClusterPartiallyOverriddenParameters.java
Line 1: package org.ovirt.engine.core.common.queries;
Line 2:
Line 3: import org.ovirt.engine.core.compat.Guid;
Line 4:
Line 5: public class GetHostsInClusterPartiallyOverriddenParameters extends
VdcQueryParametersBase {
you are right, done
Line 6:
Line 7: private static final long serialVersionUID = -2931996134200329010L;
Line 8:
Line 9: private Guid clusterId = new Guid();
--
To view, visit http://gerrit.ovirt.org/11375
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1955c35a3739680f6f80c9e8b29a21a14c5b8b7a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: Tomas Jelinek <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches