Module org.refcodes.serial
Package org.refcodes.serial
Class AbstractReadyToReceiveTransmissionDecorator<DECORATEE extends Transmission>
java.lang.Object
org.refcodes.serial.AbstractReadyToReceiveTransmissionDecorator<DECORATEE>
- Type Parameters:
DECORATEE- The decoratee type describing the according subclass to be enriched.
- All Implemented Interfaces:
Serializable,org.refcodes.mixin.DecorateeAccessor<DECORATEE>,org.refcodes.mixin.LengthAccessor,org.refcodes.mixin.Resetable,org.refcodes.schema.Schemable,EnquiryStandbyTimeMillisAccessor,ReadyToReceiveMagicBytesAccessor,ReadyToReceiveRetryNumberAccessor,ReadyToReceiveSegmentPackagerAccessor,ReadyToReceiveTimeoutMillisAccessor,ReadyToReceiveTransmission,Transmission,Transmission.TransmissionMixin
- Direct Known Subclasses:
ReadyToReceiveSectionDecorator,ReadyToReceiveSegmentDecorator
public abstract class AbstractReadyToReceiveTransmissionDecorator<DECORATEE extends Transmission>
extends Object
implements ReadyToReceiveTransmission, Transmission.TransmissionMixin, org.refcodes.mixin.DecorateeAccessor<DECORATEE>
The
AbstractReadyToReceiveTransmissionDecorator class implements a
decorator providing ReadyToReceiveTransmission functionality for a
Transmission.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.DecorateeAccessor
org.refcodes.mixin.DecorateeAccessor.DecorateeBuilder<DECORATEE extends Object,B extends org.refcodes.mixin.DecorateeAccessor.DecorateeBuilder<DECORATEE, B>>, org.refcodes.mixin.DecorateeAccessor.DecorateeMutator<DECORATEE extends Object>, org.refcodes.mixin.DecorateeAccessor.DecorateeProperty<DECORATEE extends Object> Nested classes/interfaces inherited from interface org.refcodes.serial.EnquiryStandbyTimeMillisAccessor
EnquiryStandbyTimeMillisAccessor.EnquiryStandbyTimeMillisBuilder<B extends EnquiryStandbyTimeMillisAccessor.EnquiryStandbyTimeMillisBuilder<B>>, EnquiryStandbyTimeMillisAccessor.EnquiryStandbyTimeMillisMutator, EnquiryStandbyTimeMillisAccessor.EnquiryStandbyTimeMillisPropertyNested classes/interfaces inherited from interface org.refcodes.mixin.LengthAccessor
org.refcodes.mixin.LengthAccessor.LengthBuilder<B extends org.refcodes.mixin.LengthAccessor.LengthBuilder<B>>, org.refcodes.mixin.LengthAccessor.LengthMutator, org.refcodes.mixin.LengthAccessor.LengthPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveMagicBytesAccessor
ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesBuilder<B extends ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesBuilder<B>>, ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesMutator, ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveRetryNumberAccessor
ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberBuilder<B extends ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberBuilder<B>>, ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberMutator, ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveSegmentPackagerAccessor
ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerBuilder<B extends ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerBuilder<B>>, ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerMutator, ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveTimeoutMillisAccessor
ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisBuilder<B extends ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisBuilder<B>>, ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisMutator, ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisPropertyNested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DECORATEEprotected longprotected byte[]protected MagicBytesSegmentprotected intprotected Segmentprotected SegmentPackagerprotected longstatic final Stringstatic final Stringstatic final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantiates a new abstract ready to receive transmission decorator.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToReceiveTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, TransmissionMetrics aTransmissionMetrics) Constructs an according control-flow decorator instance wrapping the given decoratee. -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongThe ENQ ("enquiry") timeout attribute in milliseconds.intDetermines the overall length of thisTransmission.byte[]Retrieves the magic bytes from the RTR ("ready-to-receive") magic bytes property.intRetrieves the number of retries from the RTR ("ready-to-receive") retry number.Retrieves theSegmentPackagerRTR ("ready-to-receive") property.longThe RTR ("ready-to-receive") timeout attribute in milliseconds.inthashCode()voidreset()Resets any dynamic data (e.g. values such as payloads or checksums) and must not(!)toSchema()Provides theSequencerepresentation of thisTransmission.org.refcodes.struct.SimpleTypeMapReturns theSimpleTypeMaprepresentation of thisTransmission.toString()voidtransmitTo(OutputStream aOutputStream, InputStream aReturnStream) Transmits theSequencerepresenting the implementing type's instance to the givenOutputStream.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.refcodes.serial.Transmission
transmitTo, transmitTo
-
Field Details
-
RTR_MAGIC_BYTES
- See Also:
-
RTR_TIMEOUT_IN_MS
- See Also:
-
RTR_RETRY_NUMBER
- See Also:
-
_decoratee
-
_enquiryStandbyTimeInMs
protected long _enquiryStandbyTimeInMs -
_readyToReceiveTimeoutInMs
protected long _readyToReceiveTimeoutInMs -
_readyToReceiveMagicBytes
protected byte[] _readyToReceiveMagicBytes -
_readyToReceiveSegmentPackager
-
_readyToReceiveRetryNumber
protected int _readyToReceiveRetryNumber -
_readyToReceiveMagicByteSegment
-
_readyToReceiveSegment
-
-
Constructor Details
-
AbstractReadyToReceiveTransmissionDecorator
protected AbstractReadyToReceiveTransmissionDecorator()Instantiates a new abstract ready to receive transmission decorator. -
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, TransmissionMetrics aTransmissionMetrics) Constructs an according control-flow decorator instance wrapping the given decoratee. The configuration attributes are taken from theTransmissionMetricsconfiguration object, though only those attributes are supported which are also supported by the other constructors!- Parameters:
aDecoratee- The decoratee to be wrapped by the control-flow decorator.aTransmissionMetrics- TheTransmissionMetricsto be used for configuring this instance.
-
AbstractReadyToReceiveTransmissionDecorator
Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs- The timeout in milliseconds to wait for an RTR request (transmitter) from the receiver.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.aReadyToReceiveSegmentPackager- The RTRSegmentPackagerfor packaging RTR responses.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aReadyToReceiveTimeoutInMs- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTR ("ready-to-receive") to the transmitter.aReadyToReceiveSegmentPackager- The RTRSegmentPackagerfor packaging RTR responses.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.aReadyToReceiveRetryNumber- The number of retries sending an RTR over the return channel.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aReadyToReceiveRetryNumber- The number of retries sending an RTR over the return channel.aReadyToReceiveTimeoutInMs- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTR ("ready-to-receive") to the transmitter.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.aReadyToReceiveRetryNumber- The number of retries sending an RTR over the return channel.aReadyToReceiveSegmentPackager- The RTRSegmentPackagerfor packaging RTR responses.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aReadyToReceiveRetryNumber- The number of retries sending an RTR over the return channel.aReadyToReceiveTimeoutInMs- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTR ("ready-to-receive") to the transmitter.aReadyToReceiveSegmentPackager- The RTRSegmentPackagerfor packaging RTR responses.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.aReadyToReceiveTimeoutInMs- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTR ("ready-to-receive") to the transmitter.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.aReadyToReceiveTimeoutInMs- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTR ("ready-to-receive") to the transmitter.aReadyToReceiveSegmentPackager- The RTRSegmentPackagerfor packaging RTR responses.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs- The timeout in milliseconds to wait for an RTR request (transmitter) from the receiver.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToReceiveTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs- The timeout in milliseconds to wait for an RTR request (transmitter) from the receiver.aReadyToReceiveTimeoutInMs- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTR ("ready-to-receive") to the transmitter.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs- The timeout in milliseconds to wait for an RTR request (transmitter) from the receiver.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.aReadyToReceiveSegmentPackager- The RTRSegmentPackagerfor packaging RTR responses.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs- The timeout in milliseconds to wait for an RTR request (transmitter) from the receiver.aReadyToReceiveTimeoutInMs- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTR ("ready-to-receive") to the transmitter.aReadyToReceiveSegmentPackager- The RTRSegmentPackagerfor packaging RTR responses.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs- The timeout in milliseconds to wait for an RTR request (transmitter) from the receiver.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.aReadyToReceiveRetryNumber- The number of retries sending an RTR over the return channel.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs- The timeout in milliseconds to wait for an RTR request (transmitter) from the receiver.aReadyToReceiveRetryNumber- The number of retries sending an RTR over the return channel.aReadyToReceiveTimeoutInMs- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTR ("ready-to-receive") to the transmitter.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs- The timeout in milliseconds to wait for an RTR request (transmitter) from the receiver.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.aReadyToReceiveRetryNumber- The number of retries sending an RTR over the return channel.aReadyToReceiveSegmentPackager- The RTRSegmentPackagerfor packaging RTR responses.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs- The timeout in milliseconds to wait for an RTR request (transmitter) from the receiver.aReadyToReceiveRetryNumber- The number of retries sending an RTR over the return channel.aReadyToReceiveTimeoutInMs- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTR ("ready-to-receive") to the transmitter.aReadyToReceiveSegmentPackager- The RTRSegmentPackagerfor packaging RTR responses.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs- The timeout in milliseconds to wait for an RTR request (transmitter) from the receiver.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.aReadyToReceiveTimeoutInMs- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTR ("ready-to-receive") to the transmitter.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs- The timeout in milliseconds to wait for an RTR request (transmitter) from the receiver.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.aReadyToReceiveTimeoutInMs- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTR ("ready-to-receive") to the transmitter.aReadyToReceiveSegmentPackager- The RTRSegmentPackagerfor packaging RTR responses.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.aReadyToReceiveRetryNumber- The number of retries sending an RTR over the return channel.aReadyToReceiveTimeoutInMs- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTR ("ready-to-receive") to the transmitter.aReadyToReceiveSegmentPackager- The RTRSegmentPackagerfor packaging RTR responses.
-
AbstractReadyToReceiveTransmissionDecorator
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager) Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee- The decoratee to be wrapped by the flow-control decorator.aEnquiryStandbyTimeInMs- The timeout in milliseconds to wait for an RTR request (transmitter) from the receiver.aReadyToReceiveMagicBytes- The RTR character to be used to signal a RTR.aReadyToReceiveRetryNumber- The number of retries sending an RTR over the return channel.aReadyToReceiveTimeoutInMs- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTR ("ready-to-receive") to the transmitter.aReadyToReceiveSegmentPackager- The RTRSegmentPackagerfor packaging RTR responses.
-
-
Method Details
-
transmitTo
Transmits theSequencerepresenting the implementing type's instance to the givenOutputStream. Implementations providing error correction methods use the provided feedbackInputStreamto do some sort of "stop-and-wait ARQ" or apply similar methods to ensure correctness of the transmitted data.- Specified by:
transmitToin interfaceTransmission- Specified by:
transmitToin interfaceTransmission.TransmissionMixin- Parameters:
aOutputStream- TheOutputStreamwhere to write this instance'sSequenceto.aReturnStream- AnInputStreambeing the return channel to handle "stop-and-wait ARQ" or the like in case of a bidirectional connection. Can be null in case we have a unidirectional connection.- Throws:
IOException- thrown in case writing data to theOutputStreamcaused problems.
-
reset
public void reset()Resets any dynamic data (e.g. values such as payloads or checksums) and must not(!) reset any configurations or settings required to produce the dynamic data (e.g. theTransmissionMetrics).- Specified by:
resetin interfaceorg.refcodes.mixin.Resetable- Specified by:
resetin interfaceTransmission
-
toSchema
- Specified by:
toSchemain interfaceorg.refcodes.schema.Schemable- Specified by:
toSchemain interfaceTransmission
-
getEnquiryStandbyTimeMillis
public long getEnquiryStandbyTimeMillis()The ENQ ("enquiry") timeout attribute in milliseconds.- Specified by:
getEnquiryStandbyTimeMillisin interfaceEnquiryStandbyTimeMillisAccessor- Returns:
- An integer with the ENQ ("enquiry") timeout in milliseconds.
-
getReadyToReceiveTimeoutMillis
public long getReadyToReceiveTimeoutMillis()The RTR ("ready-to-receive") timeout attribute in milliseconds.- Specified by:
getReadyToReceiveTimeoutMillisin interfaceReadyToReceiveTimeoutMillisAccessor- Returns:
- An integer with the RTR ("ready-to-receive") timeout in milliseconds.
-
getReadyToReceiveMagicBytes
public byte[] getReadyToReceiveMagicBytes()Retrieves the magic bytes from the RTR ("ready-to-receive") magic bytes property.- Specified by:
getReadyToReceiveMagicBytesin interfaceReadyToReceiveMagicBytesAccessor- Returns:
- The magic bytes stored by the RTR ("ready-to-receive") magic bytes property.
-
getReadyToReceiveRetryNumber
public int getReadyToReceiveRetryNumber()Retrieves the number of retries from the RTR ("ready-to-receive") retry number. A RTR retry number is the overall number of retries to use when counting retries.- Specified by:
getReadyToReceiveRetryNumberin interfaceReadyToReceiveRetryNumberAccessor- Returns:
- The number of retries stored by the RTR ("ready-to-receive") retry number.
-
getReadyToReceiveSegmentPackager
Retrieves theSegmentPackagerRTR ("ready-to-receive") property.- Specified by:
getReadyToReceiveSegmentPackagerin interfaceReadyToReceiveSegmentPackagerAccessor- Returns:
- The
SegmentPackagerstored by the RTR ("ready-to-receive")SegmentPackagerproperty.
-
getLength
public int getLength()Determines the overall length of thisTransmission. In case of nestedTransmissioninstances, all length values from all sub-segments are accumulated to the result as well.- Specified by:
getLengthin interfaceorg.refcodes.mixin.LengthAccessor- Specified by:
getLengthin interfaceTransmission- Returns:
- The (overall) length of the
Transmission(including any sub-segments).
-
toSequence
Provides theSequencerepresentation of thisTransmission. In case of nestedTransmissioninstances, allSequencerepresentations from all sub-segments are accumulated to the result as well. Caution, the Transmission (or its nestedTransmissioninstances) may be backed by the returnedSequence.- Specified by:
toSequencein interfaceTransmission- Returns:
- The according instance's
Sequence.
-
getDecoratee
- Specified by:
getDecorateein interfaceorg.refcodes.mixin.DecorateeAccessor<DECORATEE extends Transmission>
-
toString
-
hashCode
public int hashCode() -
equals
-
toSimpleTypeMap
public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()Returns theSimpleTypeMaprepresentation of thisTransmission. In case this Transmission hasTransmissionchildren, then the children are queried as well and contained in the resultingSimpleTypeMap. The aliases of the accordingTransmissioninstances represent the resulting path to aTransmission's final simple type.- Specified by:
toSimpleTypeMapin interfaceTransmission- Returns:
- The
SimpleTypeMaprepresenting thisTransmissionand (if any) its children, with the according aliases forming the paths to theTransmission's values.
-