samuel
Committed by Gerrit Code Review

[ONOS-2550]Fix validation incorrect information bugs of TunnelManager

Change-Id: I9bb7d0a7513d0c0b2674722e1107d4ec1f97f3d0
......@@ -80,11 +80,11 @@ public class LabelResourceManager
LabelResourceId endLabel) {
checkNotNull(deviceId, "deviceId is not null");
checkNotNull(beginLabel, "beginLabel is not null");
checkNotNull(endLabel, "beginLabel is not null");
checkNotNull(endLabel, "endLabel is not null");
checkArgument(beginLabel.labelId() >= 0 || endLabel.labelId() >= 0,
"The value of beginLabel and the value of endLabel must be both positive number.");
checkArgument(beginLabel.labelId() <= endLabel.labelId(),
"The value of endLabel must be greater than the value of endLabel.");
checkArgument(beginLabel.labelId() < endLabel.labelId(),
"The value of endLabel must be greater than the value of beginLabel.");
return store.createDevicePool(deviceId, beginLabel, endLabel);
}
......@@ -92,11 +92,11 @@ public class LabelResourceManager
public boolean createGlobalPool(LabelResourceId beginLabel,
LabelResourceId endLabel) {
checkNotNull(beginLabel, "beginLabel is not null");
checkNotNull(endLabel, "beginLabel is not null");
checkNotNull(endLabel, "endLabel is not null");
checkArgument(beginLabel.labelId() >= 0 && endLabel.labelId() >= 0,
"The value of beginLabel and the value of endLabel must be both positive number.");
checkArgument(beginLabel.labelId() <= endLabel.labelId(),
"The value of endLabel must be greater than the value of endLabel.");
checkArgument(beginLabel.labelId() < endLabel.labelId(),
"The value of endLabel must be greater than the value of beginLabel.");
return store.createGlobalPool(beginLabel, endLabel);
}
......