Skeletons for Intent-runtime, Flow-manager and Match-action modules.
This task is a part of ONOS-1395.
(Sub-tasks: ONOS-1397, ONOS-1398, ONOS-1400)
Change-Id: I30064f658b6c193aee8419079dad380163364475
diff --git a/src/main/java/net/onrc/onos/api/intent/IIntentRuntimeService.java b/src/main/java/net/onrc/onos/api/intent/IIntentRuntimeService.java
new file mode 100644
index 0000000..5e9ed52
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/intent/IIntentRuntimeService.java
@@ -0,0 +1,112 @@
+package net.onrc.onos.api.intent;
+
+import java.util.Collection;
+import java.util.EventListener;
+
+import net.onrc.onos.api.batchoperation.BatchOperation;
+import net.onrc.onos.api.flowmanager.ConflictDetectionPolicy;
+import net.onrc.onos.api.flowmanager.IFlow;
+
+/**
+ * An interface class for the Intent-Runtime Service. The role of the
+ * Intent-Runtime Service is to manage a set of IFlow objects based on the
+ * specified Intent objects.
+ * <p>
+ * It compiles accepted Intents to IFlow objects by allocating resources and
+ * calculating paths based on the constrains described in the Intents, and
+ * executes installation/uninstallation of the IFlow objects using FlowManager
+ * Service.
+ */
+public interface IIntentRuntimeService {
+ /**
+ * Adds specified intent.
+ *
+ * @param intent Intent to be added.
+ * @return true if succeeded, false otherwise.
+ */
+ boolean addIntent(Intent intent);
+
+ /**
+ * Removes specified intent.
+ *
+ * @param id ID of the intent to be removed.
+ * @return true if succeeded, false otherwise.
+ */
+ boolean removeIntent(String id);
+
+ /**
+ * Overwrites existing intent by new specified intent.
+ *
+ * @param id ID of the existing intent to be overwritten.
+ * @param intent The new intent to be added.
+ * @return true if succeeded, false otherwise.
+ */
+ boolean updateIntent(String id, Intent intent);
+
+ /**
+ * Gets specific intent.
+ *
+ * @param id ID of the intent should be retrieved
+ * @return Intent if it exists, null otherwise.
+ */
+ Intent getIntent(String id);
+
+ /**
+ * Gets all intents.
+ *
+ * @return collection of intents.
+ */
+ Collection<Intent> getIntents();
+
+ /**
+ * Executes batch operation of intents.
+ *
+ * @param ops BatchOperations to be executed.
+ * @return true if succeeded, false otherwise.
+ */
+ boolean executeBatch(BatchOperation<Intent> ops);
+
+ /**
+ * Gets IFlow objects managed by the specified intent.
+ *
+ * @param intentId ID of the target Intent.
+ * @return Collection of IFlow objects if exists, null otherwise.
+ */
+ Collection<IFlow> getFlows(String intentId);
+
+ /**
+ * Gets Intent object which manages the specified IFlow object.
+ *
+ * @param flowId ID of the target IFlow object.
+ * @return Intent which manages the specified IFlow object, null otherwise.
+ */
+ Intent getIntentByFlow(String flowId);
+
+ /**
+ * Sets a conflict detection policy.
+ *
+ * @param policy ConflictDetectionPolicy object to be set.
+ */
+ void setConflictDetectionPolicy(ConflictDetectionPolicy policy);
+
+ /**
+ * Gets the conflict detection policy.
+ *
+ * @return ConflictDetectionPolicy object being applied currently.
+ */
+ ConflictDetectionPolicy getConflictDetectionPolicy();
+
+ /**
+ * Adds event listener to this service.
+ *
+ * @param listener EventListener to be added.
+ */
+ void addEventListener(EventListener listener);
+
+ /**
+ * Removes event listener from this service.
+ *
+ * @param listener EventListener to be removed.
+ */
+ void removeEventListener(EventListener listener);
+}