public class

SshConnectionManager

extends Object
java.lang.Object
   ↳ org.mule.modules.ssh.multiplexer.SshConnectionManager

Class Overview

Important component to handle the connections abstracting the connector from that. It lazyly inits the connections on demmand and keeps a reusable instance of {@org.mule.modules.ssh.multiplexer.SshClient } to represent the fact that a user can keep the session open for a while.

Summary

Fields
private Map<StringSshClient> clients map to relate a username to a SshClient holding his session
Public Constructors
SshConnectionManager()
Public Methods
SshClient getConnection(SshConnectionDetails details)
Gets a connection associated with the username specified in the details If the connection already exist it's reused.
void release(String username)
if an active connection associated with the username exists it will be released after calling this method
void releaseAll()
Releases all active connections form all users
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private Map<StringSshClient> clients

map to relate a username to a SshClient holding his session

Public Constructors

public SshConnectionManager ()

Public Methods

public SshClient getConnection (SshConnectionDetails details)

Gets a connection associated with the username specified in the details If the connection already exist it's reused. Otherwise a new one is created. In case of needing a brand new connection opened, then org.mule.modules.ssh.multiplexer.SshConnectionManager.openConnection(SshConnectionDetails) is used and the connection obtained tracked

Parameters
details - connection information
Returns
  • an active and ready to use sshClient
See Also
  • org.mule.modules.ssh.multiplexer.SshConnectionManager.openConnection(SshConnectionDetails)

public void release (String username)

if an active connection associated with the username exists it will be released after calling this method

Parameters
username - the username whose connection we want to free

public void releaseAll ()

Releases all active connections form all users