2 * Copyright (c) 2015 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;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.authkey.container.MappingAuthkey;
17 * @author Florin Coras
21 public interface IMapCache {
29 * @param shouldOverwrite
30 * Select if mappings with the same key are overwritten
32 * Select if mappings with the same key are merged
34 void addMapping(Eid key, Object data, boolean shouldOverwrite, boolean merge);
37 * Retrieves mapping for the provided srcKey and dstKey.
40 * Source Key to be looked up
42 * Destination Key to be looked up
43 * @return Returns the object found in the cache or null if nothing is found.
45 Object getMapping(Eid srcKey, Eid dstKey);
53 * Select if mappings with the same key were overwritten on store
56 void removeMapping(Eid key, boolean overwrite);
59 * Add authentication key
62 * The key for which the authentication key is added
64 * The authentication key
66 void addAuthenticationKey(Eid key, MappingAuthkey authKey);
69 * Retrieve authentication key
72 * The key for which the authentication key is being looked up.
73 * @return The authentication key.
75 MappingAuthkey getAuthenticationKey(Eid key);
78 * Remove authentication key
81 * Key for which the authentication key should be removed.
83 void removeAuthenticationKey(Eid key);
86 * Update key registration
89 * The key whose registration must be updated
91 void updateMappingRegistration(Eid key);
97 * The key for which data is inserted
99 * The subKey where data should be inserted
101 * The data to be stored
103 void addData(Eid key, String subKey, Object data);
106 * Generic retrieval of data
109 * The key where the data is stored
111 * The subKey where data is stored
114 Object getData(Eid key, String subKey);
117 * Generic removal of data
120 * The key of the data to be removed
122 * The subKey of the data to be removed
124 void removeData(Eid key, String subKey);
127 * Print mappings in cache. Used for testing, debugging and the karaf shell
129 * @return a String consisting of all the mappings in the cache
131 String printMappings();