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.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkey;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
16 * Mapping System interface.
18 * @author Florin Coras
22 public interface IMappingSystem {
27 * Table where mapping should be added
33 * Select if mappings with the same key are merged
35 void addMapping(MappingOrigin origin, Eid key, Object data, boolean merge);
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 object found in the MappingSystem or null if nothing is found.
46 Object getMapping(Eid src, Eid dst);
49 * Retrieves mapping for the provided dst key.
52 * Destination Key to be looked up
53 * @return Returns the object found in the Mapping System or null if nothing is found.
55 Object getMapping(Eid dst);
58 * Retrieves mapping from table for provided key.
61 * Table where mapping should be looked up
64 * @return Returns the object found in the cache or null if nothing is found.
66 Object getMapping(MappingOrigin origin, Eid key);
69 * Retrieves widest negative prefix from table for provided key.
73 * @return Returns the prefix found in the cache or null if nothing is found.
75 Object getWidestNegativePrefix(Eid key);
78 * Update mapping registration.
81 * Table for mapping that should be updated
83 * The EID whose registration must be updated
85 * New timestamp for the mapping
87 void updateMappingRegistration(MappingOrigin origin, Eid key, Long timestamp);
93 * Table for mapping that should be removed
98 void removeMapping(MappingOrigin origin, Eid key);
101 * Add authentication key.
104 * The key for which the authentication key is added
106 * The authentication key
108 void addAuthenticationKey(Eid key, MappingAuthkey authKey);
111 * Retrieve authentication key.
114 * The key for which the authentication key is being looked up.
115 * @return The authentication key.
117 MappingAuthkey getAuthenticationKey(Eid key);
120 * Remove authentication key.
123 * Key for which the authentication key should be removed.
125 void removeAuthenticationKey(Eid key);
132 * Table for data that should be added
134 * The key for which data is inserted
136 * The subKey where data should be inserted
138 * The data to be stored
140 void addData(MappingOrigin origin, Eid key, String subKey, Object data);
143 * Generic retrieval of data.
146 * Table from where data should be retrieved
148 * The key where the data is stored
150 * The subKey where data is stored
153 Object getData(MappingOrigin origin, Eid key, String subKey);
157 * Generic removal of data.
160 * Table from where data should be removed
162 * The key of the data to be removed
164 * The subKey of the data to be removed
166 void removeData(MappingOrigin origin, Eid key, String subKey);
169 * Sets iterateMask. If set to true, longest prefix matching for IP keys is used.
175 void setIterateMask(boolean iterate);
178 * Configure overwrite policy. If set to true, mappings are overwritten.
183 void setOverwritePolicy(boolean overwrite);
186 * Print all mappings. Used for testing, debugging and the karaf shell.
188 * @return String consisting of all mappings
190 String printMappings();