/*
- * 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,
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
+ * Map-cache interface.
*
* @author Florin Coras
*
public interface IMapCache {
/**
- * Add mapping
+ * Add mapping.
*
* @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.
Object getMapping(Eid srcKey, Eid dstKey);
/**
- * 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 widest negative prefix.
*
* @param key
- * The key for which the authentication key is being looked up.
- * @return The authentication key.
+ * Source Key to be looked up
+ * @return Returns the widest negative prefix or null if nothing is found.
*/
- MappingAuthkey getAuthenticationKey(Eid key);
+ Eid getWidestNegativeMapping(Eid key);
/**
- * Remove authentication key
+ * Retrieves the subtree of a prefix.
*
* @param key
- * Key for which the authentication key should be removed.
+ * Key to be looked up
+ * @return The set of prefixes in the subtree for the prefix
*/
- void removeAuthenticationKey(Eid key);
+ Set<Eid> getSubtree(Eid key);
/**
- * Update key registration
+ * Remove mapping.
*
* @param key
- * The key whose registration must be updated
+ * Key to be removed
*/
- void updateMappingRegistration(Eid key);
+ void removeMapping(Eid key);
/**
- * Add data for key
+ * Add data for key.
*
* @param key
* The key for which data is inserted
void addData(Eid key, String subKey, Object data);
/**
- * Generic retrieval of data
+ * Generic retrieval of data.
*
* @param key
* The key where the data is stored
Object getData(Eid key, String subKey);
/**
- * Generic removal of data
+ * Generic removal of data.
*
* @param key
* The key of the data to be removed
void removeData(Eid key, String subKey);
/**
- * Print mappings in cache. Used for testing, debugging and the karaf shell
+ * Print mappings in cache. Used for testing, debugging and the karaf shell.
*
* @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();
}