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

    Nested classes/interfaces inherited from interface org.refcodes.mixin.SourceAccessor

    org.refcodes.mixin.SourceAccessor.SourceBuilder<SRC extends Object,B extends org.refcodes.mixin.SourceAccessor.SourceBuilder<SRC,B>>, org.refcodes.mixin.SourceAccessor.SourceMutator<SRC extends Object>, org.refcodes.mixin.SourceAccessor.SourceProperty<SRC extends Object>
  • Method Summary

    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 providing P2PMessage has already stopped over the given Peer.
    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 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.