Class ResponseAdapter

java.lang.Object
org.serviceconnector.net.res.ResponseAdapter
All Implemented Interfaces:
IResponse
Direct Known Subclasses:
NettyHttpResponse, NettyTcpResponse

public abstract class ResponseAdapter extends Object implements IResponse
The Class ResponseAdapter. Provides basic functionality for responses.
Author:
JTraber
  • Field Details

    • encoderDecoder

      protected IEncoderDecoder encoderDecoder
      The encoder decoder.
    • scmp

      protected SCMPMessage scmp
      The scmp.
    • channel

      protected io.netty.channel.Channel channel
      The event from Netty framework.
  • Constructor Details

    • ResponseAdapter

      public ResponseAdapter(io.netty.channel.Channel channel)
      Instantiates a new response adapter.
      Parameters:
      channel - the event
  • Method Details

    • write

      public abstract void write() throws Exception
      Write the response.
      Specified by:
      write in interface IResponse
      Throws:
      Exception - the exception
    • getBuffer

      public io.netty.buffer.ByteBuf getBuffer() throws Exception
      Gets the buffer. Encodes the scmp.
      Returns:
      the buffer
      Throws:
      Exception - the exception
    • setSCMP

      public void setSCMP(SCMPMessage scmp)
      Sets the scmp.
      Specified by:
      setSCMP in interface IResponse
      Parameters:
      scmp - the new scmp
    • getSCMP

      public SCMPMessage getSCMP()
      Gets the scmp.
      Specified by:
      getSCMP in interface IResponse
      Returns:
      the scmp
    • isLarge

      public boolean isLarge()
      Checks if is response content is large.
      Specified by:
      isLarge in interface IResponse
      Returns:
      true, if is large