Module org.refcodes.p2p
Package org.refcodes.p2p
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 aP2PMessage
.HEADER
- TheP2PHeader
defines the least required attributes of aP2PMessage
. .BODY
- The type of the payload being carried by theP2PMessage
.
- 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>
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>
-
-
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.
-
-