Deprecate legacy EOS API classes 16/57416/4
authorTom Pantelis <tompantelis@gmail.com>
Fri, 19 May 2017 10:58:24 +0000 (06:58 -0400)
committerRobert Varga <nite@hq.sk>
Fri, 19 May 2017 21:06:49 +0000 (21:06 +0000)
Deprecate the legacy API in favor of the new APIs in mdsal.

Change-Id: I819fe7e7006694a5912e4c324055df10d4a33d3d
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
12 files changed:
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/CandidateAlreadyRegisteredException.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/Entity.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipCandidateRegistration.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipChange.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipListener.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipListenerRegistration.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipService.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipState.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/clustering/AbstractEntityOwnershipCandidateRegistration.java [deleted file]
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/clustering/AbstractEntityOwnershipListenerRegistration.java [deleted file]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/clustering/impl/LegacyEntityOwnershipServiceAdapter.java
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/clustering/impl/LegacyEntityOwnershipServiceAdapterTest.java

index 976688946fa65b34e566ad51022a52b91b313bbb..67286e3d48e5560b0e1fbedd218e4a18768307a0 100644 (file)
@@ -14,7 +14,10 @@ import javax.annotation.Nonnull;
 /**
  * Thrown when a Candidate has already been registered for a given Entity. This could be due to a component doing a
  * duplicate registration or two different components within the same process trying to register a Candidate.
+ *
+ * @deprecated Use org.opendaylight.mdsal.common.api.clustering.CandidateAlreadyRegisteredException instead
  */
