Add netcfg for INT
Use network config subsystem to handle such configs
Change-Id: I8ec14d31c30e3d1d8cd2c703d8db5535bb8b5cd4
(cherry picked from commit 0f1ffd162f0a8fd2a12ac26f12b54519064c4a3b)
diff --git a/apps/inbandtelemetry/app/src/main/java/org/onosproject/inbandtelemetry/app/ui/IntAppUiMessageHandler.java b/apps/inbandtelemetry/app/src/main/java/org/onosproject/inbandtelemetry/app/ui/IntAppUiMessageHandler.java
index 34e8fb4..9d1fb90 100644
--- a/apps/inbandtelemetry/app/src/main/java/org/onosproject/inbandtelemetry/app/ui/IntAppUiMessageHandler.java
+++ b/apps/inbandtelemetry/app/src/main/java/org/onosproject/inbandtelemetry/app/ui/IntAppUiMessageHandler.java
@@ -20,14 +20,11 @@
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.onlab.packet.Ip4Address;
import org.onlab.packet.Ip4Prefix;
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.MacAddress;
import org.onlab.packet.TpPort;
import org.onosproject.inbandtelemetry.api.IntIntent;
import org.onosproject.inbandtelemetry.api.IntIntentId;
import org.onosproject.net.behaviour.inbandtelemetry.IntMetadataType;
import org.onosproject.inbandtelemetry.api.IntService;
-import org.onosproject.net.behaviour.inbandtelemetry.IntDeviceConfig;
import org.onosproject.net.flow.DefaultTrafficSelector;
import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.ui.RequestHandler;
@@ -43,8 +40,6 @@
private static final String INT_INTENT_ADD_REQUEST = "intIntentAddRequest";
private static final String INT_INTENT_DEL_REQUEST = "intIntentDelRequest";
- private static final String INT_CONFIG_ADD_REQUEST = "intConfigAddRequest";
-// private static final String INT_CONFIG_DEL_REQUEST = "intConfigDelRequest";
private final Logger log = LoggerFactory.getLogger(getClass());
@@ -54,46 +49,10 @@
protected Collection<RequestHandler> createRequestHandlers() {
return ImmutableSet.of(
new IntIntentAddRequestHandler(),
- new IntIntentDelRequestHandler(),
- new IntConfigAddRequestHandler()
- //new intConfigDelRequestHandler()
+ new IntIntentDelRequestHandler()
);
}
- private final class IntConfigAddRequestHandler extends RequestHandler {
- private IntConfigAddRequestHandler() {
- super(INT_CONFIG_ADD_REQUEST);
- }
-
- @Override
- public void process(ObjectNode payload) {
- log.info("intConfigAddRequest: {}", payload);
-
- intService = get(IntService.class);
- IntDeviceConfig.Builder builder = IntDeviceConfig.builder();
-
- if (payload.get("collectorIp") != null) {
- builder.withCollectorIp(IpAddress.valueOf(payload.get("collectorIp").asText()));
- } else {
- builder.withCollectorIp(IpAddress.valueOf("127.0.0.1"));
- }
-
- if (payload.get("collectorPort") != null) {
- builder.withCollectorPort(TpPort.tpPort(
- payload.get("collectorPort").asInt()));
- } else {
- builder.withCollectorPort(TpPort.tpPort(1234));
- }
-
- builder.enabled(true)
- .withSinkIp(IpAddress.valueOf("10.192.19.180"))
- .withSinkMac(MacAddress.NONE)
- .withCollectorNextHopMac(MacAddress.BROADCAST);
-
- intService.setConfig(builder.build());
- }
- }
-
private final class IntIntentDelRequestHandler extends RequestHandler {
private IntIntentDelRequestHandler() {
super(INT_INTENT_DEL_REQUEST);