Class DefaultClientChannelFactory

java.lang.Object
com.sshtools.client.DefaultClientChannelFactory
All Implemented Interfaces:
com.sshtools.synergy.ssh.ChannelFactory<SshClientContext>

public class DefaultClientChannelFactory extends Object implements com.sshtools.synergy.ssh.ChannelFactory<SshClientContext>
Implements a default ChannelFactory for an SSH client.
  • Constructor Details

    • DefaultClientChannelFactory

      public DefaultClientChannelFactory()
  • Method Details

    • createChannel

      public final com.sshtools.synergy.ssh.ChannelNG<SshClientContext> createChannel(String channeltype, com.sshtools.common.ssh.SshConnection con) throws com.sshtools.common.ssh.UnsupportedChannelException, com.sshtools.common.permissions.PermissionDeniedException
      Called when a channel needs to be created.
      Specified by:
      createChannel in interface com.sshtools.synergy.ssh.ChannelFactory<SshClientContext>
      Throws:
      com.sshtools.common.ssh.UnsupportedChannelException
      com.sshtools.common.permissions.PermissionDeniedException
    • onCreateChannel

      protected com.sshtools.synergy.ssh.ChannelNG<SshClientContext> onCreateChannel(String channeltype, com.sshtools.common.ssh.SshConnection con) throws com.sshtools.common.ssh.UnsupportedChannelException, com.sshtools.common.permissions.PermissionDeniedException
      Throws:
      com.sshtools.common.ssh.UnsupportedChannelException
      com.sshtools.common.permissions.PermissionDeniedException
    • createSubsystem

      public com.sshtools.common.ssh.Subsystem createSubsystem(String name, com.sshtools.common.ssh.SessionChannel session) throws com.sshtools.common.ssh.UnsupportedChannelException, com.sshtools.common.permissions.PermissionDeniedException
      Request to create a subsystem. This method throws an UnsupportedChannelException as we do not support the opening of subsystems on the client.
      Specified by:
      createSubsystem in interface com.sshtools.synergy.ssh.ChannelFactory<SshClientContext>
      Throws:
      com.sshtools.common.ssh.UnsupportedChannelException
      com.sshtools.common.permissions.PermissionDeniedException
    • executeCommand

      public com.sshtools.common.command.ExecutableCommand executeCommand(com.sshtools.common.ssh.SessionChannel channel, String[] args, Map<String,String> environment) throws com.sshtools.common.permissions.PermissionDeniedException, com.sshtools.common.ssh.UnsupportedChannelException
      Specified by:
      executeCommand in interface com.sshtools.synergy.ssh.ChannelFactory<SshClientContext>
      Throws:
      com.sshtools.common.permissions.PermissionDeniedException
      com.sshtools.common.ssh.UnsupportedChannelException
    • supportedCommands

      public com.sshtools.common.ssh.components.ComponentFactory<com.sshtools.common.command.ExecutableCommand> supportedCommands()
      Specified by:
      supportedCommands in interface com.sshtools.synergy.ssh.ChannelFactory<SshClientContext>