2 * Copyright (c) 2015, 2016 Cisco Systems, Inc. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.lispflowmapping.interfaces.mapcache;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
14 * Map-cache interface.
16 * @author Florin Coras
20 public interface IMapCache {
29 void addMapping(Eid key, Object value);
32 * Retrieves mapping for the provided srcKey and dstKey.
35 * Source Key to be looked up
37 * Destination Key to be looked up
38 * @return Returns the object found in the cache or null if nothing is found.
40 Object getMapping(Eid srcKey, Eid dstKey);
43 * Retrieves widest negative prefix.
46 * Source Key to be looked up
47 * @return Returns the widest negative prefix or null if nothing is found.
49 Eid getWidestNegativeMapping(Eid key);
57 void removeMapping(Eid key);
63 * The key for which data is inserted
65 * The subKey where data should be inserted
67 * The data to be stored
69 void addData(Eid key, String subKey, Object data);
72 * Generic retrieval of data.
75 * The key where the data is stored
77 * The subKey where data is stored
80 Object getData(Eid key, String subKey);
83 * Generic removal of data.
86 * The key of the data to be removed
88 * The subKey of the data to be removed
90 void removeData(Eid key, String subKey);
93 * Print mappings in cache. Used for testing, debugging and the karaf shell.
95 * @return a String consisting of all the mappings in the cache
97 String printMappings();
100 * Print mappings in cache in a human friendly format.
102 * @return a String consisting of all the mappings in the cache
104 String prettyPrintMappings();