-
- Type Parameters:
LOCATOR
- The locator defines the type which identifies a source and a destination (or stop-overs) of aP2PMessage
.
- All Superinterfaces:
org.refcodes.mixin.DestinationAccessor<LOCATOR>
,HopsAccessor<LOCATOR>
,org.refcodes.mixin.SourceAccessor<LOCATOR>
- All Known Implementing Classes:
AbstractP2PHeader
public interface P2PHeader<LOCATOR> extends org.refcodes.mixin.SourceAccessor<LOCATOR>, org.refcodes.mixin.DestinationAccessor<LOCATOR>, HopsAccessor<LOCATOR>
TheP2PHeader
defines the least required attributes describing aP2PMessage
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.DestinationAccessor
org.refcodes.mixin.DestinationAccessor.DestinationMutator<DEST extends Object>, org.refcodes.mixin.DestinationAccessor.DestinationProperty<DEST extends Object>
-
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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
appendHop(LOCATOR aLocator)
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.
-
-
-
Method Detail
-
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
void appendHop(LOCATOR aLocator)
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
default boolean containsHop(LOCATOR aLocator)
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.
-
-