|
Eclipse Platform Release 3.4 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A service whose purpose is to ensure that all the JSch preferences are properly pushed into JSch
before a Session
is created. The service is registered as
an OSGi service. Clients can obtain an instance of the service from their bundle context
or from a service tracker.
This interface is not intended to be implemented by clients.
Method Summary | |
void |
connect(com.jcraft.jsch.Proxy proxy,
String host,
int port,
int timeout,
IProgressMonitor monitor)
Connect to the given host and port using the given proxy. |
void |
connect(com.jcraft.jsch.Session session,
int timeout,
IProgressMonitor monitor)
Connect the session using a responsive socket factory. |
com.jcraft.jsch.Session |
createSession(IJSchLocation location,
com.jcraft.jsch.UserInfo uinfo)
Create a Session that can be used to make SSH2 connections. |
com.jcraft.jsch.Session |
createSession(String host,
int port,
String username)
Create a Session that can be used to make SSH2 connections. |
com.jcraft.jsch.JSch |
getJSch()
Get the singleton instance of JSch allocated in jsch.core plug-in internally. |
IJSchLocation |
getLocation(String user,
String host,
int port)
Get the IJSchLocation according to given user name, host name and port number. |
com.jcraft.jsch.Proxy |
getProxyForHost(String host,
String proxyType)
Return the proxy that should be used to connect to the given host or null
if no proxy is specified for the host. |
Method Detail |
public com.jcraft.jsch.Session createSession(String host, int port, String username) throws com.jcraft.jsch.JSchException
Session
that can be used to make SSH2 connections. This method ensures that
all preferences are properly propagated into JSch before creating the session and also
ensures that the session uses the appropriate proxy settings.
Calling this method does not connect the session (see connect(Session, int, IProgressMonitor)
, if connection
throws an exception, clients should check to see if the session is still connected (see Session.isConnected()
.
If it is, they should call Session.disconnect()
.
host
- the host nameport
- the port or -1 if the default port is to be usedusername
- the user name or null
if there is no user name or the user name is not known
com.jcraft.jsch.JSchException
- if errors occurpublic com.jcraft.jsch.Session createSession(IJSchLocation location, com.jcraft.jsch.UserInfo uinfo) throws com.jcraft.jsch.JSchException
Session
that can be used to make SSH2 connections. This method ensures that
all preferences are properly propagated into JSch before creating the session and also
ensures that the session uses the appropriate proxy settings.
Calling this method does not connect the session (see connect(Session, int, IProgressMonitor)
, if connection
throws an exception, clients should check to see if the session is still connected (see Session.isConnected()
.
If it is, they should call Session.disconnect()
.
location
- the location which corresponds to user@host:portuinfo
- an instance of UserInfo
or null
if
the internal UserInfo implementation should be used.
com.jcraft.jsch.JSchException
- if errors occurpublic void connect(com.jcraft.jsch.Session session, int timeout, IProgressMonitor monitor) throws com.jcraft.jsch.JSchException
Session.setTimeout(int)
. If session connection fails due to an exception,
the session will be disconnected by this method.
session
- the session to be connectedtimeout
- a timeout in millisecondsmonitor
- a progress monitor or null
if progress and
cancelation is not desired
com.jcraft.jsch.JSchException
- if an exception occurs connecting the session.public com.jcraft.jsch.Proxy getProxyForHost(String host, String proxyType)
null
if no proxy is specified for the host.
host
- the hostproxyType
- the proxy type (either IProxyData.HTTPS_PROXY_TYPE
or IProxyData.SOCKS_PROXY_TYPE
)
null
if no proxy is specified for the hostpublic void connect(com.jcraft.jsch.Proxy proxy, String host, int port, int timeout, IProgressMonitor monitor) throws com.jcraft.jsch.JSchException
Proxy.connect(SocketFactory, String, int, int)
and provides a SocketFactory
that responds to cancelation.
proxy
- the proxyhost
- the host nameport
- the porttimeout
- a timeout in millisecondsmonitor
- a progress monitor or null
if progress and
cancelation is not desired
com.jcraft.jsch.JSchException
public IJSchLocation getLocation(String user, String host, int port)
user
- user name for ssh2 connectionhost
- host name for ssh2 connectionport
- port number for ssh2 connection
public com.jcraft.jsch.JSch getJSch()
|
Eclipse Platform Release 3.4 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.