Implement IntentInstallers
IntentInstallers for:
- PathFlowIntent
- SingleDstTreeFlowIntent
- SingleSrcTreeFlowIntent
This resolves ONOS-1884, ONOS-1885, and ONOS-1886.
Change-Id: Ie0eac4bab9a2898b582edf2e4291498f0a583d71
diff --git a/src/main/java/net/onrc/onos/core/newintent/SingleDstTreeFlowIntentInstaller.java b/src/main/java/net/onrc/onos/core/newintent/SingleDstTreeFlowIntentInstaller.java
new file mode 100644
index 0000000..f79237b
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/newintent/SingleDstTreeFlowIntentInstaller.java
@@ -0,0 +1,31 @@
+package net.onrc.onos.core.newintent;
+
+import net.onrc.onos.api.flowmanager.FlowManagerService;
+
+/**
+ * An intent installer for {@link SingleDstTreeFlowIntent}.
+ */
+public class SingleDstTreeFlowIntentInstaller
+ extends AbstractIntentInstaller<SingleDstTreeFlowIntent> {
+
+ /**
+ * Constructs an intent installer for {@link SingleDstTreeFlowIntent} with
+ * the specified Flow Manager service, which is used in this installer.
+ *
+ * @param flowManager Flow Manager service, which is used
+ * to install/remove an intent
+ */
+ public SingleDstTreeFlowIntentInstaller(FlowManagerService flowManager) {
+ super(flowManager);
+ }
+
+ @Override
+ public void install(SingleDstTreeFlowIntent intent) {
+ installFlow(intent, intent.getTree());
+ }
+
+ @Override
+ public void remove(SingleDstTreeFlowIntent intent) {
+ removeFlow(intent, intent.getTree());
+ }
+}