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.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.EnquiryStandbyTimeMillisProperty
Nested 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.LengthProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveMagicBytesAccessor
ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesBuilder<B extends ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesBuilder<B>>, ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesMutator, ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveRetryNumberAccessor
ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberBuilder<B extends ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberBuilder<B>>, ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberMutator, ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveSegmentPackagerAccessor
ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerBuilder<B extends ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerBuilder<B>>, ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerMutator, ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveTimeoutMillisAccessor
ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisBuilder<B extends ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisBuilder<B>>, ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisMutator, ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DECORATEE
protected long
protected byte[]
protected MagicBytesSegment
protected int
protected Segment
protected SegmentPackager
protected long
static final String
static final String
static final String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Instantiates 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 TypeMethodDescriptionboolean
long
The ENQ ("enquiry") timeout attribute in milliseconds.int
Determines the overall length of thisTransmission
.byte[]
Retrieves the magic bytes from the RTR ("ready-to-receive") magic bytes property.int
Retrieves the number of retries from the RTR ("ready-to-receive") retry number.Retrieves theSegmentPackager
RTR ("ready-to-receive") property.long
The RTR ("ready-to-receive") timeout attribute in milliseconds.int
hashCode()
toSchema()
Provides theSequence
representation of thisTransmission
.org.refcodes.struct.SimpleTypeMap
Returns theSimpleTypeMap
representation of thisTransmission
.toString()
void
transmitTo
(OutputStream aOutputStream, InputStream aReturnStream) Transmits theSequence
representing the implementing type's instance to the givenOutputStream
.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 theTransmissionMetrics
configuration 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
- TheTransmissionMetrics
to 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 RTRSegmentPackager
for 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 RTRSegmentPackager
for 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 RTRSegmentPackager
for 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 RTRSegmentPackager
for 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 RTRSegmentPackager
for 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 RTRSegmentPackager
for 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 RTRSegmentPackager
for 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 RTRSegmentPackager
for 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 RTRSegmentPackager
for 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 RTRSegmentPackager
for 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 RTRSegmentPackager
for 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 RTRSegmentPackager
for packaging RTR responses.
-
-
Method Details
-
transmitTo
Transmits theSequence
representing the implementing type's instance to the givenOutputStream
. Implementations providing error correction methods use the provided feedbackInputStream
to do some sort of "stop-and-wait ARQ" or apply similar methods to ensure correctness of the transmitted data.- Specified by:
transmitTo
in interfaceTransmission
- Specified by:
transmitTo
in interfaceTransmission.TransmissionMixin
- Parameters:
aOutputStream
- TheOutputStream
where to write this instance'sSequence
to.aReturnStream
- AnInputStream
being 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 theOutputStream
caused problems.
-
toSchema
- Specified by:
toSchema
in interfaceorg.refcodes.mixin.Schemable
- Specified by:
toSchema
in interfaceTransmission
-
getEnquiryStandbyTimeMillis
public long getEnquiryStandbyTimeMillis()The ENQ ("enquiry") timeout attribute in milliseconds.- Specified by:
getEnquiryStandbyTimeMillis
in 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:
getReadyToReceiveTimeoutMillis
in 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:
getReadyToReceiveMagicBytes
in 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:
getReadyToReceiveRetryNumber
in interfaceReadyToReceiveRetryNumberAccessor
- Returns:
- The number of retries stored by the RTR ("ready-to-receive") retry number.
-
getReadyToReceiveSegmentPackager
Retrieves theSegmentPackager
RTR ("ready-to-receive") property.- Specified by:
getReadyToReceiveSegmentPackager
in interfaceReadyToReceiveSegmentPackagerAccessor
- Returns:
- The
SegmentPackager
stored by the RTR ("ready-to-receive")SegmentPackager
property.
-
getLength
public int getLength()Determines the overall length of thisTransmission
. In case of nestedTransmission
instances, all length values from all sub-segments are accumulated to the result as well.- Specified by:
getLength
in interfaceorg.refcodes.mixin.LengthAccessor
- Specified by:
getLength
in interfaceTransmission
- Returns:
- The (overall) length of the
Transmission
(including any sub-segments).
-
toSequence
Provides theSequence
representation of thisTransmission
. In case of nestedTransmission
instances, allSequence
representations from all sub-segments are accumulated to the result as well. Caution, the Transmission (or its nestedTransmission
instances) may be backed by the returnedSequence
.- Specified by:
toSequence
in interfaceTransmission
- Returns:
- The according instance's
Sequence
.
-
getDecoratee
- Specified by:
getDecoratee
in interfaceorg.refcodes.mixin.DecorateeAccessor<DECORATEE extends Transmission>
-
toString
-
hashCode
public int hashCode() -
equals
-
toSimpleTypeMap
public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()Returns theSimpleTypeMap
representation of thisTransmission
. In case this Transmission hasTransmission
children, then the children are queried as well and contained in the resultingSimpleTypeMap
. The aliases of the accordingTransmission
instances represent the resulting path to aTransmission
's final simple type.- Specified by:
toSimpleTypeMap
in interfaceTransmission
- Returns:
- The
SimpleTypeMap
representing thisTransmission
and (if any) its children, with the according aliases forming the paths to theTransmission
's values.
-