- Type Parameters:
LOCATOR
- Defines the type of the locators identifying a peer.
- All Superinterfaces:
HopsAccessor<LOCATOR>
,org.refcodes.mixin.SourceAccessor<LOCATOR>
- All Known Implementing Classes:
AbstractP2PTail
public interface P2PTail<LOCATOR>
extends org.refcodes.mixin.SourceAccessor<LOCATOR>, HopsAccessor<LOCATOR>
The
P2PTail
describes the dynamic attributes required during dispatch
of a P2PMessage
(a tail is modified during dispatch by having the
visited hops appended).-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.p2p.HopsAccessor
HopsAccessor.HopsBuilder<LOCATOR,
B extends HopsAccessor.HopsBuilder<LOCATOR, B>>, HopsAccessor.HopsMutator<LOCATOR>, HopsAccessor.HopsProperty<LOCATOR> -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a stop-over peer, being the peer which received the message for dispatching to the next peer.default boolean
containsHop
(LOCATOR aLocator) Tests whether the providingP2PMessage
has already stopped over the givenPeer
.LOCATOR[]
getHops()
Retrieves the trail of peers already passed.Methods inherited from interface org.refcodes.mixin.SourceAccessor
getSource
-
Method Details
-
getHops
LOCATOR[] getHops()Retrieves the trail of peers already passed.- Specified by:
getHops
in interfaceHopsAccessor<LOCATOR>
- Returns:
- The trail of peers already passed (in order to avoid turning circles when determining the hop count).
-
appendHop
Adds a stop-over peer, being the peer which received the message for dispatching to the next peer. The stop-over will be prepended to the trail of peers.- Parameters:
aLocator
- the stop-over peer while dispatching the message.
-
containsHop
Tests whether the providingP2PMessage
has already stopped over the givenPeer
.- Parameters:
aLocator
- The locator of thePeer
in question.- Returns:
- True in case the according
P2PMessage
has already stopped over thePeer
in question.
-