Module org.refcodes.serial
Package org.refcodes.serial
Class ReadyToSendSegmentDecorator<DECORATEE extends Segment>
java.lang.Object
org.refcodes.serial.AbstractReadyToSendTransmissionDecorator<DECORATEE>
org.refcodes.serial.ReadyToSendSegmentDecorator<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,ClearToSendMagicBytesAccessor,ClearToSendSegmentPackagerAccessor,ClearToSendTimeoutMillisAccessor,DecoratorSegment<DECORATEE>,EnquiryStandbyTimeMillisAccessor,ReadyToSendMagicBytesAccessor,ReadyToSendRetryNumberAccessor,ReadyToSendSegmentPackagerAccessor,ReadyToSendTimeoutMillisAccessor,ReadyToSendTransmission,Segment,Transmission,Transmission.TransmissionMixin
public class ReadyToSendSegmentDecorator<DECORATEE extends Segment>
extends AbstractReadyToSendTransmissionDecorator<DECORATEE>
implements Segment, DecoratorSegment<DECORATEE>
The
ReadyToSendSegmentDecorator class implements a decorator
providing ReadyToSendTransmission functionality for a
Segment.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder to buildReadyToSendSegmentDecoratorinstances.Nested classes/interfaces inherited from interface org.refcodes.serial.ClearToSendMagicBytesAccessor
ClearToSendMagicBytesAccessor.ClearToSendMagicBytesBuilder<B extends ClearToSendMagicBytesAccessor.ClearToSendMagicBytesBuilder<B>>, ClearToSendMagicBytesAccessor.ClearToSendMagicBytesMutator, ClearToSendMagicBytesAccessor.ClearToSendMagicBytesPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ClearToSendSegmentPackagerAccessor
ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerBuilder<B extends ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerBuilder<B>>, ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerMutator, ClearToSendSegmentPackagerAccessor.ClearToSendSegmentPackagerPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ClearToSendTimeoutMillisAccessor
ClearToSendTimeoutMillisAccessor.ClearToSendTimeoutMillisBuilder<B extends ClearToSendTimeoutMillisAccessor.ClearToSendTimeoutMillisBuilder<B>>, ClearToSendTimeoutMillisAccessor.ClearToSendTimeoutMillisMutator, ClearToSendTimeoutMillisAccessor.ClearToSendTimeoutMillisPropertyNested 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.ReadyToSendMagicBytesAccessor
ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesBuilder<B extends ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesBuilder<B>>, ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesMutator, ReadyToSendMagicBytesAccessor.ReadyToSendMagicBytesPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendRetryNumberAccessor
ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberBuilder<B extends ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberBuilder<B>>, ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberMutator, ReadyToSendRetryNumberAccessor.ReadyToSendRetryNumberPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendSegmentPackagerAccessor
ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerBuilder<B extends ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerBuilder<B>>, ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerMutator, ReadyToSendSegmentPackagerAccessor.ReadyToSendSegmentPackagerPropertyNested classes/interfaces inherited from interface org.refcodes.serial.ReadyToSendTimeoutMillisAccessor
ReadyToSendTimeoutMillisAccessor.ReadyToSendTimeoutMillisBuilder<B extends ReadyToSendTimeoutMillisAccessor.ReadyToSendTimeoutMillisBuilder<B>>, ReadyToSendTimeoutMillisAccessor.ReadyToSendTimeoutMillisMutator, ReadyToSendTimeoutMillisAccessor.ReadyToSendTimeoutMillisPropertyNested classes/interfaces inherited from interface org.refcodes.serial.Segment
Segment.SegmentMixinNested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin -
Field Summary
Fields inherited from class org.refcodes.serial.AbstractReadyToSendTransmissionDecorator
_clearToSendMagicBytes, _clearToSendMagicBytesSegment, _clearToSendSegment, _clearToSendSegmentPackager, _clearToSendTimeoutInMs, _decoratee, _enquiryStandbyTimeInMs, _readyToSendMagicBytes, _readyToSendMagicBytesSegment, _readyToSendRetryNumber, _readyToSendSegment, _readyToSendSegmentPackager, _readyToSendTimeoutInMs, CTS_MAGIC_BYTES, CTS_TIMEOUT_IN_MS, RTS_MAGIC_BYTES, RTS_RETRY_NUMBER, RTS_TIMEOUT_IN_MS -
Constructor Summary
ConstructorsConstructorDescriptionReadyToSendSegmentDecorator(DECORATEE aDecoratee) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, byte[] aClearToSendMagicBytes) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, byte[] aClearToSendMagicBytes) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, byte[] aClearToSendMagicBytes) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, byte[] aClearToSendMagicBytes) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) ReadyToSendSegmentDecorator(DECORATEE aDecoratee, TransmissionMetrics aTransmissionMetrics) -
Method Summary
Modifier and TypeMethodDescriptionstatic <DECORATEE extends Segment>
ReadyToSendSegmentDecorator.Builder<DECORATEE>builder()Creates builder to buildReadyToSendSegmentDecorator.intfromTransmission(Sequence aSequence, int aOffset) (Re-)initializes this instance with the the givenSequencedata.voidreceiveFrom(InputStream aInputStream, OutputStream aReturnStream) (Re-)initializes this instance by receiving the accordingSequencefrom the givenInputStream.Methods inherited from class org.refcodes.serial.AbstractReadyToSendTransmissionDecorator
equals, getClearToSendMagicBytes, getClearToSendSegmentPackager, getClearToSendTimeoutMillis, getDecoratee, getEnquiryStandbyTimeMillis, getLength, getReadyToSendMagicBytes, getReadyToSendRetryNumber, getReadyToSendSegmentPackager, getReadyToSendTimeoutMillis, hashCode, receiveCtsTransmitTo, 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.Segment
fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFromMethods inherited from interface org.refcodes.serial.Transmission
getLength, reset, toSchema, toSequence, toSimpleTypeMap, transmitTo, transmitTo
-
Constructor Details
-
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator() -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, byte[] aClearToSendMagicBytes) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, byte[] aClearToSendMagicBytes) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, byte[] aReadyToSendMagicBytes, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, byte[] aClearToSendMagicBytes) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, byte[] aClearToSendMagicBytes) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, int aReadyToSendRetryNumber, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, byte[] aReadyToSendMagicBytes, SegmentPackager aReadyToSendSegmentPackager, byte[] aClearToSendMagicBytes, SegmentPackager aClearToSendSegmentPackager) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, int aReadyToSendRetryNumber, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToSendTimeoutInMs, long aClearToSendTimeoutInMs) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aEnquiryStandbyTimeInMs, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) -
ReadyToSendSegmentDecorator
public ReadyToSendSegmentDecorator(DECORATEE aDecoratee, long aReadyToSendTimeoutInMs, SegmentPackager aReadyToSendSegmentPackager, long aClearToSendTimeoutInMs, SegmentPackager aClearToSendSegmentPackager) -
ReadyToSendSegmentDecorator
-
ReadyToSendSegmentDecorator
-
ReadyToSendSegmentDecorator
-
-
Method Details
-
fromTransmission
(Re-)initializes this instance with the the givenSequencedata.- Specified by:
fromTransmissionin interfaceSegment- Parameters:
aSequence- TheSequencedata from which to (re-)initialize this instance.aOffset- The offset where to start processing the providedSequence.- Returns:
- The index after the last offset into the given
Sequenceprocessed by this method. - Throws:
TransmissionException- thrown in case a givenSequencecannot be processed.
-
receiveFrom
(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 interfaceSegment- Parameters:
aInputStream- TheInputStreamfrom which to read the instance's (re-)initializationSequencefrom.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 given transmission cannot be processed.
-
builder
Creates builder to buildReadyToSendSegmentDecorator.- Type Parameters:
DECORATEE- The decoratee type describing the according subclass to be enriched.- Returns:
- created builder
-