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;
15 * Map-cache interface.
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);
48 * Retrieves widest negative prefix.
51 * Source Key to be looked up
52 * @return Returns the widest negative prefix or null if nothing is found.
54 Eid getWidestNegativeMapping(Eid key);
62 * Select if mappings with the same key were overwritten on store
65 void removeMapping(Eid key, boolean overwrite);
68 * Add authentication key.
71 * The key for which the authentication key is added
73 * The authentication key
75 void addAuthenticationKey(Eid key, MappingAuthkey authKey);
78 * Retrieve authentication key.
81 * The key for which the authentication key is being looked up.
82 * @return The authentication key.
84 MappingAuthkey getAuthenticationKey(Eid key);
87 * Remove authentication key.
90 * Key for which the authentication key should be removed.
92 void removeAuthenticationKey(Eid key);
95 * Update mapping registration.
98 * The EID whose registration must be updated
100 * New timestamp for the mapping
102 void updateMappingRegistration(Eid key, Long timestamp);
108 * The key for which data is inserted
110 * The subKey where data should be inserted
112 * The data to be stored
114 void addData(Eid key, String subKey, Object data);
117 * Generic retrieval of data.
120 * The key where the data is stored
122 * The subKey where data is stored
125 Object getData(Eid key, String subKey);
128 * Generic removal of data.
131 * The key of the data to be removed
133 * The subKey of the data to be removed
135 void removeData(Eid key, String subKey);
138 * Print mappings in cache. Used for testing, debugging and the karaf shell.
140 * @return a String consisting of all the mappings in the cache
142 String printMappings();