Class AbstractErrorCorrectionTransmissionDecorator<DECORATEE extends Transmission>

java.lang.Object
org.refcodes.serial.AbstractErrorCorrectionTransmissionDecorator<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, AcknowledgeRetryNumberAccessor, AcknowledgeTimeoutInMsAccessor, ErrorCorrectionTransmission, Transmission, Transmission.TransmissionMixin
Direct Known Subclasses:
AbstractStopAndWaitTransmissionDecorator

public abstract class AbstractErrorCorrectionTransmissionDecorator<DECORATEE extends Transmission>
extends Object
implements ErrorCorrectionTransmission, Transmission.TransmissionMixin, org.refcodes.mixin.DecorateeAccessor<DECORATEE>
The AbstractErrorCorrectionTransmissionDecorator class implements a decorator providing base functionality for an error correction Transmission.
See Also:
Serialized Form
  • Field Details

    • ACK_TIMEOUT_IN_MS

      public static final String ACK_TIMEOUT_IN_MS
      See Also:
      Constant Field Values
    • ACK_RETRY_NUMBER

      public static final String ACK_RETRY_NUMBER
      See Also:
      Constant Field Values
    • _acknowledgeRetryNumber

      protected int _acknowledgeRetryNumber
    • _acknowledgeTimeoutInMs

      protected long _acknowledgeTimeoutInMs
    • _decoratee

      protected DECORATEE extends Transmission _decoratee
  • Constructor Details

    • AbstractErrorCorrectionTransmissionDecorator

      public AbstractErrorCorrectionTransmissionDecorator​(DECORATEE aSegment, TransmissionMetrics aTransmissionMetrics)
      Constructs a AbstractErrorCorrectionTransmissionDecorator instance with the given decoratee. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
      Parameters:
      aSegment - The decoratee or referencee to be contained by this facade.
      aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
    • AbstractErrorCorrectionTransmissionDecorator

      protected AbstractErrorCorrectionTransmissionDecorator()
      Hook constructor to be used by sub-classes.
    • AbstractErrorCorrectionTransmissionDecorator

      public AbstractErrorCorrectionTransmissionDecorator​(DECORATEE aDecoratee)
      Constructs a AbstractErrorCorrectionTransmissionDecorator instance with the given decoratee. Takes a retry count of Object.notify() by default and a timeout detecting a retry situation of IoTimeout.MIN.
      Parameters:
      aDecoratee - The decoratee to be contained by this facade.
    • AbstractErrorCorrectionTransmissionDecorator

      public AbstractErrorCorrectionTransmissionDecorator​(DECORATEE aSegment, int aAckRetryNumber, long aAckTimeoutInMs)
      Constructs a AbstractErrorCorrectionTransmissionDecorator instance with the given decoratee.
      Parameters:
      aSegment - The decoratee or referencee to be contained by this facade.
      aAckRetryNumber - The number of retries waiting for an ACK from the return channel.
      aAckTimeoutInMs - The timeout in milliseconds to pend till the next retry.
  • Method Details

    • toSchema

      public Schema toSchema()
      Retrieves the Schema representing the Transmission. Retrieving a Schema is useful when analyzing and debugging data structures such as a AllocSectionDecoratorSegment instance to help document, learn and verify on the structure (as well as the content) of that very AllocSectionDecoratorSegment.
      Specified by:
      toSchema in interface Transmission
      Returns:
      The Schema representation of the implementing type for debugging and verification (or documentation) purposes.
    • getAcknowledgeRetryNumber

      public int getAcknowledgeRetryNumber()
      Retrieves the number of retries from the acknowledge retry number. A acknowledge retry number is the overall number of retries to use when counting retries.
      Specified by:
      getAcknowledgeRetryNumber in interface AcknowledgeRetryNumberAccessor
      Returns:
      The number of retries stored by the acknowledge retry number.
    • getAcknowledgeTimeoutInMs

      public long getAcknowledgeTimeoutInMs()
      The acknowledge timeout attribute in milliseconds.
      Specified by:
      getAcknowledgeTimeoutInMs in interface AcknowledgeTimeoutInMsAccessor
      Returns:
      An integer with the timeout in milliseconds.
    • getLength

      public int getLength()
      Determines the overall length of this Transmission. In case of nested Transmission instances, all length values from all sub-segments are accumulated to the result as well.
      Specified by:
      getLength in interface org.refcodes.mixin.LengthAccessor
      Specified by:
      getLength in interface Transmission
      Returns:
      The (overall) length of the Transmission (including any sub-segments).
    • toTransmission

      public Sequence toTransmission()
      Provides the Sequence representation of this Transmission. In case of nested Transmission instances, all Sequence representations from all sub-segments are accumulated to the result as well.
      Specified by:
      toTransmission in interface Transmission
      Returns:
      The according instance's Sequence.
    • getDecoratee

      public DECORATEE getDecoratee()
      Specified by:
      getDecoratee in interface org.refcodes.mixin.DecorateeAccessor<DECORATEE extends Transmission>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals​(Object obj)
      Overrides:
      equals in class Object
    • toSimpleTypeMap

      public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()
      Returns the SimpleTypeMap representation of this Transmission. In case this Transmission has Transmission children, then the children are queried as well and contained in the resulting SimpleTypeMap. The aliases of the according Transmission instances represent the resulting path to a Transmission's final simple type.
      Specified by:
      toSimpleTypeMap in interface Transmission
      Returns:
      The SimpleTypeMap representing this Transmission and (if any) its children, with the according aliases forming the paths to the Transmission's values.