Groovy Documentation

org.hidetake.gradle.ssh.internal.connection
[Groovy] Interface Connection


interface Connection

A SSH connection.

Authors:
hidetake.org


Method Summary
void close()

Cleanup the connection and all channels.

ChannelExec createExecutionChannel(java.lang.String command, OperationSettings operationSettings)

Create an execution channel.

ChannelSftp createSftpChannel()

Create a SFTP channel.

ChannelShell createShellChannel(OperationSettings operationSettings)

Create a shell channel.

void executeCallbackForClosedChannels()

Execute registered closures.

Remote getRemote()

Return the remote host.

boolean isAnyPending()

Return if any channel is pending.

void whenClosed(Channel channel, groovy.lang.Closure closure)

Register a closure called when the channel is closed.

 

Method Detail

close

void close()
Cleanup the connection and all channels.


createExecutionChannel

ChannelExec createExecutionChannel(java.lang.String command, OperationSettings operationSettings)
Create an execution channel.
Returns:
a channel
Parameters:
command
operationSettings


createSftpChannel

ChannelSftp createSftpChannel()
Create a SFTP channel.
Returns:
a channel


createShellChannel

ChannelShell createShellChannel(OperationSettings operationSettings)
Create a shell channel.
Returns:
a channel
Parameters:
operationSettings


executeCallbackForClosedChannels

void executeCallbackForClosedChannels()
Execute registered closures. This method throws a BackgroundCommandException if any closure returns an exception.
See Also:
whenClosed(com.jcraft.jsch.Channel, groovy.lang.Closure)


getRemote

Remote getRemote()
Return the remote host.
Returns:
the remote host


isAnyPending

boolean isAnyPending()
Return if any channel is pending.
Returns:
true if at least one is pending


whenClosed

void whenClosed(Channel channel, groovy.lang.Closure closure)
Register a closure called when the channel is closed.
Parameters:
channel - the channel
closure - callback closure


 

Groovy Documentation