+ /**
+ * Validates the vlan number
+ *
+ * @return the result of the check as Status object
+ */
+ private Status validateVlan() {
+ if (dlVlan != null) {
+ short vlanId = 0;
+ try {
+ vlanId = Short.parseShort(dlVlan);
+ } catch (NumberFormatException e) {
+ return new Status(StatusCode.BADREQUEST, "Invalid vlan id");
+ }
+ if (vlanId < 0 || vlanId > 0xfff) {
+ return new Status(StatusCode.BADREQUEST, "Invalid vlan id");
+ }
+ }
+ return new Status(StatusCode.SUCCESS);
+ }
+