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/batchoperation/AddOperation.java b/src/main/java/net/onrc/onos/api/batchoperation/AddOperation.java
new file mode 100644
index 0000000..556a0cb
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/batchoperation/AddOperation.java
@@ -0,0 +1,31 @@
+package net.onrc.onos.api.batchoperation;
+
+/**
+ * An add-operation entry of a batch operation.
+ */
+public class AddOperation implements BatchOperationEntry {
+ protected IBatchOperationTarget target;
+
+ /**
+ * Creates a add-operation with specified target.
+ *
+ * @param target The target object to be assigned to this add-operation.
+ */
+ public AddOperation(IBatchOperationTarget target) {
+ this.target = target;
+ }
+
+ @Override
+ public BatchOperator getOperator() {
+ return BatchOperator.ADD;
+ }
+
+ /**
+ * Gets the target object which assigned to this add-operation.
+ *
+ * @return The target object which assigned to this add-operation.
+ */
+ public IBatchOperationTarget getTarget() {
+ return target;
+ }
+}
diff --git a/src/main/java/net/onrc/onos/api/batchoperation/BatchOperation.java b/src/main/java/net/onrc/onos/api/batchoperation/BatchOperation.java
new file mode 100644
index 0000000..b51c8eb
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/batchoperation/BatchOperation.java
@@ -0,0 +1,69 @@
+package net.onrc.onos.api.batchoperation;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * A list of BatchOperationEntry.
+ *
+ * @param <T> IBatchOperationTarget. This should be Intent, IFlow, or
+ * MatchAction.
+ */
+public class BatchOperation<T extends IBatchOperationTarget> {
+ private List<BatchOperationEntry> ops;
+
+ /**
+ * Constructor.
+ */
+ public BatchOperation() {
+ ops = new LinkedList<BatchOperationEntry>();
+ }
+
+ /**
+ * Removes all operations maintained in this object.
+ */
+ public void clear() {
+ ops.clear();
+ }
+
+ /**
+ * Returns an iterator over the operations in this object.
+ *
+ * @return an iterator over the operations in this object.
+ */
+ public Iterator<BatchOperationEntry> iterator() {
+ return ops.iterator();
+ }
+
+ /**
+ * Adds an add-operation.
+ *
+ * @param intent Intent to be added.
+ * @return true if succeeded, false otherwise.
+ */
+ public boolean addAddOperation(T target) {
+ return ops.add(new AddOperation(target));
+ }
+
+ /**
+ * Adds a remove-operation.
+ *
+ * @param id ID of the target to be removed.
+ * @return true if succeeded, false otherwise.
+ */
+ public boolean addRemoveOperation(String id) {
+ return ops.add(new RemoveOperation(id));
+ }
+
+ /**
+ * Adds a update-operation.
+ *
+ * @param oldtargetId ID of the existing target to be overwritten.
+ * @param newTarget The new target to be added.
+ * @return true if succeeded, false otherwise.
+ */
+ public boolean addUpdateOperation(String oldTargetId, T newTarget) {
+ return ops.add(new UpdateOperation(oldTargetId, newTarget));
+ }
+}
diff --git a/src/main/java/net/onrc/onos/api/batchoperation/BatchOperationEntry.java b/src/main/java/net/onrc/onos/api/batchoperation/BatchOperationEntry.java
new file mode 100644
index 0000000..fce31d1
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/batchoperation/BatchOperationEntry.java
@@ -0,0 +1,16 @@
+package net.onrc.onos.api.batchoperation;
+
+/**
+ * An interface for batch operation entry classes.
+ * <p>
+ * This is the interface to AddOperation, UpdateOperation and RemoveOperation
+ * classes which are the entry maintained by BatchOperation.
+ */
+public interface BatchOperationEntry {
+ /**
+ * Gets the BatchOperator of this operation.
+ *
+ * @return The BatchOperator of this operation.
+ */
+ public BatchOperator getOperator();
+}
diff --git a/src/main/java/net/onrc/onos/api/batchoperation/BatchOperator.java b/src/main/java/net/onrc/onos/api/batchoperation/BatchOperator.java
new file mode 100644
index 0000000..00ab908
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/batchoperation/BatchOperator.java
@@ -0,0 +1,26 @@
+package net.onrc.onos.api.batchoperation;
+
+/**
+ * Operators used by BatchOperation classes.
+ */
+public enum BatchOperator {
+ /**
+ * Adds new intent.
+ */
+ ADD,
+
+ /**
+ * Removes existing intent specified by intent ID.
+ */
+ REMOVE,
+
+ /**
+ * Overwrites existing intent using new intent.
+ */
+ UPDATE,
+
+ /**
+ * Unknown type.
+ */
+ UNKNOWN,
+}
diff --git a/src/main/java/net/onrc/onos/api/batchoperation/IBatchOperationTarget.java b/src/main/java/net/onrc/onos/api/batchoperation/IBatchOperationTarget.java
new file mode 100644
index 0000000..d08528f
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/batchoperation/IBatchOperationTarget.java
@@ -0,0 +1,13 @@
+package net.onrc.onos.api.batchoperation;
+
+/**
+ * An interface of the class which is assigned to BatchOperation.
+ */
+public interface IBatchOperationTarget {
+ /**
+ * Gets ID of the object.
+ *
+ * @return ID of the object.
+ */
+ public String getId();
+}
diff --git a/src/main/java/net/onrc/onos/api/batchoperation/RemoveOperation.java b/src/main/java/net/onrc/onos/api/batchoperation/RemoveOperation.java
new file mode 100644
index 0000000..c86e427
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/batchoperation/RemoveOperation.java
@@ -0,0 +1,32 @@
+package net.onrc.onos.api.batchoperation;
+
+/**
+ * A remove-operation entry of a batch operation.
+ */
+public class RemoveOperation implements BatchOperationEntry {
+ protected String targetId;
+
+ /**
+ * Creates a remove-operation with specified target.
+ *
+ * @param targetId The target object ID to be assigned to this
+ * remove-operation.
+ */
+ public RemoveOperation(String targetId) {
+ this.targetId = targetId;
+ }
+
+ @Override
+ public BatchOperator getOperator() {
+ return BatchOperator.REMOVE;
+ }
+
+ /**
+ * Gets the target ID to be removed.
+ *
+ * @return The target ID to be removed.
+ */
+ public String getTargetId() {
+ return targetId;
+ }
+}
diff --git a/src/main/java/net/onrc/onos/api/batchoperation/UpdateOperation.java b/src/main/java/net/onrc/onos/api/batchoperation/UpdateOperation.java
new file mode 100644
index 0000000..45772ce
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/batchoperation/UpdateOperation.java
@@ -0,0 +1,44 @@
+package net.onrc.onos.api.batchoperation;
+
+/**
+ * An update-operation entry of a batch operation.
+ */
+public class UpdateOperation implements BatchOperationEntry {
+ public String oldTargetId;
+ public IBatchOperationTarget newTarget;
+
+ /**
+ * Creates a update-operation with specified targets.
+ *
+ * @param oldTargetId The ID to be overwritten.
+ * @param newTarget The new target to be added.
+ */
+ public UpdateOperation(String oldTargetId, IBatchOperationTarget newTarget) {
+ this.oldTargetId = oldTargetId;
+ this.newTarget = newTarget;
+ }
+
+ @Override
+ public BatchOperator getOperator() {
+ return BatchOperator.UPDATE;
+ }
+
+ /**
+ * Gets the old target ID to be overwritten.
+ *
+ * @return The old target ID to be overwritten
+ */
+ public String getOldTargetId() {
+ return oldTargetId;
+ }
+
+ /**
+ * Gets the new target object to be added.
+ *
+ * @return The new target object to be added.
+ */
+ public IBatchOperationTarget getNewTarget() {
+ return newTarget;
+ }
+
+}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/ConflictDetectionPolicy.java b/src/main/java/net/onrc/onos/api/flowmanager/ConflictDetectionPolicy.java
new file mode 100644
index 0000000..6d54450
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/flowmanager/ConflictDetectionPolicy.java
@@ -0,0 +1,21 @@
+package net.onrc.onos.api.flowmanager;
+
+/**
+ * Conflict detection policies for the flow manager.
+ */
+public enum ConflictDetectionPolicy {
+ /**
+ * Do not allow overlap flow-space on any ingress port.
+ */
+ STRICT,
+
+ /**
+ * Keep control of packets flowing through each specified path, tree, etc.
+ */
+ LOOSE,
+
+ /**
+ * No limitation (accepts all, handles by priority).
+ */
+ FREE
+}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/FlowLink.java b/src/main/java/net/onrc/onos/api/flowmanager/FlowLink.java
new file mode 100644
index 0000000..474ac75
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/flowmanager/FlowLink.java
@@ -0,0 +1,102 @@
+package net.onrc.onos.api.flowmanager;
+
+import net.onrc.onos.core.util.Dpid;
+import net.onrc.onos.core.util.PortNumber;
+import net.onrc.onos.core.util.SwitchPort;
+
+/**
+ * A link representation used by IFlow objects.
+ * <p>
+ * TODO: Should lambda, bandwidth, tag, etc. be defined in this FlowLink, Path,
+ * Tree or IFlow? We have to define it.
+ */
+public class FlowLink {
+ protected SwitchPort srcSwitchPort;
+ protected SwitchPort dstSwitchPort;
+
+ /**
+ * Creates new FlowLink object using source/destination switch port pair.
+ *
+ * @param src The source switch port.
+ * @param dst The destination switch port.
+ */
+ public FlowLink(SwitchPort src, SwitchPort dst) {
+ this.srcSwitchPort = src;
+ this.dstSwitchPort = dst;
+ }
+
+ /**
+ * Creates new FlowLink object using DPID and port number pairs at
+ * source/destination switches.
+ *
+ * @param srcDpid The source switch DPID.
+ * @param srcPortNumber The source port number at the source switch.
+ * @param dstDpid The destination switch DPID.
+ * @param dstPortNumber The destination port number at the destination
+ * switch.
+ */
+ public FlowLink(Dpid srcDpid, PortNumber srcPortNumber,
+ Dpid dstDpid, PortNumber dstPortNumber) {
+ this.srcSwitchPort = new SwitchPort(srcDpid, srcPortNumber);
+ this.dstSwitchPort = new SwitchPort(dstDpid, dstPortNumber);
+ }
+
+ /**
+ * Gets the source switch port.
+ *
+ * @return The source switch port.
+ */
+ public SwitchPort getSrcSwitchPort() {
+ return srcSwitchPort;
+ }
+
+ /**
+ * Gets the source switch DPID.
+ *
+ * @return The source switch DPID.
+ */
+ public Dpid getSrcDpid() {
+ return srcSwitchPort.dpid();
+ }
+
+ /**
+ * Gets the source port number at the source switch.
+ *
+ * @return The source port number at the source switch.
+ */
+ public PortNumber getSrcPortNumber() {
+ return srcSwitchPort.port();
+ }
+
+ /**
+ * Gets the destination switch port.
+ *
+ * @return The destination switch port.
+ */
+ public SwitchPort getDstSwitchPort() {
+ return dstSwitchPort;
+ }
+
+ /**
+ * Gets the destination switch DPID.
+ *
+ * @return The destination switch DPID.
+ */
+ public Dpid getDstDpid() {
+ return dstSwitchPort.dpid();
+ }
+
+ /**
+ * Gets the destination port number at the destination switch.
+ *
+ * @return The destination port number at the destination switch.
+ */
+ public PortNumber getDstPortNumber() {
+ return dstSwitchPort.port();
+ }
+
+ @Override
+ public String toString() {
+ return srcSwitchPort + "-->" + dstSwitchPort;
+ }
+}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/FlowLinks.java b/src/main/java/net/onrc/onos/api/flowmanager/FlowLinks.java
new file mode 100644
index 0000000..3d2d771
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/flowmanager/FlowLinks.java
@@ -0,0 +1,139 @@
+package net.onrc.onos.api.flowmanager;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+
+/**
+ * A list of FlowLink objects.
+ */
+public class FlowLinks implements List<FlowLink> {
+ protected final List<FlowLink> links = new LinkedList<FlowLink>();
+
+ @Override
+ public int size() {
+ return links.size();
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return links.isEmpty();
+ }
+
+ @Override
+ public boolean contains(Object o) {
+ return links.contains(o);
+ }
+
+ @Override
+ public Iterator<FlowLink> iterator() {
+ return links.iterator();
+ }
+
+ @Override
+ public Object[] toArray() {
+ return links.toArray();
+ }
+
+ @Override
+ public <T> T[] toArray(T[] a) {
+ return links.toArray(a);
+ }
+
+ @Override
+ public boolean add(FlowLink e) {
+ return links.add(e);
+ }
+
+ @Override
+ public boolean remove(Object o) {
+ return links.remove(o);
+ }
+
+ @Override
+ public boolean containsAll(Collection<?> c) {
+ return links.containsAll(c);
+ }
+
+ @Override
+ public boolean addAll(Collection<? extends FlowLink> c) {
+ return links.addAll(c);
+ }
+
+ @Override
+ public boolean addAll(int index, Collection<? extends FlowLink> c) {
+ return links.addAll(index, c);
+ }
+
+ @Override
+ public boolean removeAll(Collection<?> c) {
+ return links.removeAll(c);
+ }
+
+ @Override
+ public boolean retainAll(Collection<?> c) {
+ return links.retainAll(c);
+ }
+
+ @Override
+ public void clear() {
+ links.clear();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return links.equals(o);
+ }
+
+ @Override
+ public int hashCode() {
+ return links.hashCode();
+ }
+
+ @Override
+ public FlowLink get(int index) {
+ return links.get(index);
+ }
+
+ @Override
+ public FlowLink set(int index, FlowLink element) {
+ return links.set(index, element);
+ }
+
+ @Override
+ public void add(int index, FlowLink element) {
+ links.add(index, element);
+ }
+
+ @Override
+ public FlowLink remove(int index) {
+ return links.remove(index);
+ }
+
+ @Override
+ public int indexOf(Object o) {
+ return links.indexOf(o);
+ }
+
+ @Override
+ public int lastIndexOf(Object o) {
+ return links.lastIndexOf(o);
+ }
+
+ @Override
+ public ListIterator<FlowLink> listIterator() {
+ return links.listIterator();
+ }
+
+ @Override
+ public ListIterator<FlowLink> listIterator(int index) {
+ return links.listIterator(index);
+ }
+
+ @Override
+ public List<FlowLink> subList(int fromIndex, int toIndex) {
+ return links.subList(fromIndex, toIndex);
+ }
+}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/IFlow.java b/src/main/java/net/onrc/onos/api/flowmanager/IFlow.java
new file mode 100644
index 0000000..66f116a
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/flowmanager/IFlow.java
@@ -0,0 +1,38 @@
+package net.onrc.onos.api.flowmanager;
+
+import net.onrc.onos.api.batchoperation.IBatchOperationTarget;
+import net.onrc.onos.core.matchaction.MatchActionPlan;
+import net.onrc.onos.core.matchaction.match.IMatch;
+
+/**
+ * An interface class to define flow object which is managed by
+ * FlowManagerModule.
+ * <p>
+ * The flow objects (eg. path, tree, disjoint-paths, etc.) must implement this
+ * interface.
+ */
+public interface IFlow extends IBatchOperationTarget {
+ /**
+ * Gets ID for this flow object.
+ *
+ * @return ID for this object.
+ */
+ @Override
+ public String getId();
+
+ /**
+ * Gets traffic filter for this flow object.
+ *
+ * @return a traffic filter for this flow object.
+ */
+ public IMatch getMatch();
+
+ /**
+ * Compiles this object to MatchAction plan.
+ * <p>
+ * This method is called by FlowManagerModule to create MatchAction plans.
+ *
+ * @return a MatchAction plan of this flow object.
+ */
+ public MatchActionPlan compile();
+}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/IFlowManagerService.java b/src/main/java/net/onrc/onos/api/flowmanager/IFlowManagerService.java
new file mode 100644
index 0000000..edd3c85
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/flowmanager/IFlowManagerService.java
@@ -0,0 +1,97 @@
+package net.onrc.onos.api.flowmanager;
+
+import java.util.Collection;
+import java.util.EventListener;
+
+import net.onrc.onos.api.batchoperation.BatchOperation;
+
+/**
+ * An interface class for flow manager. The role of the flow manager is to
+ * manage a set of Match-Action entries based on the specified IFlow objects.
+ * <p>
+ * It compiles accepted IFlow objects to Match-Action entries by calculating the
+ * match-action operation phases and allocating resources based on the
+ * constrains described in the IFlow objects, and executes calculated phases
+ * using Match-Action Service.
+ * <p>
+ * TODO: add more getter with filter for IFlow objects.
+ */
+public interface IFlowManagerService {
+ /**
+ * Adds IFlow object, calculates match-action plan and executes it.
+ *
+ * @param flow IFlow object to be added.
+ * @return true if succeeded, false otherwise.
+ */
+ boolean addFlow(IFlow flow);
+
+ /**
+ * Removes IFlow object, calculates match-action plan and executes it.
+ *
+ * @param id ID for IFlow object to be removed.
+ * @return true if succeeded, false otherwise.
+ */
+ boolean removeFlow(String id);
+
+ /**
+ * Updates IFlow object, calculates match-action plan and executes it.
+ * <p>
+ * The IFlow object having the ID which is the same to the ID of the IFlow
+ * object specified by the parameter will be updated.
+ *
+ * @param flow new IFlow object for the update.
+ * @return true if succeeded, false otherwise.
+ */
+ boolean updateFlow(IFlow flow);
+
+ /**
+ * Gets IFlow object.
+ *
+ * @param id ID of IFlow object.
+ * @return IFlow object if found, null otherwise.
+ */
+ IFlow getFlow(String id);
+
+ /**
+ * Gets All IFlow objects.
+ *
+ * @return the collection of IFlow objects.
+ */
+ Collection<IFlow> getFlows();
+
+ /**
+ * Executes batch operation of IFlow object.
+ *
+ * @param ops FlowOperations to be executed.
+ * @return true if succeeded, false otherwise.
+ */
+ boolean executeBatch(BatchOperation<IFlow> ops);
+
+ /**
+ * 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);
+}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/OpticalPathFlow.java b/src/main/java/net/onrc/onos/api/flowmanager/OpticalPathFlow.java
new file mode 100644
index 0000000..00a4785
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/flowmanager/OpticalPathFlow.java
@@ -0,0 +1,48 @@
+package net.onrc.onos.api.flowmanager;
+
+import java.util.List;
+
+import net.onrc.onos.core.matchaction.MatchActionPlan;
+import net.onrc.onos.core.matchaction.action.IAction;
+import net.onrc.onos.core.util.PortNumber;
+
+/**
+ * IFlow object representing an optical path.
+ * <p>
+ * TODO: Think this: How do we deal the optical path flow going through the
+ * regenerators? Can we express it with multiple OpticalPathFlow objects?
+ */
+public class OpticalPathFlow extends PathFlow {
+ protected int lambda;
+
+ /**
+ * Constructor.
+ *
+ * @param id ID for this new IFlow object.
+ * @param inPort Ingress port number at the ingress edge node.
+ * @param path Path between ingress and egress edge node.
+ * @param actions The list of IAction objects at the egress edge node.
+ * @param lambda The lambda to be used throughout the path.
+ */
+ public OpticalPathFlow(String id,
+ PortNumber inPort, Path path, List<IAction> actions, int lambda) {
+ super(id, null, inPort, path, actions);
+ this.lambda = lambda;
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * Gets lambda which is used throughout the path.
+ *
+ * @return lambda which is used throughout the path.
+ */
+ public int getLambda() {
+ return lambda;
+ }
+
+ @Override
+ public MatchActionPlan compile() {
+ // TODO Auto-generated method stub
+ return super.compile();
+ }
+}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/PacketPathFlow.java b/src/main/java/net/onrc/onos/api/flowmanager/PacketPathFlow.java
new file mode 100644
index 0000000..087ef47
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/flowmanager/PacketPathFlow.java
@@ -0,0 +1,61 @@
+package net.onrc.onos.api.flowmanager;
+
+import java.util.List;
+
+import net.onrc.onos.core.matchaction.MatchActionPlan;
+import net.onrc.onos.core.matchaction.action.IAction;
+import net.onrc.onos.core.matchaction.match.PacketMatch;
+import net.onrc.onos.core.util.PortNumber;
+
+/**
+ * IFlow object representing a packet path.
+ * <p>
+ * TODO: Think this: Do we need a bandwidth constraint?
+ */
+public class PacketPathFlow extends PathFlow {
+ private int hardTimeout;
+ private int idleTimeout;
+
+ /**
+ * Constructor.
+ *
+ * @param id ID for this new IFlow object.
+ * @param match Match object at the source node of the path.
+ * @param inPort Ingress port number at the ingress edge node.
+ * @param path Path between ingress and egress edge node.
+ * @param edgeActions The list of IAction objects at the egress edge node.
+ * @param hardTimeout hard-timeout value.
+ * @param idleTimeout idle-timeout value.
+ */
+ public PacketPathFlow(String id,
+ PacketMatch match, PortNumber inPort, Path path, List<IAction> edgeActions,
+ int hardTimeout, int idleTimeout) {
+ super(id, match, inPort, path, edgeActions);
+ this.hardTimeout = hardTimeout;
+ this.idleTimeout = idleTimeout;
+ }
+
+ /**
+ * Gets idle-timeout value.
+ *
+ * @return Idle-timeout value (seconds)
+ */
+ public int getIdleTimeout() {
+ return idleTimeout;
+ }
+
+ /**
+ * Gets hard-timeout value.
+ *
+ * @return Hard-timeout value (seconds)
+ */
+ public int getHardTimeout() {
+ return hardTimeout;
+ }
+
+ @Override
+ public MatchActionPlan compile() {
+ // TODO Auto-generated method stub
+ return super.compile();
+ }
+}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/Path.java b/src/main/java/net/onrc/onos/api/flowmanager/Path.java
new file mode 100644
index 0000000..df61e51
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/flowmanager/Path.java
@@ -0,0 +1,79 @@
+package net.onrc.onos.api.flowmanager;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import net.onrc.onos.core.util.Dpid;
+
+/**
+ * Path representation for the flow manager.
+ */
+public class Path extends FlowLinks {
+ /**
+ * Default constructor to create an empty path.
+ */
+ public Path() {
+ super();
+ }
+
+ /**
+ * Gets a list of switch DPIDs of the path.
+ *
+ * @return a list of Dpid objects
+ */
+ public List<Dpid> getDpids() {
+ if (size() < 1) {
+ return null;
+ }
+
+ List<Dpid> dpids = new ArrayList<Dpid>(size() + 1);
+ dpids.add(getSrcDpid());
+ for (FlowLink link: this) {
+ dpids.add(link.getDstDpid());
+ }
+ return dpids;
+ }
+
+ /**
+ * Gets the DPID of the first switch.
+ *
+ * @return a Dpid object of the first switch.
+ */
+ public Dpid getSrcDpid() {
+ if (size() < 1) {
+ return null;
+ }
+ return get(0).getSrcDpid();
+ }
+
+ /**
+ * Gets the DPID of the last switch.
+ *
+ * @return a Dpid object of the last switch.
+ */
+ public Dpid getDstDpid() {
+ if (size() < 1) {
+ return null;
+ }
+ return get(size() - 1).getDstDpid();
+ }
+
+ /**
+ * Returns a string representation of the path.
+ *
+ * @return a string representation of the path.
+ */
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ Iterator<FlowLink> i = this.iterator();
+ while (i.hasNext()) {
+ builder.append(i.next().toString());
+ if (i.hasNext()) {
+ builder.append(", ");
+ }
+ }
+ return builder.toString();
+ }
+}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/PathFlow.java b/src/main/java/net/onrc/onos/api/flowmanager/PathFlow.java
new file mode 100644
index 0000000..baf163f
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/flowmanager/PathFlow.java
@@ -0,0 +1,84 @@
+package net.onrc.onos.api.flowmanager;
+
+import java.util.List;
+
+import net.onrc.onos.core.matchaction.MatchActionPlan;
+import net.onrc.onos.core.matchaction.action.IAction;
+import net.onrc.onos.core.matchaction.match.IMatch;
+import net.onrc.onos.core.util.PortNumber;
+
+/**
+ * A path flow.
+ * <p>
+ * TODO: Think this: Should this class be an abstract class? Is it enough to
+ * have only the PacketPathFlow and OpticalPathFlow classes?
+ */
+public class PathFlow implements IFlow {
+ protected final String id;
+ protected IMatch match;
+ protected PortNumber ingressPort;
+ protected Path path;
+ protected List<IAction> edgeActions;
+
+ /**
+ * Constructor.
+ *
+ * @param id ID for this new PathFlow object.
+ * @param match Match object at the ingress node of the path.
+ * @param ingressPort The ingress port number at the ingress node of the
+ * path.
+ * @param path Path between ingress and egress edge node.
+ * @param edgeActions The list of IAction objects at the egress edge node.
+ */
+ public PathFlow(String id,
+ IMatch match, PortNumber ingressPort, Path path, List<IAction> edgeActions) {
+ this.id = id;
+ this.match = match;
+ this.ingressPort = ingressPort;
+ this.path = path;
+ this.edgeActions = edgeActions;
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public IMatch getMatch() {
+ return match;
+ }
+
+ @Override
+ public MatchActionPlan compile() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * Gets the ingress port number at the ingress node of the path.
+ *
+ * @return The ingress port number at the ingress node of the path.
+ */
+ public PortNumber getIngressPortNumber() {
+ return ingressPort;
+ }
+
+ /**
+ * Gets the path from ingress to egress edge node.
+ *
+ * @return The path object from ingress to egress edge node.
+ */
+ public Path getPath() {
+ return path;
+ }
+
+ /**
+ * Gets the list of IAction objects at the egress edge node.
+ *
+ * @return The list of IAction objects at the egress edge node.
+ */
+ public List<IAction> getActions() {
+ return edgeActions;
+ }
+}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/SingleDstTreeFlow.java b/src/main/java/net/onrc/onos/api/flowmanager/SingleDstTreeFlow.java
new file mode 100644
index 0000000..82a9b50
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/flowmanager/SingleDstTreeFlow.java
@@ -0,0 +1,90 @@
+package net.onrc.onos.api.flowmanager;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import net.onrc.onos.core.matchaction.MatchActionPlan;
+import net.onrc.onos.core.matchaction.action.OutputAction;
+import net.onrc.onos.core.matchaction.match.PacketMatch;
+import net.onrc.onos.core.util.SwitchPort;
+
+/**
+ * An IFlow object expressing the multipoints-to-point tree flow for the packet
+ * layer.
+ * <p>
+ * NOTE: This class might generate the MatchActionPlan which includes the MAC
+ * address modifications or other the label-switching-like schemes.
+ */
+public class SingleDstTreeFlow implements IFlow {
+ protected String id;
+ protected PacketMatch match;
+ protected Set<SwitchPort> ingressPorts;
+ protected Tree tree;
+ protected OutputAction outputAction;
+
+ /**
+ * Creates new instance using Tree object.
+ *
+ * @param id ID for this object.
+ * @param match Traffic filter for the tree.
+ * @param ingressPorts A set of ingress ports of the tree.
+ * @param tree Tree object specifying tree topology for this object.
+ * @param outputAction OutputAction object at the egress edge switch.
+ */
+ public SingleDstTreeFlow(String id, PacketMatch match,
+ Collection<SwitchPort> ingressPorts, Tree tree, OutputAction outputAction) {
+ this.id = id;
+ this.match = match;
+ this.ingressPorts = new HashSet<SwitchPort>(ingressPorts);
+ this.tree = tree;
+ this.outputAction = outputAction;
+
+ // TODO: check if the tree is a MP2P tree.
+ // TODO: check consistency among inPorts, tree, and action.
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public PacketMatch getMatch() {
+ return match;
+ }
+
+ @Override
+ public MatchActionPlan compile() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * Gets the ingress ports of the tree.
+ *
+ * @return The ingress ports of the tree.
+ */
+ public Collection<SwitchPort> getIngressPorts() {
+ return Collections.unmodifiableCollection(ingressPorts);
+ }
+
+ /**
+ * Gets the tree.
+ *
+ * @return The tree object.
+ */
+ public Tree getTree() {
+ return tree;
+ }
+
+ /**
+ * Gets the output action for the tree.
+ *
+ * @return The OutputAction object.
+ */
+ public OutputAction getOutputAction() {
+ return outputAction;
+ }
+}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/SingleSrcTreeFlow.java b/src/main/java/net/onrc/onos/api/flowmanager/SingleSrcTreeFlow.java
new file mode 100644
index 0000000..cecb605
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/flowmanager/SingleSrcTreeFlow.java
@@ -0,0 +1,87 @@
+package net.onrc.onos.api.flowmanager;
+
+import java.util.Set;
+
+import net.onrc.onos.core.matchaction.MatchActionPlan;
+import net.onrc.onos.core.matchaction.action.OutputAction;
+import net.onrc.onos.core.matchaction.match.PacketMatch;
+import net.onrc.onos.core.util.Dpid;
+import net.onrc.onos.core.util.Pair;
+import net.onrc.onos.core.util.SwitchPort;
+
+/**
+ * An IFlow object expressing the point-to-multipoints tree flow for the packet
+ * layer.
+ */
+public class SingleSrcTreeFlow implements IFlow {
+ protected String id;
+ protected PacketMatch match;
+ protected SwitchPort ingressPort;
+ protected Tree tree;
+ protected Set<Pair<Dpid, OutputAction>> outputActions;
+
+ /**
+ * Creates new instance using Tree object.
+ *
+ * @param id ID for this object.
+ * @param match Traffic filter for the tree.
+ * @param ingressPort A ingress port of the tree.
+ * @param tree Tree object specifying tree topology for this object.
+ * @param outputActions The set of the pairs of the switch DPID and
+ * OutputAction object at the egress edge switchs.
+ */
+ public SingleSrcTreeFlow(String id, PacketMatch match,
+ SwitchPort ingressPort, Tree tree, Set<Pair<Dpid, OutputAction>> outputActions) {
+ this.id = id;
+ this.match = match;
+ this.ingressPort = ingressPort;
+ this.tree = tree;
+ this.outputActions = outputActions;
+
+ // TODO: check if the tree is a P2MP tree.
+ // TODO: check consistency among rootPort, tree, and actions.
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public PacketMatch getMatch() {
+ return match;
+ }
+
+ @Override
+ public MatchActionPlan compile() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * Gets the ingress port (the root) of the tree.
+ *
+ * @return The ingress port of the tree.
+ */
+ public SwitchPort getIngressPort() {
+ return ingressPort;
+ }
+
+ /**
+ * Gets the tree.
+ *
+ * @return The tree object.
+ */
+ public Tree getTree() {
+ return tree;
+ }
+
+ /**
+ * Gets the output actions for the tree.
+ *
+ * @return The set of the pairs of Dpid and OutputAction object.
+ */
+ public Set<Pair<Dpid, OutputAction>> getActions() {
+ return outputActions;
+ }
+}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/Tree.java b/src/main/java/net/onrc/onos/api/flowmanager/Tree.java
new file mode 100644
index 0000000..49b05dc
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/flowmanager/Tree.java
@@ -0,0 +1,111 @@
+package net.onrc.onos.api.flowmanager;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import net.onrc.onos.core.util.Dpid;
+import net.onrc.onos.core.util.PortNumber;
+import net.onrc.onos.core.util.SwitchPort;
+
+/**
+ * A directed connected tree topology representation used by TreeFlow.
+ */
+public class Tree extends FlowLinks {
+ Map<Dpid, Set<PortNumber>> ports = new HashMap<Dpid, Set<PortNumber>>();
+ Map<SwitchPort, FlowLink> inLinks = new HashMap<SwitchPort, FlowLink>();
+ Map<SwitchPort, FlowLink> outLinks = new HashMap<SwitchPort, FlowLink>();
+
+ /**
+ * Creates new instance.
+ */
+ public Tree() {
+ super();
+ }
+
+ /**
+ * Creates new instance using Path object.
+ */
+ public Tree(Path path) {
+ super();
+ // TODO implement
+ }
+
+ private void addPort(SwitchPort port) {
+ if (!ports.containsKey(port.dpid())) {
+ ports.put(port.dpid(), new HashSet<PortNumber>());
+ }
+ ports.get(port.dpid()).add(port.port());
+ }
+
+ /**
+ * Adds FlowLink object to this tree.
+ * <p>
+ * This method checks specified FlowLink object to keep this Tree object a
+ * connected tree.
+ *
+ * @param link FlowLink object to be added.
+ * @return true if succeeded, false otherwise.
+ */
+ public boolean addLink(FlowLink link) {
+ if (links.size() > 0) {
+ if (!hasDpid(link.getSrcDpid()) && !hasDpid(link.getDstDpid())) {
+ // no attaching point
+ return false;
+ }
+ if (hasDpid(link.getSrcDpid()) && hasDpid(link.getDstDpid())) {
+ // loop or duplicated paths
+ return false;
+ }
+ }
+
+ if (hasSwitchPort(link.getSrcSwitchPort())
+ || hasSwitchPort(link.getDstSwitchPort())) {
+ // some port has already been occupied by another link
+ return false;
+ }
+
+ links.add(link);
+ addPort(link.getSrcSwitchPort());
+ addPort(link.getDstSwitchPort());
+
+ inLinks.put(link.getDstSwitchPort(), link);
+ outLinks.put(link.getSrcSwitchPort(), link);
+
+ return true;
+ }
+
+ /**
+ * Checks if specified dpid exists in this tree.
+ *
+ * @param dpid DPID to be checked.
+ * @return true if found, false otherwise.
+ */
+ public boolean hasDpid(Dpid dpid) {
+ return ports.containsKey(dpid);
+ }
+
+ /**
+ * Checks if specified switch-port exists in this tree.
+ *
+ * @param port SwitchPort object to be checked.
+ * @return true if found, false otherwise.
+ */
+ public boolean hasSwitchPort(SwitchPort port) {
+ return inLinks.containsKey(port) || outLinks.containsKey(port);
+ }
+
+ @Override
+ public int hashCode() {
+ // TODO think if this is correct.
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ // TODO think if this is correct.
+ // - has to check equality using a set, not a list?
+ return super.equals(o);
+ }
+}
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);
+}
diff --git a/src/main/java/net/onrc/onos/api/intent/Intent.java b/src/main/java/net/onrc/onos/api/intent/Intent.java
new file mode 100644
index 0000000..93d6459
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/intent/Intent.java
@@ -0,0 +1,53 @@
+package net.onrc.onos.api.intent;
+
+import java.util.List;
+
+import net.onrc.onos.api.batchoperation.BatchOperation;
+import net.onrc.onos.api.batchoperation.IBatchOperationTarget;
+import net.onrc.onos.api.flowmanager.IFlow;
+
+/**
+ * The base class for the connectivity abstraction. It allows applications to
+ * specify end hosts, apply some basic filtering to traffic, and constrain
+ * traffic.
+ * <p>
+ * This class is sub-classed to provide other intent types like shortest path
+ * connectivity and bandwidth constrained shortest path connectivity.
+ * <p>
+ * The reasoning behind "intent" is that the applications can provide some
+ * abstract representation of how traffic should flow be handled by the
+ * networking, allowing the network OS to compile, reserve and optimize the
+ * data-plane to satisfy those constraints.
+ */
+public abstract class Intent implements IBatchOperationTarget {
+ protected String id;
+
+ /**
+ * Constructor.
+ *
+ * @param id ID for this Intent object.
+ */
+ public Intent(String id) {
+ this.id = id;
+ }
+
+ /**
+ * Gets ID for this Intent object.
+ *
+ * @return ID for this Intent object.
+ */
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Compiles this Intent object to the list of FlowOperations.
+ * <p>
+ * All Intent object must implement this method and IntentRuntimeModule use
+ * this method to process this Intent.
+ *
+ * @return The list of FlowOperations of this Intent.
+ */
+ public abstract List<BatchOperation<IFlow>> compile();
+}
diff --git a/src/main/java/net/onrc/onos/api/intent/OpticalConnectivityIntent.java b/src/main/java/net/onrc/onos/api/intent/OpticalConnectivityIntent.java
new file mode 100644
index 0000000..89f6208
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/intent/OpticalConnectivityIntent.java
@@ -0,0 +1,58 @@
+package net.onrc.onos.api.intent;
+
+import java.util.List;
+
+import net.onrc.onos.api.batchoperation.BatchOperation;
+import net.onrc.onos.api.flowmanager.IFlow;
+import net.onrc.onos.core.util.SwitchPort;
+
+/**
+ * An optical layer Intent for a connectivity from a transponder port to another
+ * transponder port.
+ * <p>
+ * This class doesn't accepts lambda specifier. This class computes path between
+ * ports and assign lambda automatically. The lambda can be specified using
+ * OpticalPathFlow class.
+ */
+public class OpticalConnectivityIntent extends Intent {
+ protected SwitchPort srcSwitchPort;
+ protected SwitchPort dstSwitchPort;
+
+ /**
+ * Constructor.
+ *
+ * @param id ID for this new Intent object.
+ * @param srcSwitchPort The source transponder port.
+ * @param dstSwitchPort The destination transponder port.
+ */
+ public OpticalConnectivityIntent(String id,
+ SwitchPort srcSwitchPort, SwitchPort dstSwitchPort) {
+ super(id);
+ this.srcSwitchPort = srcSwitchPort;
+ this.dstSwitchPort = dstSwitchPort;
+ }
+
+ /**
+ * Gets source transponder port.
+ *
+ * @return The source transponder port.
+ */
+ public SwitchPort getSrcSwitchPort() {
+ return srcSwitchPort;
+ }
+
+ /**
+ * Gets destination transponder port.
+ *
+ * @return The source transponder port.
+ */
+ public SwitchPort getDstSwitchPort() {
+ return dstSwitchPort;
+ }
+
+ @Override
+ public List<BatchOperation<IFlow>> compile() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
diff --git a/src/main/java/net/onrc/onos/api/intent/PacketConnectivityIntent.java b/src/main/java/net/onrc/onos/api/intent/PacketConnectivityIntent.java
new file mode 100644
index 0000000..99660c8
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/intent/PacketConnectivityIntent.java
@@ -0,0 +1,172 @@
+package net.onrc.onos.api.intent;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import net.onrc.onos.api.batchoperation.BatchOperation;
+import net.onrc.onos.api.flowmanager.IFlow;
+import net.onrc.onos.core.matchaction.match.PacketMatch;
+import net.onrc.onos.core.util.SwitchPort;
+
+/**
+ * A packet layer Intent for a connectivity from a set of ports to a set of
+ * ports.
+ * <p>
+ * TODO: Design methods to support the ReactiveForwarding and the SDN-IP. <br>
+ * NOTE: Should this class support modifier methods? Should this object a
+ * read-only object?
+ */
+public class PacketConnectivityIntent extends Intent {
+ protected Set<SwitchPort> srcSwitchPorts;
+ protected PacketMatch match;
+ protected Set<SwitchPort> dstSwitchPorts;
+ protected boolean canSetupOpticalFlow;
+ protected int idleTimeoutValue;
+ protected int hardTimeoutValue;
+
+ /**
+ * Creates a connectivity intent for the packet layer.
+ * <p>
+ * When the "canSetupOpticalFlow" option is true, this intent will compute
+ * the packet/optical converged path, decompose it to the OpticalPathFlow
+ * and the PacketPathFlow objects, and execute the operations to add them
+ * considering the dependency between the packet and optical layers.
+ *
+ * @param id ID for this new Intent object.
+ * @param srcSwitchPorts The set of source switch ports.
+ * @param match Traffic specifier for this object.
+ * @param dstSwitchPorts The set of destination switch ports.
+ * @param canSetupOpticalFlow The flag whether this intent can create
+ * optical flows if needed.
+ */
+ public PacketConnectivityIntent(String id,
+ Collection<SwitchPort> srcSwitchPorts, PacketMatch match,
+ Collection<SwitchPort> dstSwitchPorts, boolean canSetupOpticalFlow) {
+ super(id);
+ this.srcSwitchPorts = new HashSet<SwitchPort>(srcSwitchPorts);
+ this.match = match;
+ this.dstSwitchPorts = new HashSet<SwitchPort>(dstSwitchPorts);
+ this.canSetupOpticalFlow = canSetupOpticalFlow;
+ this.idleTimeoutValue = 0;
+ this.hardTimeoutValue = 0;
+
+ // TODO: check consistency between these parameters.
+ }
+
+ /**
+ * Gets the set of source switch ports.
+ *
+ * @return the set of source switch ports.
+ */
+ public Collection<SwitchPort> getSrcSwitchPorts() {
+ return Collections.unmodifiableCollection(srcSwitchPorts);
+ }
+
+ /**
+ * Gets the traffic specifier.
+ *
+ * @return The traffic specifier.
+ */
+ public PacketMatch getMatch() {
+ return match;
+ }
+
+ /**
+ * Gets the set of destination switch ports.
+ *
+ * @return the set of destination switch ports.
+ */
+ public Collection<SwitchPort> getDstSwitchPorts() {
+ return Collections.unmodifiableCollection(dstSwitchPorts);
+ }
+
+ /**
+ * Adds the specified port to the set of source ports.
+ *
+ * @param port SwitchPort object to be added
+ */
+ public void addSrcSwitchPort(SwitchPort port) {
+ // TODO implement it.
+ }
+
+ /**
+ * Adds the specified port to the set of destination ports.
+ *
+ * @param port SwitchPort object to be added
+ */
+ public void addDstSwitchPort(SwitchPort port) {
+ // TODO implement it.
+ }
+
+ /**
+ * Removes the specified port from the set of source ports.
+ *
+ * @param port SwitchPort object to be removed
+ */
+ public void removeSrcSwitchPort(SwitchPort port) {
+ // TODO implement it.
+ }
+
+ /**
+ * Removes the specified port from the set of destination ports.
+ *
+ * @param port SwitchPort object to be removed
+ */
+ public void removeDstSwitchPort(SwitchPort port) {
+ // TODO implement it.
+ }
+
+ /**
+ * Sets idle-timeout value.
+ *
+ * @param timeout Idle-timeout value (seconds)
+ */
+ public void setIdleTimeout(int timeout) {
+ idleTimeoutValue = timeout;
+ }
+
+ /**
+ * Sets hard-timeout value.
+ *
+ * @param timeout Hard-timeout value (seconds)
+ */
+ public void setHardTimeout(int timeout) {
+ hardTimeoutValue = timeout;
+ }
+
+ /**
+ * Gets idle-timeout value.
+ *
+ * @return Idle-timeout value (seconds)
+ */
+ public int getIdleTimeout() {
+ return idleTimeoutValue;
+ }
+
+ /**
+ * Gets hard-timeout value.
+ *
+ * @return Hard-timeout value (seconds)
+ */
+ public int getHardTimeout() {
+ return hardTimeoutValue;
+ }
+
+ /**
+ * Returns whether this intent can create optical flows if needed.
+ *
+ * @return whether this intent can create optical flows.
+ */
+ public boolean canSetupOpticalFlow() {
+ return canSetupOpticalFlow;
+ }
+
+ @Override
+ public List<BatchOperation<IFlow>> compile() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
diff --git a/src/main/java/net/onrc/onos/core/flowmanager/FlowManagerModule.java b/src/main/java/net/onrc/onos/core/flowmanager/FlowManagerModule.java
new file mode 100644
index 0000000..a1ca35e
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/flowmanager/FlowManagerModule.java
@@ -0,0 +1,80 @@
+package net.onrc.onos.core.flowmanager;
+
+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;
+import net.onrc.onos.api.flowmanager.IFlowManagerService;
+
+/**
+ * Manages a set of IFlow objects, computes and maintains a set of Match-Action
+ * entries based on the IFlow objects, and executes Match-Action plans.
+ * <p>
+ * TODO: Make all methods thread-safe
+ */
+public class FlowManagerModule implements IFlowManagerService {
+ @Override
+ public boolean addFlow(IFlow flow) {
+ BatchOperation<IFlow> ops = new BatchOperation<IFlow>();
+ ops.addAddOperation(flow);
+ return executeBatch(ops);
+ }
+
+ @Override
+ public boolean removeFlow(String id) {
+ BatchOperation<IFlow> ops = new BatchOperation<IFlow>();
+ ops.addRemoveOperation(id);
+ return executeBatch(ops);
+ }
+
+ @Override
+ public boolean updateFlow(IFlow flow) {
+ BatchOperation<IFlow> ops = new BatchOperation<IFlow>();
+ ops.addUpdateOperation(flow.getId(), flow);
+ return executeBatch(ops);
+ }
+
+ @Override
+ public IFlow getFlow(String id) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Collection<IFlow> getFlows() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean executeBatch(BatchOperation<IFlow> ops) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void setConflictDetectionPolicy(ConflictDetectionPolicy policy) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public ConflictDetectionPolicy getConflictDetectionPolicy() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void addEventListener(EventListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void removeEventListener(EventListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/src/main/java/net/onrc/onos/core/matchaction/IMatchActionService.java b/src/main/java/net/onrc/onos/core/matchaction/IMatchActionService.java
new file mode 100644
index 0000000..9b829a5
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/matchaction/IMatchActionService.java
@@ -0,0 +1,79 @@
+package net.onrc.onos.core.matchaction;
+
+import java.util.Collection;
+import java.util.EventListener;
+
+import net.onrc.onos.api.flowmanager.ConflictDetectionPolicy;
+
+/**
+ * An interface for the match-action service.
+ */
+public interface IMatchActionService {
+ /**
+ * Adds a new match-action entry.
+ *
+ * @param matchAction MatchAction object to be added.
+ * @return true if succeeded, false otherwise.
+ */
+ boolean addMatchAction(MatchAction matchAction);
+
+ /**
+ * Removes the existing match-action entry.
+ *
+ * @param id ID for MatchaAction object to be removed.
+ * @return true if succeeded, false otherwise.
+ */
+ boolean removeMatchAction(String id);
+
+ /**
+ * Replaces the existing match-action entry by specified match-action entry.
+ *
+ * @param matchAction MatchAction object which overwrites existing
+ * match-action.
+ * @return true if succeeded, false otherwise.
+ */
+ boolean updateMatchAction(MatchAction matchAction);
+
+ /**
+ * Gets the set of match-action entries.
+ *
+ * @return The set of match-action entries.
+ */
+ Collection<MatchAction> getMatchActions();
+
+ /**
+ * Executes match-action operation plan.
+ *
+ * @param plan MatchActionPlan to be executed.
+ * @return true if succeeded, false otherwise.
+ */
+ boolean executePlan(MatchActionPlan plan);
+
+ /**
+ * 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);
+}
diff --git a/src/main/java/net/onrc/onos/core/matchaction/MatchAction.java b/src/main/java/net/onrc/onos/core/matchaction/MatchAction.java
new file mode 100644
index 0000000..2f21baf
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/matchaction/MatchAction.java
@@ -0,0 +1,97 @@
+package net.onrc.onos.core.matchaction;
+
+import java.util.Arrays;
+import java.util.List;
+
+import net.floodlightcontroller.util.MACAddress;
+import net.onrc.onos.api.batchoperation.IBatchOperationTarget;
+import net.onrc.onos.core.matchaction.action.IAction;
+import net.onrc.onos.core.matchaction.action.OutputAction;
+import net.onrc.onos.core.matchaction.match.IMatch;
+import net.onrc.onos.core.matchaction.match.PacketMatch;
+import net.onrc.onos.core.util.Dpid;
+import net.onrc.onos.core.util.IPv4;
+import net.onrc.onos.core.util.PortNumber;
+import net.onrc.onos.core.util.SwitchPort;
+
+/**
+ * A filter and actions for traffic.
+ */
+public class MatchAction implements IBatchOperationTarget {
+ protected String id;
+ protected SwitchPort port;
+ protected List<IMatch> matches;
+ protected List<IAction> actions;
+
+ /**
+ * Constructor.
+ *
+ * @param id ID for this MatchAction object.
+ * @param port Switch DPID
+ * @param matches The list of IMatch objects as match condition on the port.
+ * @param actions The list of IAction objects as actions on the switch.
+ */
+ public MatchAction(String id, SwitchPort port, List<IMatch> matches,
+ List<IAction> actions) {
+ this.id = id;
+ this.port = port;
+ this.matches = matches;
+ this.actions = actions;
+ }
+
+ /**
+ * Constructor.
+ * <p>
+ * MEMO: This is a sample constructor to create a packet layer match action.
+ *
+ * @param id ID for this MatchAction object.
+ * @param dpid Switch DPID
+ * @param srcPort Source Port
+ * @param srcMac Source Host MAC Address
+ * @param dstMac Destination Host MAC Address
+ * @param srcIp Source IP Address
+ * @param dstIp Destination IP Address
+ * @param dstPort Destination Port
+ */
+ // CHECKSTYLE:OFF suppress the warning about too many parameters
+ public MatchAction(String id, Dpid dpid, PortNumber srcPort,
+ MACAddress srcMac, MACAddress dstMac,
+ IPv4 srcIp, IPv4 dstIp, PortNumber dstPort) {
+ // CHECKSTYLE:ON
+ this(id, new SwitchPort(dpid, srcPort),
+ Arrays.asList((IMatch) new PacketMatch(srcMac, dstMac, srcIp, dstIp)),
+ Arrays.asList((IAction) new OutputAction(dstPort)));
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Gets the switch-port which is the target of this match-action.
+ *
+ * @return The target switch-port of this match-action.
+ */
+ public SwitchPort getSwitchPort() {
+ return port;
+ }
+
+ /**
+ * Gets the traffic filter of the match-action.
+ *
+ * @return The traffic filter.
+ */
+ public List<IMatch> getMatches() {
+ return matches;
+ }
+
+ /**
+ * Gets the list of actions of the match-action.
+ *
+ * @return The list of actions.
+ */
+ public List<IAction> getActions() {
+ return actions;
+ }
+}
diff --git a/src/main/java/net/onrc/onos/core/matchaction/MatchActionModule.java b/src/main/java/net/onrc/onos/core/matchaction/MatchActionModule.java
new file mode 100644
index 0000000..e0957f0
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/matchaction/MatchActionModule.java
@@ -0,0 +1,78 @@
+package net.onrc.onos.core.matchaction;
+
+import java.util.Collection;
+import java.util.EventListener;
+
+import net.onrc.onos.api.batchoperation.BatchOperation;
+import net.onrc.onos.api.flowmanager.ConflictDetectionPolicy;
+
+/**
+ * Manages Match-Action entries.
+ * <p>
+ * TODO: Make all methods thread-safe
+ */
+public class MatchActionModule implements IMatchActionService {
+
+ @Override
+ public boolean addMatchAction(MatchAction matchAction) {
+ BatchOperation<MatchAction> phase = new BatchOperation<MatchAction>();
+ phase.addAddOperation(matchAction);
+ MatchActionPlan plan = new MatchActionPlan();
+ plan.addPhase(phase);
+ return executePlan(plan);
+ }
+
+ @Override
+ public boolean removeMatchAction(String id) {
+ BatchOperation<MatchAction> phase = new BatchOperation<MatchAction>();
+ phase.addRemoveOperation(id);
+ MatchActionPlan plan = new MatchActionPlan();
+ plan.addPhase(phase);
+ return executePlan(plan);
+ }
+
+ @Override
+ public boolean updateMatchAction(MatchAction matchAction) {
+ BatchOperation<MatchAction> phase = new BatchOperation<MatchAction>();
+ phase.addUpdateOperation(matchAction.getId(), matchAction);
+ MatchActionPlan plan = new MatchActionPlan();
+ plan.addPhase(phase);
+ return executePlan(plan);
+ }
+
+ @Override
+ public Collection<MatchAction> getMatchActions() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean executePlan(MatchActionPlan plan) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void setConflictDetectionPolicy(ConflictDetectionPolicy policy) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public ConflictDetectionPolicy getConflictDetectionPolicy() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void addEventListener(EventListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void removeEventListener(EventListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/src/main/java/net/onrc/onos/core/matchaction/MatchActionPlan.java b/src/main/java/net/onrc/onos/core/matchaction/MatchActionPlan.java
new file mode 100644
index 0000000..c48dce2
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/matchaction/MatchActionPlan.java
@@ -0,0 +1,43 @@
+package net.onrc.onos.core.matchaction;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+import net.onrc.onos.api.batchoperation.BatchOperation;
+
+/**
+ * A match-action plan to be executed on the match-action module.
+ * <p>
+ * The plan is a list of phases, and the phase is a batch operation of
+ * match-actions.
+ */
+public class MatchActionPlan {
+ List<BatchOperation<MatchAction>> phases;
+
+ /**
+ * Constructor.
+ */
+ public MatchActionPlan() {
+ phases = new LinkedList<BatchOperation<MatchAction>>();
+ }
+
+ /**
+ * Adds the specified phase to the plan.
+ *
+ * @param phase The batch operation of match-actions to be added to the
+ * plan.
+ */
+ public void addPhase(BatchOperation<MatchAction> phase) {
+ phases.add(phase);
+ }
+
+ /**
+ * Gets the list of phases of the plan.
+ *
+ * @return The list of phases, batch operations of match-actions.
+ */
+ public List<BatchOperation<MatchAction>> getPhases() {
+ return Collections.unmodifiableList(phases);
+ }
+}
diff --git a/src/main/java/net/onrc/onos/core/matchaction/action/IAction.java b/src/main/java/net/onrc/onos/core/matchaction/action/IAction.java
new file mode 100644
index 0000000..b381f85
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/matchaction/action/IAction.java
@@ -0,0 +1,8 @@
+package net.onrc.onos.core.matchaction.action;
+
+/**
+ * An interface of action objects.
+ */
+public interface IAction {
+
+}
diff --git a/src/main/java/net/onrc/onos/core/matchaction/action/ModifyLambdaAction.java b/src/main/java/net/onrc/onos/core/matchaction/action/ModifyLambdaAction.java
new file mode 100644
index 0000000..ee5cdb2
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/matchaction/action/ModifyLambdaAction.java
@@ -0,0 +1,30 @@
+package net.onrc.onos.core.matchaction.action;
+
+/**
+ * An action object to modify lambda.
+ * <p>
+ * This class does not have a switch ID. The switch ID is handled by
+ * MatchAction, IFlow or Intent class.
+ */
+public class ModifyLambdaAction implements IAction {
+ protected int lambda;
+
+ /**
+ * Constructor.
+ *
+ * @param dstPort Destination port number
+ */
+ public ModifyLambdaAction(int lambda) {
+ this.lambda = lambda;
+ }
+
+ /**
+ * Gets the lambda.
+ *
+ * @return The lambda.
+ */
+ public int getLambda() {
+ return lambda;
+ }
+
+}
diff --git a/src/main/java/net/onrc/onos/core/matchaction/action/OutputAction.java b/src/main/java/net/onrc/onos/core/matchaction/action/OutputAction.java
new file mode 100644
index 0000000..f570ea8
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/matchaction/action/OutputAction.java
@@ -0,0 +1,31 @@
+package net.onrc.onos.core.matchaction.action;
+
+import net.onrc.onos.core.util.PortNumber;
+
+/**
+ * An action object to output traffic to specified port.
+ * <p>
+ * This class does not have a switch ID. The switch ID is handled by
+ * MatchAction, IFlow or Intent class.
+ */
+public class OutputAction implements IAction {
+ protected PortNumber portNumber;
+
+ /**
+ * Constructor.
+ *
+ * @param dstPort The port number of the target output port.
+ */
+ public OutputAction(PortNumber dstPort) {
+ this.portNumber = dstPort;
+ }
+
+ /**
+ * Gets the port number of the target output port.
+ *
+ * @return The port number of the target output port.
+ */
+ public PortNumber getPortNumber() {
+ return portNumber;
+ }
+}
diff --git a/src/main/java/net/onrc/onos/core/matchaction/match/IMatch.java b/src/main/java/net/onrc/onos/core/matchaction/match/IMatch.java
new file mode 100644
index 0000000..904e337
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/matchaction/match/IMatch.java
@@ -0,0 +1,8 @@
+package net.onrc.onos.core.matchaction.match;
+
+/**
+ * An interface for match objects.
+ */
+public interface IMatch {
+
+}
diff --git a/src/main/java/net/onrc/onos/core/matchaction/match/OpticalMatch.java b/src/main/java/net/onrc/onos/core/matchaction/match/OpticalMatch.java
new file mode 100644
index 0000000..00bae0e
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/matchaction/match/OpticalMatch.java
@@ -0,0 +1,39 @@
+package net.onrc.onos.core.matchaction.match;
+
+/**
+ * A match object (traffic specifier) for optical nodes, flow-paths and intents.
+ * <p>
+ * This class does not have a switch ID and a port number. They are handled by
+ * MatchAction, IFlow or Intent class.
+ */
+public class OpticalMatch implements IMatch {
+
+ // Match fields
+ protected Integer srcLambda;
+
+ /**
+ * Constructor.
+ */
+ public OpticalMatch() {
+ this(null);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param srcLambda The source lambda. Null means the wild-card for the
+ * lambda.
+ */
+ public OpticalMatch(Integer srcLambda) {
+ this.srcLambda = srcLambda;
+ }
+
+ /**
+ * Gets the source lambda.
+ *
+ * @return The source lambda, or null if it was wild-card.
+ */
+ public Integer getSrcLambda() {
+ return srcLambda;
+ }
+}
diff --git a/src/main/java/net/onrc/onos/core/matchaction/match/PacketMatch.java b/src/main/java/net/onrc/onos/core/matchaction/match/PacketMatch.java
new file mode 100644
index 0000000..0a6caff
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/matchaction/match/PacketMatch.java
@@ -0,0 +1,78 @@
+package net.onrc.onos.core.matchaction.match;
+
+import net.floodlightcontroller.util.MACAddress;
+import net.onrc.onos.core.util.IPv4;
+
+/**
+ * A match object (traffic specifier) for packet nodes, flow-paths and intents.
+ * <p>
+ * This class does not have a switch ID and a port number. They are handled by
+ * MatchAction, IFlow or Intent class.
+ */
+public class PacketMatch implements IMatch {
+
+ // Match fields
+ protected MACAddress srcMacAddress;
+ protected MACAddress dstMacAddress;
+ protected IPv4 srcIpAddress;
+ protected IPv4 dstIpAddress;
+
+ /**
+ * Constructor.
+ */
+ public PacketMatch() {
+ this(null, null, null, null);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param srcMac Source Host MAC Address
+ * @param dstMac Destination Host MAC Address
+ * @param srcIp Source IP Address
+ * @param dstIp Destination IP Address
+ */
+ public PacketMatch(MACAddress srcMac, MACAddress dstMac,
+ IPv4 srcIp, IPv4 dstIp) {
+ this.srcMacAddress = srcMac;
+ this.dstMacAddress = dstMac;
+ this.srcIpAddress = srcIp;
+ this.dstIpAddress = dstIp;
+ }
+
+ /**
+ * Gets the source host MAC address.
+ *
+ * @return The source host MAC address.
+ */
+ public MACAddress getSrcMacAddress() {
+ return srcMacAddress;
+ }
+
+ /**
+ * Gets the destination host MAC address.
+ *
+ * @return The destination host MAC address.
+ */
+ public MACAddress getDstMacAddress() {
+ return dstMacAddress;
+ }
+
+ /**
+ * Gets the source host IP address.
+ *
+ * @return The source host IP address.
+ */
+ public IPv4 getSrcIpAddress() {
+ return srcIpAddress;
+ }
+
+ /**
+ * Gets the destination host IP address.
+ *
+ * @return The destination host IP address.
+ */
+ public IPv4 getDstIpAddress() {
+ return dstIpAddress;
+ }
+}
diff --git a/src/main/java/net/onrc/onos/core/newintent/IntentRuntimeModule.java b/src/main/java/net/onrc/onos/core/newintent/IntentRuntimeModule.java
new file mode 100644
index 0000000..6a2cf8c
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/newintent/IntentRuntimeModule.java
@@ -0,0 +1,101 @@
+package net.onrc.onos.core.newintent;
+
+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;
+import net.onrc.onos.api.intent.IIntentRuntimeService;
+import net.onrc.onos.api.intent.Intent;
+
+/**
+ * Implementation of Intent-Runtime Service.
+ * <p>
+ * TODO: Make all methods thread-safe. <br>
+ * TODO: Design methods to support the ReactiveForwarding and the SDN-IP.
+ */
+public class IntentRuntimeModule implements IIntentRuntimeService {
+
+ @Override
+ public boolean addIntent(Intent intent) {
+ BatchOperation<Intent> ops = new BatchOperation<Intent>();
+ ops.addAddOperation(intent);
+ return executeBatch(ops);
+ }
+
+ @Override
+ public boolean removeIntent(String id) {
+ BatchOperation<Intent> ops = new BatchOperation<Intent>();
+ ops.addRemoveOperation(id);
+ return executeBatch(ops);
+ }
+
+ @Override
+ public boolean updateIntent(String id, Intent intent) {
+ BatchOperation<Intent> ops = new BatchOperation<Intent>();
+ ops.addUpdateOperation(id, intent);
+ return executeBatch(ops);
+ }
+
+ @Override
+ public Intent getIntent(String id) {
+ // TODO Auto-generated method stub
+ // - retrieves intents from global distributed maps
+ return null;
+ }
+
+ @Override
+ public Collection<Intent> getIntents() {
+ // TODO Auto-generated method stub
+ // - retrieves intents from global distributed maps
+ return null;
+ }
+
+ @Override
+ public boolean executeBatch(BatchOperation<Intent> ops) {
+ // TODO Auto-generated method stub
+ // - gets flow operations using compile() method for each Intent object.
+ // - allocates resources
+ // - combines and executes flow operations using FlowManager Service.
+ // - updates global distributed maps
+ return false;
+ }
+
+ @Override
+ public Collection<IFlow> getFlows(String intentId) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Intent getIntentByFlow(String flowId) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setConflictDetectionPolicy(ConflictDetectionPolicy policy) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public ConflictDetectionPolicy getConflictDetectionPolicy() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void addEventListener(EventListener listener) {
+ // TODO Auto-generated method stub
+ // - listener for addition/removal of intents,
+ // and states changes of intents
+ }
+
+ @Override
+ public void removeEventListener(EventListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+}