Deprecate legacy EOS API classes
[controller.git] / opendaylight / md-sal / sal-common-api / src / main / java / org / opendaylight / controller / md / sal / common / api / clustering / EntityOwnershipService.java
index f200f5adc1cc7ddebc613126ef4030773fba3521..07c93e780cdf0006f2e823891f5bd9126c226045 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.controller.md.sal.common.api.clustering;
 
+import com.google.common.base.Optional;
 import javax.annotation.Nonnull;
 
 /**
@@ -20,7 +21,11 @@ import javax.annotation.Nonnull;
  * A component/application may also register interest in the ownership status of an Entity. The listener would be
  * notified whenever the ownership status changes.
  * </p>
+ *
+ * @deprecated Use org.opendaylight.mdsal.binding.api.clustering.EntityOwnershipService or
+ *             org.opendaylight.mdsal.dom.api.clustering.DOMEntityOwnershipService instead
  */
+@Deprecated
 public interface EntityOwnershipService {
 
     /**
@@ -50,4 +55,19 @@ public interface EntityOwnershipService {
      */
     EntityOwnershipListenerRegistration registerListener(@Nonnull String entityType, @Nonnull EntityOwnershipListener listener);
 
+    /**
+     * Gets the current ownership state information for an entity.
+     *
+     * @param forEntity the entity to query.
+     * @return an Optional EntityOwnershipState whose instance is present if the entity is found
+     */
+    Optional<EntityOwnershipState> getOwnershipState(@Nonnull Entity forEntity);
+
+    /**
+     * Check if a local candidate is registered for the given entity
+     *
+     * @param entity
+     * @return true if a candidate was registered locally, false otherwise
+     */
+    boolean isCandidateRegistered(@Nonnull Entity entity);
 }