From 0c877a510c8da62881b73ceff8b1ecdeaf3f8cd2 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Fri, 19 May 2017 06:58:24 -0400 Subject: [PATCH] Deprecate legacy EOS API classes Deprecate the legacy API in favor of the new APIs in mdsal. Change-Id: I819fe7e7006694a5912e4c324055df10d4a33d3d Signed-off-by: Tom Pantelis --- .../CandidateAlreadyRegisteredException.java | 4 +++ .../md/sal/common/api/clustering/Entity.java | 4 +++ .../EntityOwnershipCandidateRegistration.java | 15 +++++--- .../api/clustering/EntityOwnershipChange.java | 4 +++ .../clustering/EntityOwnershipListener.java | 7 +++- .../EntityOwnershipListenerRegistration.java | 8 +++-- .../clustering/EntityOwnershipService.java | 4 +++ .../api/clustering/EntityOwnershipState.java | 3 ++ ...tEntityOwnershipCandidateRegistration.java | 27 -------------- ...ctEntityOwnershipListenerRegistration.java | 35 ------------------- .../LegacyEntityOwnershipServiceAdapter.java | 1 + ...gacyEntityOwnershipServiceAdapterTest.java | 2 ++ 12 files changed, 44 insertions(+), 70 deletions(-) delete mode 100644 opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/clustering/AbstractEntityOwnershipCandidateRegistration.java delete mode 100644 opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/clustering/AbstractEntityOwnershipListenerRegistration.java diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/CandidateAlreadyRegisteredException.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/CandidateAlreadyRegisteredException.java index 976688946f..67286e3d48 100644 --- a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/CandidateAlreadyRegisteredException.java +++ b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/CandidateAlreadyRegisteredException.java @@ -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 */ diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/Entity.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/Entity.java index 7cb672e9b0..e301130235 100644 --- a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/Entity.java +++ b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/Entity.java @@ -34,7 +34,11 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; *

* 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; diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipCandidateRegistration.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipCandidateRegistration.java index e59aefb9c4..487b19251b 100644 --- a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipCandidateRegistration.java +++ b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipCandidateRegistration.java @@ -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 { - /** - * Unregister the candidate - */ - @Override - void close(); + + /** + * Unregister the candidate. + */ + @Override + void close(); } diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipChange.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipChange.java index b8145be6c5..9496f68c1f 100644 --- a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipChange.java +++ b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipChange.java @@ -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; diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipListener.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipListener.java index b4eb44569b..2aa20b2352 100644 --- a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipListener.java +++ b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/EntityOwnershipListener.java @@ -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. * + *

* The following outlines valid combinations of the ownership status flags in the EntityOwnershipChange * parameter and their meanings: *