com.tibbo.aggregate.common.protocol

## Class CompressedCommandWriter<C extends OutgoingAggreGateCommand>

- java.lang.Object
- - com.tibbo.aggregate.common.protocol.DefaultCommandWriter<C>
  - - com.tibbo.aggregate.common.protocol.CompressedCommandWriter<C>

- All Implemented Interfaces:
    CommandWriter<C>

      public class CompressedCommandWriter<C extends OutgoingAggreGateCommand>
      extends DefaultCommandWriter<C>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `MINIMAL_COMMAND_SIZE_TO_COMPRESS`
    `static byte` | `TYPE_COMPRESSED`
    `static byte` | `TYPE_RAW`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompressedCommandWriter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected byte[]` | `extractCommandBody(OutgoingAggreGateCommand command, BlockingChannel channel)`
    `void` | `setVersion(ProtocolVersion version)`
    `void` | `setVersionAfterNextWrite(ProtocolVersion version)`
    `void` | `write(C command, BlockingChannel channel, boolean needsFlushing)`

    - ### Methods inherited from class com.tibbo.aggregate.common.protocol.DefaultCommandWriter

      `composeByteBuffer, log, writeBufferToChannel`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.tibbo.aggregate.common.communication.CommandWriter

      `write`

- - ### Field Detail

    - #### TYPE_RAW

          public static final byte TYPE_RAW

      See Also:
        Constant Field Values

    - #### TYPE_COMPRESSED

          public static final byte TYPE_COMPRESSED

      See Also:
        Constant Field Values

    - #### MINIMAL_COMMAND_SIZE_TO_COMPRESS

          public static final int MINIMAL_COMMAND_SIZE_TO_COMPRESS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CompressedCommandWriter

          public CompressedCommandWriter()

  - ### Method Detail

    - #### write

          public void write(C command,
                            BlockingChannel channel,
                            boolean needsFlushing)
                     throws java.io.IOException,
                            DisconnectionException

      Specified by:
        `write` in interface `CommandWriter<C extends OutgoingAggreGateCommand>`
      Overrides:
        `write` in class `DefaultCommandWriter<C extends OutgoingAggreGateCommand>`
      Throws:
        `java.io.IOException`
        `DisconnectionException`

    - #### extractCommandBody

          protected byte[] extractCommandBody(OutgoingAggreGateCommand command,
                                              BlockingChannel channel)

    - #### setVersion

          public void setVersion(ProtocolVersion version)

      Specified by:
        `setVersion` in interface `CommandWriter<C extends OutgoingAggreGateCommand>`
      Overrides:
        `setVersion` in class `DefaultCommandWriter<C extends OutgoingAggreGateCommand>`

    - #### setVersionAfterNextWrite

          public void setVersionAfterNextWrite(ProtocolVersion version)

      Specified by:
        `setVersionAfterNextWrite` in interface `CommandWriter<C extends OutgoingAggreGateCommand>`
      Overrides:
        `setVersionAfterNextWrite` in class `DefaultCommandWriter<C extends OutgoingAggreGateCommand>`