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.Resetable,org.refcodes.schema.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 classBuilder to buildReadyToReceiveSectionDecoratorinstances.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.EnquiryStandbyTimeMillisPropertyNested 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.LengthPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveMagicBytesAccessor
ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesBuilder<B extends ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesBuilder<B>>, ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesMutator, ReadyToReceiveMagicBytesAccessor.ReadyToReceiveMagicBytesPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveRetryNumberAccessor
ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberBuilder<B extends ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberBuilder<B>>, ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberMutator, ReadyToReceiveRetryNumberAccessor.ReadyToReceiveRetryNumberPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveSegmentPackagerAccessor
ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerBuilder<B extends ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerBuilder<B>>, ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerMutator, ReadyToReceiveSegmentPackagerAccessor.ReadyToReceiveSegmentPackagerPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToReceiveTimeoutMillisAccessor
ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisBuilder<B extends ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisBuilder<B>>, ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisMutator, ReadyToReceiveTimeoutMillisAccessor.ReadyToReceiveTimeoutMillisPropertyNested classes/interfaces inherited from interface org.refcodes.serial.Section
Section.SectionMixinNested 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.voidfromTransmission(Sequence aSequence, int aOffset, int aLength) (Re-)initializes this instance with the the givenSequencedata.voidreceiveFrom(InputStream aInputStream, int aLength, OutputStream aReturnStream) (Re-)initializes this instance by receiving the accordingSequencefrom the givenInputStream.Methods inherited from class org.refcodes.serial.AbstractReadyToReceiveTransmissionDecorator
equals, getDecoratee, getEnquiryStandbyTimeMillis, getLength, getReadyToReceiveMagicBytes, getReadyToReceiveRetryNumber, getReadyToReceiveSegmentPackager, getReadyToReceiveTimeoutMillis, hashCode, reset, toSchema, toSequence, toSimpleTypeMap, toString, transmitToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.refcodes.mixin.DecorateeAccessor
getDecorateeMethods inherited from interface org.refcodes.serial.Section
fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFromMethods inherited from interface org.refcodes.serial.Transmission
getLength, reset, 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 givenSequencedata.- Specified by:
fromTransmissionin interfaceSection- Parameters:
aSequence- TheSequencedata 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 givenSequencecannot be processed.
-
receiveFrom
public void receiveFrom(InputStream aInputStream, int aLength, OutputStream aReturnStream) throws IOException (Re-)initializes this instance by receiving the accordingSequencefrom the givenInputStream. Implementations providing error correction methods use the provided feedbackOutputStreamto do some sort of "stop-and-wait ARQ" or apply similar methods to ensure correctness of the received data.- Specified by:
receiveFromin interfaceSection- Parameters:
aInputStream- TheInputStreamfrom which to read the instance's (re-)initializationSequencefrom.aLength- The length of data assigned by the byte array.aReturnStream- AnOutputStreambeing 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 theInputStreamcaused problems.TransmissionException- thrown in case a givenInputStreambytes 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
-