Module org.refcodes.serial
Package org.refcodes.serial
Class ReadyToReceiveSectionDecorator<DECORATEE extends Section>
- java.lang.Object
-
- org.refcodes.serial.AbstractReadyToReceiveTransmissionDecorator<DECORATEE>
-
- org.refcodes.serial.ReadyToReceiveSectionDecorator<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
,DecoratorSection<DECORATEE>
,EnquiryStandbyTimeInMsAccessor
,ReadyToReceiveMagicBytesAccessor
,ReadyToReceiveRetryNumberAccessor
,ReadyToReceiveSegmentPackagerAccessor
,ReadyToReceiveTimeoutInMsAccessor
,ReadyToReceiveTransmission
,Section
,Transmission
,Transmission.TransmissionMixin
public class ReadyToReceiveSectionDecorator<DECORATEE extends Section> extends AbstractReadyToReceiveTransmissionDecorator<DECORATEE> implements ReadyToReceiveTransmission, Section, DecoratorSection<DECORATEE>
TheReadyToReceiveSectionDecorator
class implements a decorator providingReadyToReceiveTransmission
functionality for aSegment
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReadyToReceiveSectionDecorator.Builder<DECORATEE extends Section>
Builder to buildReadyToReceiveSectionDecorator
.-
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.Section
Section.SectionMixin
-
Nested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin
-
-
Field Summary
-
Fields inherited from class org.refcodes.serial.AbstractReadyToReceiveTransmissionDecorator
_decoratee, _enquiryStandbyTimeInMs, _readyToReceiveMagicBytes, _readyToReceiveMagicByteSegment, _readyToReceiveRetryNumber, _readyToReceiveSegment, _readyToReceiveSegmentPackager, _readyToReceiveTimeoutInMs, RTR_MAGIC_BYTES, RTR_RETRY_NUMBER, RTR_TIMEOUT_IN_MS
-
-
Constructor Summary
Constructors Constructor Description ReadyToReceiveSectionDecorator(DECORATEE aDecoratee)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, SegmentPackager aReadyToReceiveSegmentPackager)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, SegmentPackager aReadyToReceiveSegmentPackager)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, SegmentPackager aReadyToReceiveSegmentPackager)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, SegmentPackager aReadyToReceiveSegmentPackager)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToReceiveTimeoutInMs)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, TransmissionMetrics aTransmissionMetrics)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <DECORATEE extends Section>
ReadyToReceiveSectionDecorator.Builder<DECORATEE>builder()
Creates builder to buildReadyToReceiveSectionDecorator
.void
fromTransmission(Sequence aSequence, int aOffset, int aLength)
(Re-)initializes this instance with the the givenSequence
data.void
receiveFrom(InputStream aInputStream, int aLength, OutputStream aReturnStream)
(Re-)initializes this instance by receiving the accordingSequence
from the givenInputStream
.-
Methods inherited from class org.refcodes.serial.AbstractReadyToReceiveTransmissionDecorator
equals, getDecoratee, getEnquiryStandbyTimeInMs, getLength, getReadyToReceiveMagicBytes, getReadyToReceiveRetryNumber, getReadyToReceiveSegmentPackager, getReadyToReceiveTimeoutInMs, hashCode, toSchema, toSequence, toSimpleTypeMap, toString, transmitTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.refcodes.serial.EnquiryStandbyTimeInMsAccessor
getEnquiryStandbyTimeInMs
-
Methods inherited from interface org.refcodes.serial.ReadyToReceiveMagicBytesAccessor
getReadyToReceiveMagicBytes
-
Methods inherited from interface org.refcodes.serial.ReadyToReceiveRetryNumberAccessor
getReadyToReceiveRetryNumber
-
Methods inherited from interface org.refcodes.serial.ReadyToReceiveSegmentPackagerAccessor
getReadyToReceiveSegmentPackager
-
Methods inherited from interface org.refcodes.serial.ReadyToReceiveTimeoutInMsAccessor
getReadyToReceiveTimeoutInMs
-
Methods inherited from interface org.refcodes.serial.Section
fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFrom
-
Methods inherited from interface org.refcodes.serial.Transmission
getLength, toSchema, toSequence, toSimpleTypeMap, transmitTo, transmitTo
-
-
-
-
Constructor Detail
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, SegmentPackager aReadyToReceiveSegmentPackager)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes, SegmentPackager aReadyToReceiveSegmentPackager)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, byte[] aReadyToReceiveMagicBytes)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber, SegmentPackager aReadyToReceiveSegmentPackager)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, int aReadyToReceiveRetryNumber)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, long aReadyToReceiveTimeoutInMs)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes, SegmentPackager aReadyToReceiveSegmentPackager)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToReceiveMagicBytes)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToReceiveRetryNumber, long aReadyToReceiveTimeoutInMs)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToReceiveTimeoutInMs)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aReadyToReceiveTimeoutInMs, SegmentPackager aReadyToReceiveSegmentPackager)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs)
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, TransmissionMetrics aTransmissionMetrics)
-
-
Method Detail
-
fromTransmission
public void fromTransmission(Sequence aSequence, int aOffset, int aLength) throws TransmissionException
(Re-)initializes this instance with the the givenSequence
data.- Specified by:
fromTransmission
in interfaceSection
- Parameters:
aSequence
- TheSequence
data from which to (re-)initialize this instance.aOffset
- The offset where to start processing the providedSequence
.aLength
- The length of data assigned by theSequence
.- Throws:
TransmissionException
- thrown in case a givenSequence
cannot be processed.
-
receiveFrom
public void receiveFrom(InputStream aInputStream, int aLength, OutputStream aReturnStream) throws IOException, TransmissionException
(Re-)initializes this instance by receiving the accordingSequence
from the givenInputStream
. Implementations providing error correction methods use the provided feedbackOutputStream
to do some sort of "stop-and-wait ARQ" or apply similar methods to ensure correctness of the received data.- Specified by:
receiveFrom
in interfaceSection
- Parameters:
aInputStream
- TheInputStream
from which to read the instance's (re-)initializationSequence
from.aLength
- The length of data assigned by the byte array.aReturnStream
- AnOutputStream
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 reading data from theInputStream
caused problems.TransmissionException
- thrown in case a givenInputStream
bytes cannot be processed.
-
builder
public static <DECORATEE extends Section> ReadyToReceiveSectionDecorator.Builder<DECORATEE> builder()
Creates builder to buildReadyToReceiveSectionDecorator
.- Type Parameters:
DECORATEE
- The decoratee type describing the according subclass to be enriched.- Returns:
- created builder
-
-