Class AuthenticationKeyDataListener
- java.lang.Object
-
- org.opendaylight.lispflowmapping.southbound.lisp.AuthenticationKeyDataListener
-
- All Implemented Interfaces:
java.util.EventListener
,org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener<AuthenticationKey>
,org.opendaylight.mdsal.binding.api.DataTreeChangeListener<AuthenticationKey>
public class AuthenticationKeyDataListener extends java.lang.Object implements org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener<AuthenticationKey>
DataListener for all AuthenticationKey modification events.
-
-
Constructor Summary
Constructors Constructor Description AuthenticationKeyDataListener(org.opendaylight.mdsal.binding.api.DataBroker broker, AuthKeyDb akdb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
authKeysForEidsUnchanged(java.util.Map<EidLispAddressKey,EidLispAddress> eids, long timeout)
We maintain a HashMap with the update times of AuthenticationKey objects in the updatedEntries field.void
closeDataChangeListener()
void
onDataTreeChanged(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<AuthenticationKey>> changes)
-
-
-
Constructor Detail
-
AuthenticationKeyDataListener
public AuthenticationKeyDataListener(org.opendaylight.mdsal.binding.api.DataBroker broker, AuthKeyDb akdb)
-
-
Method Detail
-
closeDataChangeListener
public void closeDataChangeListener()
-
onDataTreeChanged
public void onDataTreeChanged(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<AuthenticationKey>> changes)
- Specified by:
onDataTreeChanged
in interfaceorg.opendaylight.mdsal.binding.api.DataTreeChangeListener<AuthenticationKey>
-
authKeysForEidsUnchanged
public boolean authKeysForEidsUnchanged(java.util.Map<EidLispAddressKey,EidLispAddress> eids, long timeout)
We maintain a HashMap with the update times of AuthenticationKey objects in the updatedEntries field. We keep entries in the HashMap for the Map-Register cache timeout interval, and lazy remove them afterwards. As a result the same EID will be considered updated during that interval, even on subsequent queries. This is necessary because more than one xTR may register the same EID, and to avoid complexity we don't store origin information. The performance trade-off is not significant, because during a typical cache timeout the same xTR will send only a few registration packets (2 for the default value of 90s, when UDP Map-Registers are sent at 1 minute intervals).- Parameters:
eids
- List of EIDs to checktimeout
- MapRegister cache timeout value- Returns:
- false if any of the EIDs in the eids list was updated in the last timout period, true otherwise
-
-