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.mappingservice;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
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.mappingservice.rev150906.MappingOrigin;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.authkey.container.MappingAuthkey;
18 * Mapping Service Java API
20 * @author Florin Coras
24 public interface IMappingService {
29 * Table where mapping should be added
33 * Site that stores the mapping
37 void addMapping(MappingOrigin origin, Eid key, SiteId siteId, Object data);
40 * Retrieves mapping with given origin for the provided key. The lookup policy for the key is defined in the Mapping
44 * Table where the mapping should be looked up.
47 * @return Returns the object found in the Mapping System or null if nothing is found.
49 Object getMapping(MappingOrigin origin, Eid key);
52 * Retrieves mapping for given key.The lookup policy for the key is defined in the Mapping
57 * @return Returns the object found in the Mapping System or null if nothing is found.
59 Object getMapping(Eid key);
62 * Retrieves mapping with a Source/Dest policy. This method is meant to avoid the overhead of building
63 * LcafSourceDest addresses.
66 * Source key being looked up
68 * Destination key being looked up
69 * @return Returns the object found in the Mapping System or null if nothing is found.
71 Object getMapping(Eid srcKey, Eid dstKey);
77 * Table from where the mapping should be removed
81 void removeMapping(MappingOrigin origin, Eid key);
84 * Add authentication key
87 * The key for which the authentication key is added
89 * The authentication key
91 void addAuthenticationKey(Eid key, MappingAuthkey authKey);
94 * Retrieve authentication key
97 * The key for which the authentication key is being looked up.
98 * @return The authentication key.
100 MappingAuthkey getAuthenticationKey(Eid key);
103 * Remove authentication key
106 * Key for which the authentication key should be removed.
108 void removeAuthenticationKey(Eid key);
111 * Generic addition of data. Not stored in MD-SAL datastore!
114 * Table where data should be inserted
116 * The key where data should be inserted
118 * The subKey where data should be inserted
120 * The data to be stored
122 void addData(MappingOrigin origin, Eid key, String subKey, Object data);
125 * Generic retrieval of data
128 * Table from where the data should be read
130 * The key where the data is stored
132 * The subKey where data is stored
135 Object getData(MappingOrigin origin, Eid key, String subKey);
138 * Generic removal of data
141 * The table from where the data should be removed
143 * The key of the data to be removed
145 * The subKey of the data to be removed
147 void removeData(MappingOrigin origin, Eid key, String subKey);
150 * Configures Mapping Service mapping overwrite option. If set to true, mappings with the same key are overwritten,
151 * otherwise, mappings with the same key but from different xTR-IDs are all stored
154 * enables or disables mapping overwrite
156 void setMappingOverwrite(boolean overwrite);
159 * Configures Mapping Service mapping lookup policy option.
162 * the policy to be activated
164 void setLookupPolicy(int policy);
167 * Print all mappings. Used for testing, debugging and the karaf shell
169 * @return String consisting of all mappings
171 String printMappings();
174 * Cleans all cached mappings.Used for testing.
176 void cleanCachedMappings();