Allon Mureinik has uploaded a new change for review.

Change subject: core: Validate NfsTimeo and NfsRetarns
......................................................................

core: Validate NfsTimeo and NfsRetarns

Added @Max and @Min validations on nfsTimeo and nfsRetrans in order to
offer a better value validation instead of just failing the command in
VDSM side if a negative value is given.

Note: This patch just improves the error handling, it does not fix the
underlying issue described in the BZ, which should be handled by the
REST-API/JAXB layer.

Related-to: https://bugzilla.redhat.com/962442
Change-Id: I15d35b2547bb36d17e29c90a05854fe6f897d5d2
Signed-off-by: Allon Mureinik <amure...@redhat.com>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageServerConnections.java
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/82/17182/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageServerConnections.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageServerConnections.java
index 57f65b9..9044d34 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageServerConnections.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageServerConnections.java
@@ -1,6 +1,8 @@
 package org.ovirt.engine.core.common.businessentities;
 
 import java.io.Serializable;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
 
 public class StorageServerConnections implements Serializable {
     private static final long serialVersionUID = 5444293590307760809L;
@@ -158,6 +160,8 @@
         this.nfsVersion = nfsVersion;
     }
 
+    @Min(0)
+    @Max(Short.MAX_VALUE)
     private Short nfsTimeo;
 
     public Short getNfsTimeo() {
@@ -168,6 +172,8 @@
         this.nfsTimeo = nfsTimeo;
     }
 
+    @Min(0)
+    @Max(Short.MAX_VALUE)
     private Short nfsRetrans;
 
     @Override


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I15d35b2547bb36d17e29c90a05854fe6f897d5d2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amure...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to