Allow passing of delay to the EntityOwnerElectionStrategy
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / entityownership / EntityOwnersModel.java
index 0be765000f9c295951efb03da1078b0cd87797b7..205763a00060b9b903c1d95b879fd0c4e22e25d9 100644 (file)
@@ -30,7 +30,7 @@ import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableOr
  *
  * @author Thomas Pantelis
  */
-final class EntityOwnersModel {
+public final class EntityOwnersModel {
     static final  QName ENTITY_QNAME = org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.
             md.sal.clustering.entity.owners.rev150804.entity.owners.entity.type.Entity.QNAME;
     static final QName CANDIDATE_NAME_QNAME = QName.create(Candidate.QNAME, "name");
@@ -111,10 +111,10 @@ final class EntityOwnersModel {
                 ImmutableNodes.leafNode(ENTITY_OWNER_QNAME, owner)).build();
     }
 
-    static String entityTypeFromEntityPath(YangInstanceIdentifier entityPath){
+    public static String entityTypeFromEntityPath(YangInstanceIdentifier entityPath){
         YangInstanceIdentifier parent = entityPath;
         while(!parent.isEmpty()) {
-            if (ENTITY_TYPE_QNAME.equals(parent.getLastPathArgument().getNodeType())) {
+            if (EntityType.QNAME.equals(parent.getLastPathArgument().getNodeType())) {
                 YangInstanceIdentifier.NodeIdentifierWithPredicates entityTypeLastPathArgument = (YangInstanceIdentifier.NodeIdentifierWithPredicates) parent.getLastPathArgument();
                 return (String) entityTypeLastPathArgument.getKeyValues().get(ENTITY_TYPE_QNAME);
             }