Move and split EntityOwnershipService common-api
[mdsal.git] / entityownership / mdsal-eos-common-spi / src / main / java / org / opendaylight / mdsal / common / api / clustering / AbstractGenericEntityOwnershipCandidateRegistration.java
diff --git a/entityownership/mdsal-eos-common-spi/src/main/java/org/opendaylight/mdsal/common/api/clustering/AbstractGenericEntityOwnershipCandidateRegistration.java b/entityownership/mdsal-eos-common-spi/src/main/java/org/opendaylight/mdsal/common/api/clustering/AbstractGenericEntityOwnershipCandidateRegistration.java
new file mode 100644 (file)
index 0000000..8f044a5
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016 Cisco 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.mdsal.common.api.clustering;
+
+import com.google.common.base.Preconditions;
+import javax.annotation.Nonnull;
+import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
+import org.opendaylight.yangtools.concepts.Path;
+
+/**
+ * Abstract base class for an EntityOwnershipCandidateRegistration.
+ *
+ * @param <P> the instance identifier path type
+ * @param <E> the GenericEntity type
+ */
+public abstract class AbstractGenericEntityOwnershipCandidateRegistration<P extends Path<P>, E extends GenericEntity<P>>
+        extends AbstractObjectRegistration<E>
+        implements GenericEntityOwnershipCandidateRegistration<P, E> {
+
+    protected AbstractGenericEntityOwnershipCandidateRegistration(@Nonnull final E entity) {
+        super(Preconditions.checkNotNull(entity, "entity cannot be null"));
+    }
+}
+