Module org.refcodes.p2p
Package org.refcodes.p2p
Class AbstractP2PMessage<LOCATOR,HEADER extends P2PHeader<LOCATOR>,BODY,TAIL extends P2PTail<LOCATOR>>
java.lang.Object
org.refcodes.p2p.AbstractP2PMessage<LOCATOR,HEADER,BODY,TAIL>
- 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 Implemented Interfaces:
org.refcodes.mixin.BodyAccessor<BODY>
,org.refcodes.mixin.HeaderAccessor<HEADER>
,org.refcodes.mixin.Message<HEADER,
,BODY> org.refcodes.mixin.TailAccessor<TAIL>
,P2PMessage<LOCATOR,
HEADER, BODY, TAIL>
public abstract class AbstractP2PMessage<LOCATOR,HEADER extends P2PHeader<LOCATOR>,BODY,TAIL extends P2PTail<LOCATOR>>
extends Object
implements P2PMessage<LOCATOR,HEADER,BODY,TAIL>
Abstract implementation of a
P2PMessage
.-
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> -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractP2PMessage
(HEADER aHeader, BODY aBody, TAIL aTail) Constructs anP2PMessage
. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.refcodes.p2p.P2PMessage
getPayload
-
Field Details
-
_header
-
_body
-
_tail
-
-
Constructor Details
-
AbstractP2PMessage
Constructs anP2PMessage
. No ID trail of already passedPeer
(orTerminal
) instances is added to this message (initial message).- Parameters:
aHeader
- TheP2PHeader
defines the static attributes addressed for the target of theP2PMessage
(a header might be signed as it is not modified during dispatch).aBody
- The payload being carried by theP2PMessage
.aTail
- TheP2PTail
describes the dynamic attributes required during dispatch of aP2PMessage
(a tail is modified during dispatch by having the visited hops appended).
-
-
Method Details
-
getHeader
-
getBody
-
getTail
- Specified by:
getTail
in interfaceorg.refcodes.mixin.TailAccessor<LOCATOR>
-
toString
-