inital term info service
Change-Id: I4503f1dcadda62bb25e2dba106e9a1101b4d37d6
diff --git a/core/api/src/main/java/org/onlab/onos/cluster/MastershipTerm.java b/core/api/src/main/java/org/onlab/onos/cluster/MastershipTerm.java
new file mode 100644
index 0000000..5c3c424
--- /dev/null
+++ b/core/api/src/main/java/org/onlab/onos/cluster/MastershipTerm.java
@@ -0,0 +1,6 @@
+package org.onlab.onos.cluster;
+
+public class MastershipTerm {
+ private final NodeId master = null;
+ private int termNumber;
+}
diff --git a/core/api/src/main/java/org/onlab/onos/cluster/MastershipTermService.java b/core/api/src/main/java/org/onlab/onos/cluster/MastershipTermService.java
new file mode 100644
index 0000000..b03ed81
--- /dev/null
+++ b/core/api/src/main/java/org/onlab/onos/cluster/MastershipTermService.java
@@ -0,0 +1,20 @@
+package org.onlab.onos.cluster;
+
+import org.onlab.onos.net.DeviceId;
+
+// TODO give me a better name
+/**
+ * Service to obtain mastership term information.
+ */
+public interface MastershipTermService {
+
+ // TBD: manage/increment per device mastership change
+ // or increment on any change
+ /**
+ * Returns the term number of mastership change occurred for given device.
+ *
+ * @param deviceId the identifier of the device
+ * @return current master's term.
+ */
+ MastershipTerm getMastershipTerm(DeviceId deviceId);
+}