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
,org.refcodes.mixin.Schemable
,DecoratorSection<DECORATEE>
,EnquiryStandbyTimeMillisAccessor
,ReadyToReceiveMagicBytesAccessor
,ReadyToReceiveRetryNumberAccessor
,ReadyToReceiveSegmentPackagerAccessor
,ReadyToReceiveTimeoutMillisAccessor
,ReadyToReceiveTransmission
,Section
,Transmission
,Transmission.TransmissionMixin
public class ReadyToReceiveSectionDecorator<DECORATEE extends Section>
extends AbstractReadyToReceiveTransmissionDecorator<DECORATEE>
implements Section, DecoratorSection<DECORATEE>
The
ReadyToReceiveSectionDecorator
class implements a decorator
providing ReadyToReceiveTransmission
functionality for a
Segment
.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builder to buildReadyToReceiveSectionDecorator
instances.Nested classes/interfaces inherited from interface org.refcodes.mixin.DecorateeAccessor
org.refcodes.mixin.DecorateeAccessor.DecorateeBuilder<DECORATEE extends Object,
B extends org.refcodes.mixin.DecorateeAccessor.DecorateeBuilder<DECORATEE, B>>, org.refcodes.mixin.DecorateeAccessor.DecorateeMutator<DECORATEE extends Object>, org.refcodes.mixin.DecorateeAccessor.DecorateeProperty<DECORATEE extends Object> Nested classes/interfaces inherited from interface org.refcodes.serial.EnquiryStandbyTimeMillisAccessor
EnquiryStandbyTimeMillisAccessor.EnquiryStandbyTimeMillisBuilder<B extends EnquiryStandbyTimeMillisAccessor.EnquiryStandbyTimeMillisBuilder<B>>, EnquiryStandbyTimeMillisAccessor.EnquiryStandbyTimeMillisMutator, EnquiryStandbyTimeMillisAccessor.EnquiryStandbyTimeMillisProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.LengthAccessor
org.refcodes.mixin.LengthAccessor.LengthBuilder<B extends org.refcodes.mixin.LengthAccessor.LengthBuilder<B>>, org.refcodes.mixin.LengthAccessor.LengthMutator, org.refcodes.mixin.LengthAccessor.LengthProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveMagicBytesAccessor
ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesBuilder<B extends ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesBuilder<B>>, ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesMutator, ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveRetryNumberAccessor
ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberBuilder<B extends ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberBuilder<B>>, ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberMutator, ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveSegmentPackagerAccessor
ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerBuilder<B extends ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerBuilder<B>>, ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerMutator, ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveTimeoutMillisAccessor
ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisBuilder<B extends ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisBuilder<B>>, ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisMutator, ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.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
ConstructorsConstructorDescriptionReadyToReceiveSectionDecorator
(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
Modifier and TypeMethodDescriptionstatic <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, getEnquiryStandbyTimeMillis, getLength, getReadyToReceiveMagicBytes, getReadyToReceiveRetryNumber, getReadyToReceiveSegmentPackager, getReadyToReceiveTimeoutMillis, 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.mixin.DecorateeAccessor
getDecoratee
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 Details
-
ReadyToReceiveSectionDecorator
-
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
-
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
-
ReadyToReceiveSectionDecorator
public ReadyToReceiveSectionDecorator(DECORATEE aDecoratee, TransmissionMetrics aTransmissionMetrics)
-
-
Method Details
-
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 (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
-