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
,EnquiryStandbyTimeInMsAccessor
,ReadyToReceiveMagicBytesAccessor
,ReadyToReceiveRetryNumberAccessor
,ReadyToReceiveSegmentPackagerAccessor
,ReadyToReceiveTimeoutInMsAccessor
,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>
TheAbstractReadyToReceiveTransmissionDecorator
class implements a decorator providingReadyToReceiveTransmission
functionality for aTransmission
.- See Also:
- Serialized Form
-
-
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.EnquiryStandbyTimeInMsAccessor
EnquiryStandbyTimeInMsAccessor.EnquiryStandbyTimeInMsBuilder<B extends EnquiryStandbyTimeInMsAccessor.EnquiryStandbyTimeInMsBuilder<B>>, EnquiryStandbyTimeInMsAccessor.EnquiryStandbyTimeInMsMutator, EnquiryStandbyTimeInMsAccessor.EnquiryStandbyTimeInMsProperty
-
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.ReadyToReceiveTimeoutInMsAccessor
ReadyToReceiveTimeoutInMsAccessor.ReadyToReceiveTimeoutInMsBuilder<B extends ReadyToReceiveTimeoutInMsAccessor.ReadyToReceiveTimeoutInMsBuilder<B>>, ReadyToReceiveTimeoutInMsAccessor.ReadyToReceiveTimeoutInMsMutator, ReadyToReceiveTimeoutInMsAccessor.ReadyToReceiveTimeoutInMsProperty
-
Nested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin
-
-
Field Summary
Fields Modifier and Type Field Description protected DECORATEE
_decoratee
protected long
_enquiryStandbyTimeInMs
protected byte[]
_readyToReceiveMagicBytes
protected MagicBytesSegment
_readyToReceiveMagicByteSegment
protected int
_readyToReceiveRetryNumber
protected Segment
_readyToReceiveSegment
protected SegmentPackager
_readyToReceiveSegmentPackager
protected long
_readyToReceiveTimeoutInMs
static String
RTR_MAGIC_BYTES
static String
RTR_RETRY_NUMBER
static String
RTR_TIMEOUT_IN_MS
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractReadyToReceiveTransmissionDecorator()
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
DECORATEE
getDecoratee()
long
getEnquiryStandbyTimeInMs()
The ENQ ("enquiry") timeout attribute in milliseconds.int
getLength()
Determines the overall length of thisTransmission
.byte[]
getReadyToReceiveMagicBytes()
Retrieves the magic bytes from the RTR ("ready-to-receive") magic bytes property.int
getReadyToReceiveRetryNumber()
Retrieves the number of retries from the RTR ("ready-to-receive") retry number.SegmentPackager
getReadyToReceiveSegmentPackager()
Retrieves theSegmentPackager
RTR ("ready-to-receive") property.long
getReadyToReceiveTimeoutInMs()
The RTR ("ready-to-receive") timeout attribute in milliseconds.int
hashCode()
Schema
toSchema()
Retrieves theSchema
representing theTransmission
.Sequence
toSequence()
Provides theSequence
representation of thisTransmission
.org.refcodes.struct.SimpleTypeMap
toSimpleTypeMap()
Returns theSimpleTypeMap
representation of thisTransmission
.String
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 Detail
-
RTR_MAGIC_BYTES
public static final String RTR_MAGIC_BYTES
- See Also:
- Constant Field Values
-
RTR_TIMEOUT_IN_MS
public static final String RTR_TIMEOUT_IN_MS
- See Also:
- Constant Field Values
-
RTR_RETRY_NUMBER
public static final String RTR_RETRY_NUMBER
- See Also:
- Constant Field Values
-
_decoratee
protected DECORATEE extends Transmission _decoratee
-
_enquiryStandbyTimeInMs
protected long _enquiryStandbyTimeInMs
-
_readyToReceiveTimeoutInMs
protected long _readyToReceiveTimeoutInMs
-
_readyToReceiveMagicBytes
protected byte[] _readyToReceiveMagicBytes
-
_readyToReceiveSegmentPackager
protected SegmentPackager _readyToReceiveSegmentPackager
-
_readyToReceiveRetryNumber
protected int _readyToReceiveRetryNumber
-
_readyToReceiveMagicByteSegment
protected MagicBytesSegment _readyToReceiveMagicByteSegment
-
_readyToReceiveSegment
protected Segment _readyToReceiveSegment
-
-
Constructor Detail
-
AbstractReadyToReceiveTransmissionDecorator
protected AbstractReadyToReceiveTransmissionDecorator()
-
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
public AbstractReadyToReceiveTransmissionDecorator(DECORATEE aDecoratee)
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 Detail
-
transmitTo
public void transmitTo(OutputStream aOutputStream, InputStream aReturnStream) throws IOException
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
public Schema toSchema()
Retrieves theSchema
representing theTransmission
. Retrieving aSchema
is useful when analyzing and debugging data structures such as aAllocSectionDecoratorSegment
instance to help document, learn and verify on the structure (as well as the content) of that veryAllocSectionDecoratorSegment
.- Specified by:
toSchema
in interfaceTransmission
- Returns:
- The
Schema
representation of the implementing type for debugging and verification (or documentation) purposes.
-
getEnquiryStandbyTimeInMs
public long getEnquiryStandbyTimeInMs()
The ENQ ("enquiry") timeout attribute in milliseconds.- Specified by:
getEnquiryStandbyTimeInMs
in interfaceEnquiryStandbyTimeInMsAccessor
- Returns:
- An integer with the ENQ ("enquiry") timeout in milliseconds.
-
getReadyToReceiveTimeoutInMs
public long getReadyToReceiveTimeoutInMs()
The RTR ("ready-to-receive") timeout attribute in milliseconds.- Specified by:
getReadyToReceiveTimeoutInMs
in interfaceReadyToReceiveTimeoutInMsAccessor
- 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
public SegmentPackager 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
public Sequence 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
public DECORATEE getDecoratee()
- Specified by:
getDecoratee
in interfaceorg.refcodes.mixin.DecorateeAccessor<DECORATEE extends Transmission>
-
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.
-
-