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.XtrId;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkey;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
17 * Mapping System interface.
19 * @author Florin Coras
23 public interface IMappingSystem {
28 * Table where mapping should be added
34 * Select if mappings with the same key are merged
36 void addMapping(MappingOrigin origin, Eid key, Object data, boolean merge);
39 * Retrieves mapping for the provided src and dst key.
42 * Source Key to be looked up
44 * Destination Key to be looked up
45 * @return Returns the object found in the MappingSystem or null if nothing is found.
47 Object getMapping(Eid src, Eid dst);
50 * Retrieves mapping for the provided dst key.
53 * Destination Key to be looked up
54 * @return Returns the object found in the Mapping System or null if nothing is found.
56 Object getMapping(Eid dst);
59 * Retrieves mapping for the provided dst key for a particular xtr id.
61 * Source Key to be looked up.
63 * Destination Key to be looked up.
65 * Xtr Id for which this look to be done. If null, this method works like
66 * regular getMapping(src, dst)
67 * @return Returns the object found in the simple map cache or null if nothing is found.
69 Object getMapping(Eid src, Eid dst, XtrId xtrId);
72 * Retrieves mapping from table for provided key.
75 * Table where mapping should be looked up
78 * @return Returns the object found in the cache or null if nothing is found.
80 Object getMapping(MappingOrigin origin, Eid key);
83 * Retrieves widest negative prefix from table for provided key.
87 * @return Returns the prefix found in the cache or null if nothing is found.
89 Object getWidestNegativePrefix(Eid key);
92 * Update mapping registration.
95 * Table for mapping that should be updated
97 * The EID whose registration must be updated
99 * New timestamp for the mapping
101 void updateMappingRegistration(MappingOrigin origin, Eid key, Long timestamp);
107 * Table for mapping that should be removed
112 void removeMapping(MappingOrigin origin, Eid key);
115 * Add authentication key.
118 * The key for which the authentication key is added
120 * The authentication key
122 void addAuthenticationKey(Eid key, MappingAuthkey authKey);
125 * Retrieve authentication key.
128 * The key for which the authentication key is being looked up.
129 * @return The authentication key.
131 MappingAuthkey getAuthenticationKey(Eid key);
134 * Remove authentication key.
137 * Key for which the authentication key should be removed.
139 void removeAuthenticationKey(Eid key);
146 * Table for data that should be added
148 * The key for which data is inserted
150 * The subKey where data should be inserted
152 * The data to be stored
154 void addData(MappingOrigin origin, Eid key, String subKey, Object data);
157 * Generic retrieval of data.
160 * Table from where data should be retrieved
162 * The key where the data is stored
164 * The subKey where data is stored
167 Object getData(MappingOrigin origin, Eid key, String subKey);
171 * Generic removal of data.
174 * Table from where data should be removed
176 * The key of the data to be removed
178 * The subKey of the data to be removed
180 void removeData(MappingOrigin origin, Eid key, String subKey);
183 * Sets iterateMask. If set to true, longest prefix matching for IP keys is used.
189 void setIterateMask(boolean iterate);
192 * Configure overwrite policy. If set to true, mappings are overwritten.
197 void setOverwritePolicy(boolean overwrite);
200 * Print all mappings. Used for testing, debugging and the karaf shell.
202 * @return String consisting of all mappings
204 String printMappings();
207 * Set cluster master status.
212 void setIsMaster(final boolean isMaster);
215 * Get cluster master status.