/*
- * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
+ * Copyright (c) 2015, 2017 Cisco Systems, Inc. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
package org.opendaylight.lispflowmapping.interfaces.mappingservice;
+import java.util.Set;
+import org.opendaylight.lispflowmapping.interfaces.dao.Subscriber;
import org.opendaylight.lispflowmapping.lisp.type.MappingData;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.XtrId;
*/
void addMapping(MappingOrigin origin, Eid key, SiteId siteId, MappingData mapping);
+ /**
+ * Generate and add a negative mapping entry originated from the southbound, and return the generated mapping.
+ *
+ * @param key
+ * Key of the mapping
+ * @return Returns the generated negative mapping (which is never null).
+ */
+ MappingData addNegativeMapping(Eid key);
+
/**
* Retrieves mapping with given origin for the provided key. The lookup policy for the key is defined in the Mapping
* System.
*/
Eid getWidestNegativePrefix(Eid key);
+ /**
+ * Retrieves the subtree of a maskable prefix from the given map-cache.
+ *
+ * @param origin
+ * Table where the key should be looked up
+ * @param key
+ * Key to be looked up
+ * @return The child prefixes of the prefix, including the prefix itself if present
+ */
+ Set<Eid> getSubtree(MappingOrigin origin, Eid key);
+
/**
* Refresh southbound mapping registration timestamp.
*
*/
void addAuthenticationKey(Eid key, MappingAuthkey authKey);
+
+ /**
+ * Subscribe a Subscriber to receive updates about mapping changes for an EID.
+ *
+ * @param subscriber
+ * The Subscriber object with information about the subscriber
+ * @param subscribedEid
+ * The EID for which the subscriber will receive updates
+ */
+ void subscribe(Subscriber subscriber, Eid subscribedEid);
+
+ /**
+ * Retrieves the subscribers for an EID.
+ *
+ * @param eid
+ * The EID to be looked up
+ * @return
+ * The set of subscribers for the EID
+ */
+ Set<Subscriber> getSubscribers(Eid eid);
+
/**
* Retrieve authentication key.
*
*/
void removeData(MappingOrigin origin, Eid key, String subKey);
+ /**
+ * Returns the parent prefix for given key.
+ *
+ * @param key
+ * The key which parent is to be returned.
+ * @return The parent perfix of a specific key.
+ */
+ Eid getParentPrefix(Eid key);
+
/**
* Configures Mapping Service mapping merge option. If set to false, mappings with the same key are overwritten,
* otherwise, mappings with the same key but from different xTR-IDs are all stored.
*/
String printMappings();
+ /**
+ * Print mappings in cache in a human friendly format.
+ *
+ * @return a String consisting of all the mappings in the cache
+ */
+ String prettyPrintMappings();
+
/**
* Print all authentication keys. Used for testing, debugging and the karaf shell.
*
*/
String printKeys();
+ /**
+ * Print keys in cache in a human friendly format.
+ *
+ * @return a String consisting of all the keys in the cache
+ */
+ String prettyPrintKeys();
+
/**
* Cleans all cached mappings.Used for testing.
*/
* @param isMaster
* is|isn't master
*/
- void setIsMaster(final boolean isMaster);
+ void setIsMaster(boolean isMaster);
/**
* Get cluster master status.