public final class SshCache
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
void |
attachChannelSftp(com.jcraft.jsch.Session session,
com.jcraft.jsch.ChannelSftp channel) |
attaches a channelSftp to an existing session cache entry
|
void |
clearSession(com.jcraft.jsch.Session session) |
discardes session entries from the cache
|
com.jcraft.jsch.ChannelSftp |
getChannelSftp(com.jcraft.jsch.Session session) |
retrieves an sftp channel from the cache
|
static SshCache |
getInstance() |
|
com.jcraft.jsch.Session |
getSession(java.lang.String host,
int port,
java.lang.String username,
java.lang.String userPassword,
java.io.File pemFile,
java.lang.String pemPassword,
java.io.File passFile,
boolean allowedAgentUse) |
Gets a session from the cache or establishes a new session if necessary
|
public static SshCache getInstance()
public void clearSession(com.jcraft.jsch.Session session)
session - to clearpublic com.jcraft.jsch.ChannelSftp getChannelSftp(com.jcraft.jsch.Session session)
throws java.io.IOException
session - to connect tojava.io.IOExceptionpublic void attachChannelSftp(com.jcraft.jsch.Session session,
com.jcraft.jsch.ChannelSftp channel)
session - to attach the channel tochannel - channel to attachpublic com.jcraft.jsch.Session getSession(java.lang.String host,
int port,
java.lang.String username,
java.lang.String userPassword,
java.io.File pemFile,
java.lang.String pemPassword,
java.io.File passFile,
boolean allowedAgentUse)
throws java.io.IOException
host - to connect toport - to use for session (-1 == use standard port)username - for the session to useuserPassword - to use for authentication (optional)pemFile - File to use for public key authenticationpemPassword - to use for accessing the pemFile (optional)passFile - to store credentialsallowedAgentUse - Whether to communicate with an agent for authenticationjava.io.IOException