Interface P2PMessage<LOCATOR,HEADER extends P2PHeader<LOCATOR>,BODY,TAIL extends P2PTail<LOCATOR>>

Type Parameters:
LOCATOR - Defines the type of the locators identifying a peer.
HEADER - The P2PHeader defines the static attributes addressed for the target of the P2PMessage (a header might be signed as it is not modified during dispatch).
BODY - The type of the payload being carried by the P2PMessage.
TAIL - The P2PTail describes the dynamic attributes required during dispatch of a P2PMessage (a tail is modified during dispatch by having the visited hops appended).
All Superinterfaces:
org.refcodes.mixin.BodyAccessor<BODY>, org.refcodes.mixin.HeaderAccessor<HEADER>, org.refcodes.mixin.Message<HEADER,BODY>, org.refcodes.mixin.TailAccessor<TAIL>
All Known Implementing Classes:
AbstractP2PMessage

public interface P2PMessage<LOCATOR,HEADER extends P2PHeader<LOCATOR>,BODY,TAIL extends P2PTail<LOCATOR>> extends org.refcodes.mixin.Message<HEADER,BODY>, org.refcodes.mixin.TailAccessor<TAIL>
A P2PMessage is a transient passing various peers till reaching its target, consisting of a target, a payload and a trail of visited (peer) nodes. For routing by stateless Peer instances, a P2PMessage carries a trail of visited nodes to prevent turning circles through the Peer instances.
  • Nested Class Summary

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

    org.refcodes.mixin.BodyAccessor.BodyBuilder<T extends Object,B extends org.refcodes.mixin.BodyAccessor.BodyBuilder<T,B>>, org.refcodes.mixin.BodyAccessor.BodyMutator<T extends Object>, org.refcodes.mixin.BodyAccessor.BodyProperty<T extends Object>

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

    org.refcodes.mixin.HeaderAccessor.HeaderBuilder<T extends Object,B extends org.refcodes.mixin.HeaderAccessor.HeaderBuilder<T,B>>, org.refcodes.mixin.HeaderAccessor.HeaderMutator<T extends Object>, org.refcodes.mixin.HeaderAccessor.HeaderProperty<T extends Object>

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

    org.refcodes.mixin.TailAccessor.TailBuilder<T extends Object,B extends org.refcodes.mixin.TailAccessor.TailBuilder<T,B>>, org.refcodes.mixin.TailAccessor.TailMutator<T extends Object>, org.refcodes.mixin.TailAccessor.TailProperty<T extends Object>
  • Method Summary

    Modifier and Type
    Method
    Description
    <P> P
    getPayload(Class<P> aResponseType)
    Retrieves the object representing the message's payload.

    Methods inherited from interface org.refcodes.mixin.Message

    getBody, getHeader

    Methods inherited from interface org.refcodes.mixin.TailAccessor

    getTail
  • Method Details

    • getPayload

      <P> P getPayload(Class<P> aResponseType) throws org.refcodes.exception.UnmarshalException
      Retrieves the object representing the message's payload.
      Type Parameters:
      P - the type of the payload
      Parameters:
      aResponseType - The type of which the response is expected to be.
      Returns:
      An instance of the type representing the response.
      Throws:
      org.refcodes.exception.UnmarshalException - thrown when unmarshaling / deserializing an object fails.