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.lispflowmapping.lisp.type.MappingData;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkey;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
18 * Mapping System interface.
20 * @author Florin Coras
24 public interface IMappingSystem {
29 * Table where mapping should be added
33 * Mapping to be stored
35 void addMapping(MappingOrigin origin, Eid key, MappingData mapping);
38 * Retrieves mapping for the provided src and dst key.
41 * Source Key to be looked up
43 * Destination Key to be looked up
44 * @return Returns the mapping found in the MappingSystem or null if nothing is found.
46 MappingData getMapping(Eid src, Eid dst);
49 * Retrieves mapping for the provided dst key.
52 * Destination Key to be looked up
53 * @return Returns the mapping found in the Mapping System or null if nothing is found.
55 MappingData getMapping(Eid dst);
58 * Retrieves mapping for the provided dst key for a particular xtr id.
60 * Source Key to be looked up.
62 * Destination Key to be looked up.
64 * Xtr Id for which this look to be done. If null, this method works like
65 * regular getMapping(src, dst)
66 * @return Returns the mapping found in the simple map cache or null if nothing is found.
68 MappingData getMapping(Eid src, Eid dst, XtrId xtrId);
71 * Retrieves mapping from table for provided key.
74 * Table where mapping should be looked up
77 * @return Returns the mapping found in the cache or null if nothing is found.
79 MappingData getMapping(MappingOrigin origin, Eid key);
82 * Retrieves widest negative prefix from table for provided key.
86 * @return Returns the prefix found in the cache or null if nothing is found.
88 Eid getWidestNegativePrefix(Eid key);
91 * Refresh southbound mapping registration timestamp.
94 * The EID whose registration must be refreshed
96 * xTR-ID of the mapping to be refreshed
98 * New timestamp for the mapping
100 void refreshMappingRegistration(Eid key, XtrId xtrId, Long timestamp);
106 * Table for mapping that should be removed
111 void removeMapping(MappingOrigin origin, Eid key);
114 * Add authentication key.
117 * The key for which the authentication key is added
119 * The authentication key
121 void addAuthenticationKey(Eid key, MappingAuthkey authKey);
124 * Retrieve authentication key.
127 * The key for which the authentication key is being looked up.
128 * @return The authentication key.
130 MappingAuthkey getAuthenticationKey(Eid key);
133 * Remove authentication key.
136 * Key for which the authentication key should be removed.
138 void removeAuthenticationKey(Eid key);
145 * Table for data that should be added
147 * The key for which data is inserted
149 * The subKey where data should be inserted
151 * The data to be stored
153 void addData(MappingOrigin origin, Eid key, String subKey, Object data);
156 * Generic retrieval of data.
159 * Table from where data should be retrieved
161 * The key where the data is stored
163 * The subKey where data is stored
166 Object getData(MappingOrigin origin, Eid key, String subKey);
170 * Generic removal of data.
173 * Table from where data should be removed
175 * The key of the data to be removed
177 * The subKey of the data to be removed
179 void removeData(MappingOrigin origin, Eid key, String subKey);
182 * Returns the parent prefix for given key.
185 * The key which parent is to be returned.
186 * @return The parent perfix of a specific key.
188 Eid getParentPrefix(Eid key);
191 * Sets iterateMask. If set to true, longest prefix matching for IP keys is used.
197 void setIterateMask(boolean iterate);
200 * Configure merge policy. If set to true, mappings are merged.
202 * @param mappingMerge
205 void setMappingMerge(boolean mappingMerge);
208 * Print all mappings. Used for testing, debugging and the karaf shell.
210 * @return String consisting of all mappings
212 String printMappings();
215 * Print all authentication keys. Used for testing, debugging and the karaf shell.
217 * @return String consisting of all mappings
222 * Set cluster master status.
227 void setIsMaster(final boolean isMaster);
230 * Get cluster master status.