Module org.refcodes.p2p
Package org.refcodes.p2p
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
- TheP2PHeader
defines the static attributes addressed for the target of theP2PMessage
(a header might be signed as it is not modified during dispatch).BODY
- The type of the payload being carried by theP2PMessage
.TAIL
- TheP2PTail
describes the dynamic attributes required during dispatch of aP2PMessage
(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>
AP2PMessage
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 statelessPeer
instances, aP2PMessage
carries a trail of visited nodes to prevent turning circles through thePeer
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
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.
-
-
-
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.
-
-