Package com.sshtools.client
Class DefaultClientChannelFactory
java.lang.Object
com.sshtools.client.DefaultClientChannelFactory
- All Implemented Interfaces:
ChannelFactory<SshClientContext>
Implements a default ChannelFactory for an SSH client.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ChannelNG<SshClientContext>createChannel(String channeltype, SshConnection con) Called when a channel needs to be created.createSubsystem(String name, SessionChannel session) Request to create a subsystem.executeCommand(SessionChannel channel, String[] args, Map<String, String> environment) protected ChannelNG<SshClientContext>onCreateChannel(String channeltype, SshConnection con)
-
Constructor Details
-
DefaultClientChannelFactory
public DefaultClientChannelFactory()
-
-
Method Details
-
createChannel
public final ChannelNG<SshClientContext> createChannel(String channeltype, SshConnection con) throws UnsupportedChannelException, PermissionDeniedException Called when a channel needs to be created.- Specified by:
createChannelin interfaceChannelFactory<SshClientContext>- Throws:
UnsupportedChannelExceptionPermissionDeniedException
-
onCreateChannel
protected ChannelNG<SshClientContext> onCreateChannel(String channeltype, SshConnection con) throws UnsupportedChannelException, PermissionDeniedException -
createSubsystem
public Subsystem createSubsystem(String name, SessionChannel session) throws UnsupportedChannelException, 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:
createSubsystemin interfaceChannelFactory<SshClientContext>- Throws:
UnsupportedChannelExceptionPermissionDeniedException
-
executeCommand
public ExecutableCommand executeCommand(SessionChannel channel, String[] args, Map<String, String> environment) throws PermissionDeniedException, UnsupportedChannelException- Specified by:
executeCommandin interfaceChannelFactory<SshClientContext>- Throws:
PermissionDeniedExceptionUnsupportedChannelException
-
supportedCommands
- Specified by:
supportedCommandsin interfaceChannelFactory<SshClientContext>
-