Module org.refcodes.serial
Package org.refcodes.serial
Class AbstractReadyToSendTransmissionDecorator<DECORATEE extends Transmission>
java.lang.Object
org.refcodes.serial.AbstractReadyToSendTransmissionDecorator<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
,ClearToSendMagicBytesAccessor
,ClearToSendSegmentPackagerAccessor
,ClearToSendTimeoutInMsAccessor
,EnquiryStandbyTimeInMsAccessor
,ReadyToSendMagicBytesAccessor
,ReadyToSendRetryNumberAccessor
,ReadyToSendSegmentPackagerAccessor
,ReadyToSendTimeoutInMsAccessor
,ReadyToSendTransmission
,Transmission
,Transmission.TransmissionMixin
- Direct Known Subclasses:
ReadyToSendSectionDecorator
,ReadyToSendSegmentDecorator
public abstract class AbstractReadyToSendTransmissionDecorator<DECORATEE extends Transmission> extends Object implements ReadyToSendTransmission, Transmission.TransmissionMixin, org.refcodes.mixin.DecorateeAccessor<DECORATEE>
The
AbstractReadyToSendTransmissionDecorator
class implements a
decorator providing ReadyToSendTransmission
functionality for a
Transmission
.- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.serial.ClearToSendMagicBytesAccessor
ClearToSendMagicBytesAccessor.ClearToSendMagicBytesBuilder<B extends ClearToSendMagicBytesAccessor.ClearToSendMagicBytesBuilder<B>>, ClearToSendMagicBytesAccessor.ClearToSendMagicBytesMutator, ClearToSendMagicBytesAccessor.ClearToSendMagicBytesProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ClearToSendSegmentPackagerAccessor
ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerBuilder<B extends ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerBuilder<B>>, ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerMutator, ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ClearToSendTimeoutInMsAccessor
ClearToSendTimeoutInMsAccessor.ClearToSendTimeoutInMsBuilder<B extends ClearToSendTimeoutInMsAccessor.ClearToSendTimeoutInMsBuilder<B>>, ClearToSendTimeoutInMsAccessor.ClearToSendTimeoutInMsMutator, ClearToSendTimeoutInMsAccessor.ClearToSendTimeoutInMsProperty
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.ReadyToSendMagicBytesAccessor
ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesBuilder<B extends ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesBuilder<B>>, ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesMutator, ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendRetryNumberAccessor
ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberBuilder<B extends ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberBuilder<B>>, ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberMutator, ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendSegmentPackagerAccessor
ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerBuilder<B extends ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerBuilder<B>>, ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerMutator, ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendTimeoutInMsAccessor
ReadyToSendTimeoutInMsAccessor.ReadyToSendTimeoutInMsBuilder<B extends ReadyToSendTimeoutInMsAccessor.ReadyToSendTimeoutInMsBuilder<B>>, ReadyToSendTimeoutInMsAccessor.ReadyToSendTimeoutInMsMutator, ReadyToSendTimeoutInMsAccessor.ReadyToSendTimeoutInMsProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
_clearToSendMagicBytes
protected MagicBytesSegment
_clearToSendMagicBytesSegment
protected Segment
_clearToSendSegment
protected SegmentPackager
_clearToSendSegmentPackager
protected long
_clearToSendTimeoutInMs
protected DECORATEE
_decoratee
protected long
_enquiryStandbyTimeInMs
protected byte[]
_readyToSendMagicBytes
protected MagicBytesSegment
_readyToSendMagicBytesSegment
protected int
_readyToSendRetryNumber
protected Segment
_readyToSendSegment
protected SegmentPackager
_readyToSendSegmentPackager
protected long
_readyToSendTimeoutInMs
static String
CTS_MAGIC_BYTES
static String
CTS_TIMEOUT_IN_MS
static String
RTS_MAGIC_BYTES
static String
RTS_RETRY_NUMBER
static String
RTS_TIMEOUT_IN_MS
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractReadyToSendTransmissionDecorator()
AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, byte[] aClearToSendMagicBytes)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, byte[] aClearToSendMagicBytes)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, byte[] aClearToSendMagicBytes)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, byte[] aClearToSendMagicBytes)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)
Constructs an according flow-control decorator instance wrapping the given decoratee.AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, TransmissionMetrics aTransmissionMetrics)
Constructs an according control-flow decorator instance wrapping the given decoratee. -
Method Summary
Modifier and Type Method Description boolean
equals(Object obj)
byte[]
getClearToSendMagicBytes()
Retrieves the magic bytes from the CTS ("clear-to-send") magic bytes property.SegmentPackager
getClearToSendSegmentPackager()
Retrieves theSegmentPackager
CTS ("clear-to-send") property.long
getClearToSendTimeoutInMs()
The CTS ("clear-to-send") timeout attribute in milliseconds.DECORATEE
getDecoratee()
long
getEnquiryStandbyTimeInMs()
The ENQ ("enquiry") timeout attribute in milliseconds.int
getLength()
Determines the overall length of thisTransmission
.byte[]
getReadyToSendMagicBytes()
Retrieves the magic bytes from the RTS ("ready-to-send") magic bytes property.int
getReadyToSendRetryNumber()
Retrieves the number of retries from the RTS ("ready-to-send") retry number.SegmentPackager
getReadyToSendSegmentPackager()
Retrieves theSegmentPackager
RTS ("ready-to-send") property.long
getReadyToSendTimeoutInMs()
The RTS ("ready-to-send") timeout attribute in milliseconds.int
hashCode()
protected void
receiveCtsTransmitTo(OutputStream aOutputStream, InputStream aReturnStream)
Schema
toSchema()
Retrieves theSchema
representing theTransmission
.org.refcodes.struct.SimpleTypeMap
toSimpleTypeMap()
Returns theSimpleTypeMap
representation of thisTransmission
.String
toString()
Sequence
toTransmission()
Provides theSequence
representation of thisTransmission
.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
-
RTS_MAGIC_BYTES
- See Also:
- Constant Field Values
-
RTS_TIMEOUT_IN_MS
- See Also:
- Constant Field Values
-
RTS_RETRY_NUMBER
- See Also:
- Constant Field Values
-
CTS_MAGIC_BYTES
- See Also:
- Constant Field Values
-
CTS_TIMEOUT_IN_MS
- See Also:
- Constant Field Values
-
_decoratee
-
_enquiryStandbyTimeInMs
protected long _enquiryStandbyTimeInMs -
_clearToSendTimeoutInMs
protected long _clearToSendTimeoutInMs -
_clearToSendMagicBytes
protected byte[] _clearToSendMagicBytes -
_clearToSendMagicBytesSegment
-
_clearToSendSegment
-
_clearToSendSegmentPackager
-
_readyToSendTimeoutInMs
protected long _readyToSendTimeoutInMs -
_readyToSendMagicBytes
protected byte[] _readyToSendMagicBytes -
_readyToSendSegmentPackager
-
_readyToSendRetryNumber
protected int _readyToSendRetryNumber -
_readyToSendMagicBytesSegment
-
_readyToSendSegment
-
-
Constructor Details
-
AbstractReadyToSendTransmissionDecorator
protected AbstractReadyToSendTransmissionDecorator() -
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(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.
-
AbstractReadyToSendTransmissionDecorator
Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, byte[] aClearToSendMagicBytes)Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(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 RTS request (receiver) from the transmitter. A value of -1 denotes no timeout (blocking mode).
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager)Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, byte[] aClearToSendMagicBytes)Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs)Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager)Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs)Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, byte[] aClearToSendMagicBytes)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 RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs)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 RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager)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 RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)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 RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, byte[] aClearToSendMagicBytes)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 RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs)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 RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager)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 RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)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 RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs)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 RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)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 RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)Constructs an according flow-control decorator instance wrapping the given decoratee.- Parameters:
aDecoratee
- The decoratee to be wrapped by the flow-control decorator.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a RTS ("ready-to-receive") to the transmitter.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS responses.
-
AbstractReadyToSendTransmissionDecorator
public AbstractReadyToSendTransmissionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager)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 RTS request (receiver) from the transmitter. A value of -1 denotes the timeout being disabled.aReadyToSendMagicBytes
- The RTS characters to be used to signal a RTS.aReadyToSendRetryNumber
- The number of retries sending an RTS over the payload (data) channel.aReadyToSendTimeoutInMs
- The timeout in milliseconds to wait for a CTS response (transmitter) from the receiver after signaling a RTS ("ready-to-send") to the receiver.aReadyToSendSegmentPackager
- The RTSSegmentPackager
for packaging RTS responses.aClearToSendMagicBytes
- The CTS characters to be used to signal a CTS.aClearToSendTimeoutInMs
- The timeout in milliseconds to wait for a payload response (receiver) from the transmitter after signaling a CTS ("ready-to-receive") to the transmitter.aClearToSendSegmentPackager
- The CTSSegmentPackager
for packaging CTS 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.
-
receiveCtsTransmitTo
protected void receiveCtsTransmitTo(OutputStream aOutputStream, InputStream aReturnStream) throws IOException, TransmissionException, FlowControlTimeoutException -
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.
-
getReadyToSendTimeoutInMs
public long getReadyToSendTimeoutInMs()The RTS ("ready-to-send") timeout attribute in milliseconds.- Specified by:
getReadyToSendTimeoutInMs
in interfaceReadyToSendTimeoutInMsAccessor
- Returns:
- An integer with the RTS ("ready-to-send") timeout in milliseconds.
-
getReadyToSendMagicBytes
public byte[] getReadyToSendMagicBytes()Retrieves the magic bytes from the RTS ("ready-to-send") magic bytes property.- Specified by:
getReadyToSendMagicBytes
in interfaceReadyToSendMagicBytesAccessor
- Returns:
- The magic bytes stored by the RTS ("ready-to-send") magic bytes property.
-
getReadyToSendRetryNumber
public int getReadyToSendRetryNumber()Retrieves the number of retries from the RTS ("ready-to-send") retry number. A RTS retry number is the overall number of retries to use when counting retries.- Specified by:
getReadyToSendRetryNumber
in interfaceReadyToSendRetryNumberAccessor
- Returns:
- The number of retries stored by the RTS ("ready-to-send") retry number.
-
getReadyToSendSegmentPackager
Retrieves theSegmentPackager
RTS ("ready-to-send") property.- Specified by:
getReadyToSendSegmentPackager
in interfaceReadyToSendSegmentPackagerAccessor
- Returns:
- The
SegmentPackager
stored by the RTS ("ready-to-send")SegmentPackager
property.
-
getClearToSendMagicBytes
public byte[] getClearToSendMagicBytes()Retrieves the magic bytes from the CTS ("clear-to-send") magic bytes property.- Specified by:
getClearToSendMagicBytes
in interfaceClearToSendMagicBytesAccessor
- Returns:
- The magic bytes stored by the CTS ("clear-to-send") magic bytes property.
-
getClearToSendTimeoutInMs
public long getClearToSendTimeoutInMs()The CTS ("clear-to-send") timeout attribute in milliseconds.- Specified by:
getClearToSendTimeoutInMs
in interfaceClearToSendTimeoutInMsAccessor
- Returns:
- An integer with the CTS ("clear-to-send") timeout in milliseconds.
-
getClearToSendSegmentPackager
Retrieves theSegmentPackager
CTS ("clear-to-send") property.- Specified by:
getClearToSendSegmentPackager
in interfaceClearToSendSegmentPackagerAccessor
- Returns:
- The
SegmentPackager
stored by the CTS ("clear-to-send")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).
-
toTransmission
Provides theSequence
representation of thisTransmission
. In case of nestedTransmission
instances, allSequence
representations from all sub-segments are accumulated to the result as well.- Specified by:
toTransmission
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.
-