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 9766889..67286e3 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 7cb672e..e301130 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 e59aefb..487b192 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 b8145be..9496f68 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 b4eb445..2aa20b2 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 ff7ce55..db246f8 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 a042bf5..07c93e7 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 e461921..b985235 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 a32a494..ecfaf2c 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());

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.