+@Deprecated
 public class CandidateAlreadyRegisteredException extends Exception {
     private static final long serialVersionUID = 1L;
 
@@ -27,6 +30,7 @@ public class CandidateAlreadyRegisteredException extends Exception {
     }
 
     /**
+     * Returns the entity for which a Candidate has already been registered in the current process.
      *
      * @return the entity for which a Candidate has already been registered in the current process
      */
index 7cb672e9b06e87bf278352194c462ed71150afcb..e30113023547a91972138b2c5cee7e0de8ae0973 100644 (file)
@@ -34,7 +34,11 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
  * <p>
  * Note that an entity identifier must conform to a valid yang schema. If there is no existing yang schema to
  * represent an entity, the general-entity yang model can be used.
+ *
+ * @deprecated Use org.opendaylight.mdsal.binding.api.clustering.Entity or
+ *             org.opendaylight.mdsal.eos.dom.api.DOMEntity instead
  */
+@Deprecated
 public final class Entity implements Serializable {
     private static final long serialVersionUID = 1L;
 
index e59aefb9c4c6ccf30eed8c03d77af2cce8ecf3c4..487b19251b247a1e2da912aa57b555837b851bce 100644 (file)
@@ -14,11 +14,16 @@ import org.opendaylight.yangtools.concepts.ObjectRegistration;
  * An EntityOwnershipCandidateRegistration records a request to register a Candidate for a given Entity. Calling
  * close on the EntityOwnershipCandidateRegistration will remove the Candidate from any future ownership considerations
  * for that Entity.
+ *
+ * @deprecated Use org.opendaylight.mdsal.binding.api.clustering.EntityOwnershipCandidateRegistration
+ *             or org.opendaylight.mdsal.dom.api.clustering.DOMEntityOwnershipCandidateRegistration instead
  */
+@Deprecated
 public interface EntityOwnershipCandidateRegistration extends ObjectRegistration<Entity> {
-   /**
-    * Unregister the candidate
-    */
-   @Override
-   void close();
+
+    /**
+     * Unregister the candidate.
+     */
+    @Override
+    void close();
 }
index b8145be6c5f866961acc2c45e095ac4c6e77ae2f..9496f68c1f76eb23e8199f6e6e6bd927ff786896 100644 (file)
@@ -14,7 +14,11 @@ import javax.annotation.Nonnull;
  * A DTO that encapsulates an ownership change for an entity.
  *
  * @author Thomas Pantelis
+ *
+ * @deprecated Use org.opendaylight.mdsal.binding.api.clustering.EntityOwnershipChange or
+ *             org.opendaylight.mdsal.dom.api.clustering.DOMEntityOwnershipChange instead
  */
+@Deprecated
 public class EntityOwnershipChange {
     private final Entity entity;
     private final boolean wasOwner;
index b4eb44569b0d46116519bbcbd36c1ca257d32fef..2aa20b2352280300d993c98bb5df3064f5969254 100644 (file)
@@ -9,13 +9,18 @@
 package org.opendaylight.controller.md.sal.common.api.clustering;
 
 /**
- * An EntityOwnershipListener is a component that represents a listener for entity ownership changes
+ * An EntityOwnershipListener is a component that represents a listener for entity ownership changes.
+ *
+ * @deprecated Use org.opendaylight.mdsal.binding.api.clustering.EntityOwnershipListener or
+ *             org.opendaylight.mdsal.dom.api.clustering.DOMEntityOwnershipListener instead
  */
+@Deprecated
 public interface EntityOwnershipListener {
 
     /**
      * A notification that is generated when the ownership status of an entity changes.
      *
+     * <p>
      * The following outlines valid combinations of the ownership status flags in the EntityOwnershipChange
      * parameter and their meanings:
      * <ul>
index ff7ce5548e4698e395b9c41c810b4e5705fa7e42..db246f847e96142210c4860dc2e137cde5b522a1 100644 (file)
@@ -15,16 +15,20 @@ import org.opendaylight.yangtools.concepts.ObjectRegistration;
  * An EntityOwnershipListenerRegistration records a request to register a ownership status change listener for a
  * given Entity. Calling close on the registration will unregister listeners and future ownership changes will not
  * be delivered to the listener.
+ *
+ * @deprecated Use org.opendaylight.mdsal.binding.api.clustering.EntityOwnershipListenerRegistration or
+ *             org.opendaylight.mdsal.dom.api.clustering.DOMEntityOwnershipListenerRegistration instead
  */
+@Deprecated
 public interface EntityOwnershipListenerRegistration extends ObjectRegistration<EntityOwnershipListener> {
 
     /**
-     * Return the entity type that the listener was registered for
+     * Return the entity type that the listener was registered for.
      */
     @Nonnull String getEntityType();
 
     /**
-     * Unregister the listener
+     * Unregister the listener.
      */
     @Override
     void close();
index a042bf5ef2fdfd71ac2d9b82f87f641e95eca6da..07c93e780cdf0006f2e823891f5bd9126c226045 100644 (file)
@@ -21,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 {
 
     /**
index e461921df74e1e8e2baf10b27a6e6000fa3a3029..b98523501d82e9c1c660d61e7ce897726aaf3a1d 100644 (file)
@@ -11,7 +11,10 @@ package org.opendaylight.controller.md.sal.common.api.clustering;
  * A DTO that encapsulates ownership state for an entity.
  *
  * @author Thomas Pantelis
+ *
+ * @deprecated Use org.opendaylight.mdsal.common.api.clustering.EntityOwnershipState instead
  */
+@Deprecated
 public class EntityOwnershipState {
     private final boolean isOwner;
     private final boolean hasOwner;
diff --git a/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/clustering/AbstractEntityOwnershipCandidateRegistration.java b/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/clustering/AbstractEntityOwnershipCandidateRegistration.java
deleted file mode 100644 (file)
index a0f41c7..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2015 Brocade Communications Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.md.sal.common.impl.clustering;
-
-import com.google.common.base.Preconditions;
-import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.common.api.clustering.Entity;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipCandidateRegistration;
-import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
-
-/**
- * Abstract base class for an EntityOwnershipCandidateRegistration.
- *
- * @author Thomas Pantelis
- */
-public abstract class AbstractEntityOwnershipCandidateRegistration extends AbstractObjectRegistration<Entity>
-        implements EntityOwnershipCandidateRegistration {
-
-    protected AbstractEntityOwnershipCandidateRegistration(@Nonnull Entity entity) {
-        super(Preconditions.checkNotNull(entity, "entity cannot be null"));
-    }
-}
diff --git a/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/clustering/AbstractEntityOwnershipListenerRegistration.java b/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/clustering/AbstractEntityOwnershipListenerRegistration.java
deleted file mode 100644 (file)
index 77118a0..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2015 Brocade Communications Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.md.sal.common.impl.clustering;
-
-import com.google.common.base.Preconditions;
-import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipListener;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipListenerRegistration;
-import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
-
-/**
- * Abstract base class for an EntityOwnershipListenerRegistration.
- *
- * @author Thomas Pantelis
- */
-public abstract class AbstractEntityOwnershipListenerRegistration extends AbstractObjectRegistration<EntityOwnershipListener>
-        implements EntityOwnershipListenerRegistration {
-    private final String entityType;
-
-    protected AbstractEntityOwnershipListenerRegistration(@Nonnull EntityOwnershipListener listener,
-            @Nonnull String entityType) {
-        super(listener);
-        this.entityType = Preconditions.checkNotNull(entityType, "entityType cannot be null");
-    }
-
-    @Override
-    public String getEntityType() {
-        return entityType;
-    }
-}
index eebd31fd49b53e8691194641f7d537b9a708bfbf..cea6aca5bd5b5c422cc72098764a547d9299a714 100644 (file)
@@ -31,6 +31,7 @@ import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
  *
  * @author Thomas Pantelis
  */
+@Deprecated
 public class LegacyEntityOwnershipServiceAdapter implements EntityOwnershipService, AutoCloseable {
     private final DOMEntityOwnershipService domService;
 
index a32a494927dc450c4496afa8c11be684333d9ad4..ecfaf2c32299b24cc3a629043118b04b81a8ba43 100644 (file)
@@ -16,6 +16,7 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
+
 import com.google.common.base.Optional;
 import org.junit.Before;
 import org.junit.Test;
@@ -42,6 +43,7 @@ import org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipService;
  *
  * @author Thomas Pantelis
  */
+@Deprecated
 public class LegacyEntityOwnershipServiceAdapterTest {
     static Entity LEGACY_ENTITY = new Entity("foo", "bar");
     static DOMEntity DOM_ENTITY = new DOMEntity("foo", LEGACY_ENTITY.getId());