Interface P2PMessage<LOCATOR,​HEADER extends P2PHeader<LOCATOR>,​BODY>

  • Type Parameters:
    LOCATOR - The locator defines the type which identifies a source and a destination (or stop-overs) of a P2PMessage.
    HEADER - The P2PHeader defines the least required attributes of a P2PMessage. .
    BODY - The type of the payload being carried by the P2PMessage.
    All Superinterfaces:
    org.refcodes.mixin.BodyAccessor<BODY>, org.refcodes.mixin.HeaderAccessor<HEADER>, org.refcodes.mixin.Message<HEADER,​BODY>
    All Known Implementing Classes:
    AbstractP2PMessage

    public interface P2PMessage<LOCATOR,​HEADER extends P2PHeader<LOCATOR>,​BODY>
    extends org.refcodes.mixin.Message<HEADER,​BODY>
    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>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      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
    • Method Detail

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