Bug 9116: SMR children of a prefix too
[lispflowmapping.git] / mappingservice / api / src / main / java / org / opendaylight / lispflowmapping / interfaces / mapcache / ILispMapCache.java
1 /*
2  * Copyright (c) 2016, 2017 Cisco Systems, Inc.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.lispflowmapping.interfaces.mapcache;
9
10 import java.util.List;
11 import java.util.Set;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.inet.binary.types.rev160303.IpAddressBinary;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
15
16 /**
17  * LISP southbound control protocol specific additions to the map-cache
18  * interface.
19  *
20  * @author Lorand Jakab
21  *
22  */
23 public interface ILispMapCache extends IMapCache {
24     /**
25      * Add mapping.
26      *
27      * @param key
28      *            Key of the mapping
29      * @param value
30      *            Mapping to be stored
31      * @param sourceRlocs
32      *            The set of RLOCs from all registrations. Used for merging
33      */
34     void addMapping(Eid key, Object value, Set<IpAddressBinary> sourceRlocs);
35
36     /**
37      * Add mapping.
38      *
39      * @param key
40      *            Key of the mapping
41      * @param xtrId
42      *            xTR-ID of the mapping
43      * @param value
44      *            Mapping to be stored
45      */
46     void addMapping(Eid key, XtrId xtrId, Object value);
47
48     /**
49      * Retrieves mapping for the provided srcKey, dstKey and a XtrId.
50      *
51      * @param key
52      *            Key to be looked up
53      * @param xtrId
54      *            xTR-ID for which look-up to be done
55      * @return Returns the mapping found in the cache
56      */
57     Object getMapping(Eid key, XtrId xtrId);
58
59     /**
60      * Remove mapping.
61      *
62      * @param key
63      *            Key to be removed
64      * @param xtrId
65      *            xTR-ID of the mapping to be removed
66      */
67     void removeMapping(Eid key, XtrId xtrId);
68
69     /**
70      * Retrieve all xTR-ID sub-mappings for an EID. Used for merging logic.
71      *
72      * @param key
73      *            Key to be looked up
74      * @return The list of Objects which should be mappings
75      */
76     List<Object> getAllXtrIdMappings(Eid key);
77
78     /**
79      * Batch remove several xTR-ID sub-mappings under a certain key.
80      *
81      * <p>This is a performance optimization, since interactive calls to
82      * removeMapping() would result in LPM lookups of the key for each call.
83      * With this method, only one such lookup is performed.</p>
84      *
85      * @param key
86      *            Key to be looked up
87      * @param xtrIds
88      *            List of xTR-IDs that need to be removed
89      */
90     void removeXtrIdMappings(Eid key, List<XtrId> xtrIds);
91
92     /**
93      * Look up the covering prefix for the argument, but exclude the argument itself, so the result is always less
94      * specific than the lookup key.
95      *
96      * @param key
97      *            The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
98      * @return The covering prefix.
99      */
100     Eid getCoveringLessSpecific(Eid key);
101
102     /**
103      * Returns the parent prefix for given key.
104      *
105      * @param key
106      *            The key for which parent is to be returned.
107      * @return The parent prefix of a specific key.
108      */
109     Eid getParentPrefix(Eid key);
110
111     /**
112      * Returns the sibling prefix for given key.
113      *
114      * @param key
115      *            The key for which sibling is to be returned.
116      * @return The sibling prefix of a specific key.
117      */
118     Eid getSiblingPrefix(Eid key);
119
120     /**
121      * Returns the virtual parent sibling prefix for given key.
122      *
123      * @param key
124      *            The key for which virtual parent sibling is to be returned.
125      * @return The virtual parent sibling prefix of a specific key.
126      */
127     Eid getVirtualParentSiblingPrefix(Eid key);
128 }