Omer Frenkel has posted comments on this change.

Change subject: engine: watchdog - DB and logic changes
......................................................................


Patch Set 20: (7 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractVmWatchdogCommand.java
Line 50: 
Line 51:     @Override
Line 52:     protected boolean canDoAction() {
Line 53:         if (getParameters().getId() == null || !entityExists()) {
Line 54:             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND);
the message is specific to vm...
Line 55:         }
Line 56:         return true;
Line 57:     }
Line 58: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
Line 523:     }
Line 524: 
Line 525:     protected void addVmWatchdog() {
Line 526:         VmWatchdog vmWatchdog = getParameters().getWatchdog();
Line 527:         if(vmWatchdog != null) {
format
Line 528:             WatchdogParameters parameters = new WatchdogParameters();
Line 529:             parameters.setId(getParameters().getVmId());
Line 530:             parameters.setAction(vmWatchdog.getAction());
Line 531:             parameters.setModel(vmWatchdog.getModel());


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetWatchdogQuery.java
Line 19: 
Line 20:     protected void executeQueryCommand() {
Line 21:         final List<VmDevice> vmDevices = 
getVmDeviceDAO().getVmDeviceByVmIdAndType(getParameters().getId(),
Line 22:                 VmDeviceType.WATCHDOG.getName());
Line 23:         if(vmDevices != null && !vmDevices.isEmpty()) {
format
Line 24:             VmDevice device = vmDevices.get(0);
Line 25:             VmWatchdog watchdog = new VmWatchdog();
Line 26:             watchdog.setAction(VmWatchdogAction.getByName((String) 
device.getSpecParams().get("action")));
Line 27:             watchdog.setModel(VmWatchdogType.getByName((String) 
device.getSpecParams().get("model")));


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
Line 93:     }
Line 94: 
Line 95:     private void updateWatchdog() {
Line 96:         //do not update if this flag is not set
Line 97:         if(getParameters().isUpdateWatchdog()) {
format
Line 98:             VdcQueryReturnValue query = 
getBackend().RunQuery(VdcQueryType.GetWatchdog, new 
IdQueryParameters(getParameters().getVmId()));
Line 99:             @SuppressWarnings("unchecked")
Line 100:             List<VmWatchdog> watchdogs = (List<VmWatchdog>) 
query.getReturnValue();
Line 101:             if(watchdogs.isEmpty()) {


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java
Line 247:     TestProviderConnectivity(1603, false, QuotaDependency.NONE),
Line 248: 
Line 249:     AddWatchdog(1700, ActionGroup.CREATE_VM, QuotaDependency.NONE),
Line 250:     UpdateWatchdog(1701, ActionGroup.CREATE_VM, QuotaDependency.NONE),
Line 251:     RemoveWatchdog(1702, ActionGroup.CREATE_VM, QuotaDependency.NONE),
probably should be EDIT_VM_PROPERTIES ...
Line 252:     ;
Line 253: 
Line 254: 
Line 255:     private int intValue;


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmWatchdogAction.java
Line 4:     None,
Line 5:     Reset,
Line 6:     Poweroff,
Line 7:     Dump,
Line 8:     Pause;
java conventions for enum members should be in upper case as they are constants
Line 9: 
Line 10:     public static VmWatchdogAction getByName(String name) {
Line 11:         if (name == null || name.length() == 0) {
Line 12:             return null;


....................................................
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/BaseDAODbFacade.java
Line 99:      * @return a Long or null
Line 100:      * @throws SQLException
Line 101:      */
Line 102:     final static Long getLong(ResultSet resultSet, String columnName) 
throws SQLException {
Line 103:         if(resultSet.getLong(columnName) == 0 && resultSet.wasNull()) 
{
format
Line 104:             return null;
Line 105:         } else {
Line 106:             return resultSet.getLong(columnName);
Line 107:         }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I813a6f97e23008d15446285998a4e9b50b456040
Gerrit-PatchSet: 20
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <lhorn...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Laszlo Hornyak <lhorn...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to