- Matcher n = Pattern.compile("(?:(\\d+))").matcher(t);
- if (n.matches()) {
- if (n.group(1) != null) {
- Short port = Short.parseShort(n.group(1));
- if (isPortValid(sw, port) == false) {
- String msg = String.format("Output port %d is not valid for this switch", port);
- if (!containerName.equals(GlobalConstants.DEFAULT.toString())) {
- msg += " in Container " + containerName;
- }
- return new Status(StatusCode.BADREQUEST, msg);
+ if (t != null) {
+ if (!isPortValid(sw, t)) {
+ String msg = String.format("Output port %s is not valid for this switch", t);
+ if (!containerName.equals(GlobalConstants.DEFAULT.toString())) {
+ msg += " in Container " + containerName;
+ }
+ return new Status(StatusCode.BADREQUEST, msg);
+ }
+ }
+ }
+ continue;
+ }
+ // check enqueue
+ sstr = Pattern.compile("ENQUEUE=(.*)").matcher(actiongrp);
+ if (sstr.matches()) {
+ for (String t : sstr.group(1).split(",")) {
+ if (t != null) {
+ String port = t.split(":")[0];
+ if (!isPortValid(sw, port)) {
+ String msg = String.format("Output port %d is not valid for this switch", port);
+ if (!containerName.equals(GlobalConstants.DEFAULT.toString())) {
+ msg += " in Container " + containerName;