Bug 9116: Add getChildPrefixes() method to caches
[lispflowmapping.git] / mappingservice / api / src / main / java / org / opendaylight / lispflowmapping / interfaces / mapcache / IMapCache.java
index ccf080486647ec3277eec2bb94399dbdb6e4b431..6ddf4af4d650b4f1f4515e3e66cae0c19cdbec59 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Cisco Systems, Inc.  All rights reserved.
+ * Copyright (c) 2015, 2016 Cisco Systems, Inc.  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,
@@ -8,8 +8,8 @@
 
 package org.opendaylight.lispflowmapping.interfaces.mapcache;
 
+import java.util.Set;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.authkey.container.MappingAuthkey;
 
 /**
  * Map-cache interface.
@@ -24,14 +24,10 @@ public interface IMapCache {
      *
      * @param key
      *            Key of the mapping
-     * @param data
+     * @param value
      *            Value to be stored
-     * @param shouldOverwrite
-     *            Select if mappings with the same key are overwritten
-     * @param merge
-     *            Select if mappings with the same key are merged
      */
-    void addMapping(Eid key, Object data, boolean shouldOverwrite, boolean merge);
+    void addMapping(Eid key, Object value);
 
     /**
      * Retrieves mapping for the provided srcKey and dstKey.
@@ -54,52 +50,21 @@ public interface IMapCache {
     Eid getWidestNegativeMapping(Eid key);
 
     /**
-     * Remove mapping.
-     *
-     * @param key
-     *            Key to be removed
-     * @param overwrite
-     *            Select if mappings with the same key were overwritten on store
-     *
-     */
-    void removeMapping(Eid key, boolean overwrite);
-
-    /**
-     * Add authentication key.
-     *
-     * @param key
-     *            The key for which the authentication key is added
-     * @param authKey
-     *            The authentication key
-     */
-    void addAuthenticationKey(Eid key, MappingAuthkey authKey);
-
-    /**
-     * Retrieve authentication key.
+     * Retrieves the subtree of a prefix.
      *
      * @param key
-     *            The key for which the authentication key is being looked up.
-     * @return The authentication key.
+     *            Key to be looked up
+     * @return The set of prefixes in the subtree for the prefix
      */
-    MappingAuthkey getAuthenticationKey(Eid key);
+    Set<Eid> getSubtree(Eid key);
 
     /**
-     * Remove authentication key.
-     *
-     * @param key
-     *            Key for which the authentication key should be removed.
-     */
-    void removeAuthenticationKey(Eid key);
-
-    /**
-     * Update mapping registration.
+     * Remove mapping.
      *
      * @param key
-     *            The EID whose registration must be updated
-     * @param timestamp
-     *            New timestamp for the mapping
+     *            Key to be removed
      */
-    void updateMappingRegistration(Eid key, Long timestamp);
+    void removeMapping(Eid key);
 
     /**
      * Add data for key.
@@ -140,4 +105,11 @@ public interface IMapCache {
      * @return a String consisting of all the mappings in the cache
      */
     String printMappings();
+
+    /**
+     * Print mappings in cache in a human friendly format.
+     *
+     * @return a String consisting of all the mappings in the cache
+     */
+    String prettyPrintMappings();
 }