mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-23 21:31:00 +02:00
ONOS-4635:Fix Issue with add flows using flowobjective-forward REST API with incorrect priority
Change-Id: I929918b61aec83c2dc2cdca456dfdb1d2d736c01
This commit is contained in:
parent
c96e25824a
commit
3684dc7c5c
@ -272,6 +272,8 @@ public final class DefaultFilteringObjective implements FilteringObjective {
|
|||||||
checkNotNull(type, "Must have a type.");
|
checkNotNull(type, "Must have a type.");
|
||||||
checkArgument(!conditions.isEmpty(), "Must have at least one condition.");
|
checkArgument(!conditions.isEmpty(), "Must have at least one condition.");
|
||||||
checkNotNull(appId, "Must supply an application id");
|
checkNotNull(appId, "Must supply an application id");
|
||||||
|
checkArgument(priority <= MAX_PRIORITY && priority >= MIN_PRIORITY, "Priority " +
|
||||||
|
"out of range");
|
||||||
|
|
||||||
return new DefaultFilteringObjective(this);
|
return new DefaultFilteringObjective(this);
|
||||||
}
|
}
|
||||||
|
@ -283,6 +283,8 @@ public final class DefaultForwardingObjective implements ForwardingObjective {
|
|||||||
checkArgument(nextId != null || treatment != null, "Must supply at " +
|
checkArgument(nextId != null || treatment != null, "Must supply at " +
|
||||||
"least a treatment and/or a nextId");
|
"least a treatment and/or a nextId");
|
||||||
checkNotNull(appId, "Must supply an application id");
|
checkNotNull(appId, "Must supply an application id");
|
||||||
|
checkArgument(priority <= MAX_PRIORITY && priority >= MIN_PRIORITY, "Priority " +
|
||||||
|
"out of range");
|
||||||
op = Operation.ADD;
|
op = Operation.ADD;
|
||||||
return new DefaultForwardingObjective(this);
|
return new DefaultForwardingObjective(this);
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,8 @@ public interface Objective {
|
|||||||
boolean DEFAULT_PERMANENT = true;
|
boolean DEFAULT_PERMANENT = true;
|
||||||
int DEFAULT_TIMEOUT = 0;
|
int DEFAULT_TIMEOUT = 0;
|
||||||
int DEFAULT_PRIORITY = 32768;
|
int DEFAULT_PRIORITY = 32768;
|
||||||
|
int MIN_PRIORITY = 0;
|
||||||
|
int MAX_PRIORITY = 65535;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of operation.
|
* Type of operation.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user