package org.opendaylight.lispflowmapping.interfaces.dao;
-import java.util.Map;
import java.util.AbstractMap.SimpleImmutableEntry;
+import java.util.Map;
+import java.util.Set;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
public interface ILispDAO {
Object getSpecific(Object key, String valueKey);
/**
- * Get the entries from the DAO
+ * Get the entries from the DAO.
*
* @param key
* The key to be looked up as exact match.
Map<String, Object> get(Object key);
/**
- * Get value for longest prefix match from the DAO
+ * Get value for longest prefix match from the DAO.
*
* @param key
* The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
Map<String, Object> getBest(Object key);
/**
- * Get longest prefix match and value from the DAO
+ * Get longest prefix match and value from the DAO.
*
* @param key
* The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized
SimpleImmutableEntry<Eid, Map<String, ?>> getBestPair(Object key);
/**
- * Get widest negative prefix
+ * Look up the covering prefix for the argument, but exclude the argument itself, so the result is always less
+ * specific than the lookup key.
+ *
+ * @param key
+ * The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
+ * @return The covering prefix.
+ */
+ Eid getCoveringLessSpecific(Eid key);
+
+ /**
+ * Get parent prefix.
+ *
+ * @param key
+ * The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
+ * @return The parent prefix of the longest prefix match for the key.
+ */
+ Eid getParentPrefix(Eid key);
+
+ /**
+ * Get sibling prefix.
+ *
+ * @param key
+ * The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
+ * @return The sibling prefix of the longest prefix match for the key.
+ */
+ Eid getSiblingPrefix(Eid key);
+
+ /**
+ * Get virtual parent sibling prefix.
+ *
+ * @param key
+ * The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
+ * @return The longest prefix match node's virtual parent's sibling or null if nothing is found.
+ */
+ Eid getVirtualParentSiblingPrefix(Eid key);
+
+ /**
+ * Get widest negative prefix.
*
* @param key
* The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
Eid getWidestNegativePrefix(Eid key);
/**
- * Enumerate all the entries from the DAO
+ * Get the subtree of the given prefix.
+ *
+ * @param key
+ * The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
+ * @return The set of EIDs that part of the subtree of the given EID.
+ */
+ Set<Eid> getSubtree(Eid key);
+
+ /**
+ * Enumerate all the entries from the DAO.
*
* @param visitor
* The visitor object.
void getAll(IRowVisitor visitor);
/**
- * Remove an entry from the DAO
+ * Remove an entry from the DAO.
*
* @param key
* The key of the entry to delete
void remove(Object key);
/**
- * Remove an entry from the DAO
+ * Remove an entry from the DAO.
*
* @param key
* The key of the entry
* @return The inserted table
*/
ILispDAO putNestedTable(Object key, String valueKey);
+
+ /**
+ * Check if the DAO is empty.
+ *
+ * @return true if empty
+ */
+ boolean isEmpty();
}