Class SearchMessageSelector
java.lang.Object
net.i2p.router.networkdb.kademlia.SearchMessageSelector
- All Implemented Interfaces:
MessageSelector
Check to see the message is a reply from the peer regarding the current
search
-
Constructor Summary
ConstructorsConstructorDescriptionSearchMessageSelector(RouterContext context, RouterInfo peer, long expiration, SearchState state) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the selector should still keep searching for further matches.longReturns the # of milliseconds since the epoch after which this selector should stop searching for matches.booleanisMatch(I2NPMessage message) Returns true if the received message matches the selector.toString()
-
Constructor Details
-
SearchMessageSelector
public SearchMessageSelector(RouterContext context, RouterInfo peer, long expiration, SearchState state)
-
-
Method Details
-
toString
-
continueMatching
public boolean continueMatching()Description copied from interface:MessageSelectorReturns true if the selector should still keep searching for further matches. This is called only if isMatch() returns true. If this returns true, isMatch() will not be called again.- Specified by:
continueMatchingin interfaceMessageSelector
-
getExpiration
public long getExpiration()Description copied from interface:MessageSelectorReturns the # of milliseconds since the epoch after which this selector should stop searching for matches. At some time after expiration, if continueMatching() has not returned false, the job specified by OutNetMessage.getOnFailedReplyJob() will be run for every OutNetMessage associated with this selector (by OutboundMessageRegistry).- Specified by:
getExpirationin interfaceMessageSelector
-
isMatch
Description copied from interface:MessageSelectorReturns true if the received message matches the selector. If this returns true, the job specified by OutNetMessage.getOnReplyJob() will be run for every OutNetMessage associated with this selector (by InNetMessagePool), after calling setMessage() for that ReplyJob. WARNING this is called from within OutboundMessageSelector.getOriginalMessages() inside a lock and can lead to deadlocks if the selector does too much in isMatch(). Until the lock is removed, take care to keep it simple.- Specified by:
isMatchin interfaceMessageSelector
-