Deprecate the legacy API in favor of the new APIs in mdsal.
Change-Id: I819fe7e7006694a5912e4c324055df10d4a33d3d
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
/**
* 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;
}
/**
+ * 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
*/
* <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;
* 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();
}
* 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;
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>
* 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();
* 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 {
/**
* 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;
+++ /dev/null
-/*
- * 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"));
- }
-}
+++ /dev/null
-/*
- * 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;
- }
-}
*
* @author Thomas Pantelis
*/
+@Deprecated
public class LegacyEntityOwnershipServiceAdapter implements EntityOwnershipService, AutoCloseable {
private final DOMEntityOwnershipService domService;
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;
*
* @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());