Class ConnectionProtocol

All Implemented Interfaces:
Runnable

public class ConnectionProtocol extends AsyncService
Version:
$Revision: 1.68 $
Author:
$author$
  • Constructor Details

    • ConnectionProtocol

      public ConnectionProtocol()
      Creates a new ConnectionProtocol object.
  • Method Details

    • addChannelFactory

      public void addChannelFactory(String channelName, ChannelFactory cf) throws IOException
      Parameters:
      channelName -
      cf -
      Throws:
      IOException
    • removeChannelFactory

      public void removeChannelFactory(String channelName)
      Parameters:
      channelName -
    • containsChannelFactory

      public boolean containsChannelFactory(String channelName)
      Parameters:
      channelName -
      Returns:
    • allowGlobalRequest

      public void allowGlobalRequest(String requestName, GlobalRequestHandler handler)
      Parameters:
      requestName -
      handler -
    • openChannel

      public boolean openChannel(Channel channel) throws IOException
      Parameters:
      channel -
      Returns:
      Throws:
      IOException
    • isConnected

      public boolean isConnected()
      Returns:
    • openChannel

      public boolean openChannel(Channel channel, ChannelEventListener eventListener) throws IOException
      Parameters:
      channel -
      eventListener -
      Returns:
      Throws:
      IOException
      SshException
    • onStop

      protected void onStop()
      Description copied from class: AsyncService

      The service thread calls this method when the thread is exiting.

      Specified by:
      onStop in class AsyncService
    • sendChannelData

      public void sendChannelData(Channel channel, byte[] data) throws IOException
      Parameters:
      channel -
      data -
      Throws:
      IOException
    • sendChannelEOF

      public void sendChannelEOF(Channel channel) throws IOException
      Parameters:
      channel -
      Throws:
      IOException
    • sendChannelExtData

      public void sendChannelExtData(Channel channel, int extendedType, byte[] data) throws IOException
      Parameters:
      channel -
      extendedType -
      data -
      Throws:
      IOException
    • sendChannelRequest

      public boolean sendChannelRequest(Channel channel, String requestType, boolean wantReply, byte[] requestData) throws IOException
      Parameters:
      channel -
      requestType -
      wantReply -
      requestData -
      Returns:
      Throws:
      IOException
      SshException
    • sendChannelRequestFailure

      public void sendChannelRequestFailure(Channel channel) throws IOException
      Parameters:
      channel -
      Throws:
      IOException
    • sendChannelRequestSuccess

      public void sendChannelRequestSuccess(Channel channel) throws IOException
      Parameters:
      channel -
      Throws:
      IOException
    • sendChannelWindowAdjust

      public void sendChannelWindowAdjust(Channel channel, long bytesToAdd) throws IOException
      Parameters:
      channel -
      bytesToAdd -
      Throws:
      IOException
    • sendGlobalRequest

      public byte[] sendGlobalRequest(String requestName, boolean wantReply, byte[] requestData) throws IOException
      Parameters:
      requestName -
      wantReply -
      requestData -
      Returns:
      Throws:
      IOException
      SshException
    • getAsyncMessageFilter

      protected int[] getAsyncMessageFilter()
      Description copied from class: AsyncService

      Implement this method by returning the message ids of the asyncrounous messages your implementation wants to receive.

      Specified by:
      getAsyncMessageFilter in class AsyncService
      Returns:
    • closeChannel

      protected void closeChannel(Channel channel) throws IOException
      Parameters:
      channel -
      Throws:
      IOException
    • onGlobalRequest

      protected void onGlobalRequest(String requestName, boolean wantReply, byte[] requestData) throws IOException
      Parameters:
      requestName -
      wantReply -
      requestData -
      Throws:
      IOException
    • onMessageReceived

      protected void onMessageReceived(SshMessage msg) throws IOException
      Description copied from class: AsyncService

      Called by the service thread when an asyncronous message is received.

      Specified by:
      onMessageReceived in class AsyncService
      Parameters:
      msg -
      Throws:
      IOException
    • onServiceAccept

      protected void onServiceAccept()
      Description copied from class: Service

      Called when the service is accepted by the remote server.

      Specified by:
      onServiceAccept in class Service
    • onServiceInit

      protected void onServiceInit(int startMode) throws IOException
      Description copied from class: Service

      Called when the service is intialized.

      Specified by:
      onServiceInit in class Service
      Parameters:
      startMode -
      Throws:
      IOException
    • onServiceRequest

      protected void onServiceRequest()
      Specified by:
      onServiceRequest in class Service
    • sendChannelFailure

      protected void sendChannelFailure(Channel channel) throws IOException
      Parameters:
      channel -
      Throws:
      IOException
    • sendChannelOpenConfirmation

      protected void sendChannelOpenConfirmation(Channel channel) throws IOException
      Parameters:
      channel -
      Throws:
      IOException
    • sendChannelOpenFailure

      protected void sendChannelOpenFailure(long remoteChannelId, long reasonCode, String additionalInfo, String languageTag) throws IOException
      Parameters:
      remoteChannelId -
      reasonCode -
      additionalInfo -
      languageTag -
      Throws:
      IOException
    • sendGlobalRequestFailure

      protected void sendGlobalRequestFailure() throws IOException
      Throws:
      IOException
    • sendGlobalRequestSuccess

      protected void sendGlobalRequestSuccess(byte[] requestData) throws IOException
      Parameters:
      requestData -
      Throws:
      IOException
    • freeChannel

      protected void freeChannel(Channel channel)
      Parameters:
      channel -