Class AgentProtocolClientFilterLayer

java.lang.Object
org.jenkinsci.remoting.protocol.FilterLayer
org.jenkinsci.remoting.protocol.impl.AgentProtocolClientFilterLayer
All Implemented Interfaces:
ProtocolLayer, ProtocolLayer.Recv, ProtocolLayer.Send

public class AgentProtocolClientFilterLayer extends FilterLayer
A FilterLayer that sends the AgentProtocol client handshake.
Since:
3.0
  • Constructor Details

    • AgentProtocolClientFilterLayer

      public AgentProtocolClientFilterLayer(String name)
      Constructor
      Parameters:
      name - the AgentProtocol.getName().
  • Method Details

    • start

      public void start() throws IOException
      Starts this layer. All layers in the stack will be initialized before a call to this method. All lower layers in the stack will have been started before this layer is started.
      Specified by:
      start in interface ProtocolLayer
      Overrides:
      start in class FilterLayer
      Throws:
      IOException - if something goes wrong.
    • onRecv

      public void onRecv(@NonNull ByteBuffer data) throws IOException
      SPI: Callback on data being received from the lower layer.
      Specified by:
      onRecv in interface ProtocolLayer.Recv
      Specified by:
      onRecv in class FilterLayer
      Parameters:
      data - the data received. Any data consumed from the ByteBuffer can be assumed as processed. Any data not consumed from the ByteBuffer will be the responsibility of the caller to resubmit in subsequent calls.
      Throws:
      IOException - if there was an error during processing of the received data.
    • doSend

      public void doSend(@NonNull ByteBuffer data) throws IOException
      SPI: Sends data to the lower layer.
      Specified by:
      doSend in interface ProtocolLayer.Send
      Specified by:
      doSend in class FilterLayer
      Parameters:
      data - the data to send. Any data consumed from the ByteBuffer can be assumed as processed. Any data not consumed from the ByteBuffer will be the responsibility of the caller to resubmit in subsequent calls.
      Throws:
      IOException - if there was an error during processing of the data.