Interface P2PTail<LOCATOR>

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).
  • Method Details

    • getHops

      LOCATOR[] getHops()
      Retrieves the trail of peers already passed.
      Specified by:
      getHops in interface HopsAccessor<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 providing P2PMessage has already stopped over the given Peer.
      Parameters:
      aLocator - The locator of the Peer in question.
      Returns:
      True in case the according P2PMessage has already stopped over the Peer in question.