Bug fixes/improvements:
1. DeviceManager must not have a dependency on DeviceClockService. Clocks and Timestamps are purely distribution concerns.
2. Eliminated DeviceClockProviderService which merely served as a cache for mastership terms thereby introducing a source of staleness. Now we directly query mastership service which is already optimized for high volume reads.
3. DistributedLeadershipManager fix to ensure election won by local node immediately reflects in the local leaderboard. This is to ensure a subsequent read does not return a stale value.

Change-Id: I774b64923e382b788df5f8bde2a9fafc0294bad0
diff --git a/core/api/src/main/java/org/onosproject/mastership/MastershipService.java b/core/api/src/main/java/org/onosproject/mastership/MastershipService.java
index 75d0eac..a709f5c 100644
--- a/core/api/src/main/java/org/onosproject/mastership/MastershipService.java
+++ b/core/api/src/main/java/org/onosproject/mastership/MastershipService.java
@@ -15,6 +15,8 @@
  */
 package org.onosproject.mastership;
 
+import static org.onosproject.net.MastershipRole.MASTER;
+
 import java.util.Set;
 import java.util.concurrent.CompletableFuture;
 
@@ -43,6 +45,16 @@
     MastershipRole getLocalRole(DeviceId deviceId);
 
     /**
+     * Returns true if the local controller is the Master for the specified deviceId.
+     *
+     * @param deviceId the the identifier of the device
+     * @return true if local node is master; false otherwise
+     */
+    default boolean isLocalMaster(DeviceId deviceId) {
+        return getLocalRole(deviceId) == MASTER;
+    }
+
+    /**
      * Returns the mastership status of the local controller for a given
      * device forcing master selection if necessary.
      *