|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.commons.ssh.ConnectionFactory
public abstract class ConnectionFactory
Abstract SSH connection factory.
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
log
Factory logger |
| Constructor Summary | |
|---|---|
ConnectionFactory()
|
|
| Method Summary | |
|---|---|
int |
getKexTimeout()
Returns the timeout value for the key exchange |
int |
getPort()
|
int |
getSoTimeout()
|
java.util.Set |
getSupportedFeatures()
Returns Set of String — the set of supported features
codes. |
protected abstract java.util.Set |
getSupportedFeaturesImpl()
Creates Set of String — the set of supported features
codes. |
boolean |
isFeatureSupported(java.lang.String feature)
Returns true if specified feature is supported by
ConnectionFactory, false otherwise. |
boolean |
isSendIgnore()
|
static ConnectionFactory |
newInstance(java.util.Set requiredFeatures)
Creates new instance of ConnectionFactory using system properties
to resolve actual connection factory instance. |
Connection |
openConnection(java.lang.String host,
AuthenticationOptions authOptions)
Creates new SSH connection using the specified connection settings |
abstract Connection |
openConnection(java.lang.String host,
int port,
AuthenticationOptions authOptions)
Creates new SSH connection using the specified connection settings |
void |
setKexTimeout(int kexTimeout)
|
void |
setPort(int port)
|
void |
setSendIgnore(boolean sendIgnore)
|
void |
setSoTimeout(int soTimeout)
Enable/disable SocketOptions.SO_TIMEOUT with the specified
timeout, in milliseconds. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log log
| Constructor Detail |
|---|
public ConnectionFactory()
| Method Detail |
|---|
public static ConnectionFactory newInstance(java.util.Set requiredFeatures)
ConnectionFactory using system properties
to resolve actual connection factory instance.
requiredFeatures - set of required features factory must support
ConnectionFactorypublic int getKexTimeout()
public int getPort()
public int getSoTimeout()
public final java.util.Set getSupportedFeatures()
Set of String — the set of supported features
codes.
Set of String — the set of supported features
codes.isFeatureSupported(String),
Featuresprotected abstract java.util.Set getSupportedFeaturesImpl()
Set of String — the set of supported features
codes.
Set of String — the set of supported features
codes.isFeatureSupported(String),
Featurespublic boolean isFeatureSupported(java.lang.String feature)
true if specified feature is supported by
ConnectionFactory, false otherwise.
feature - feature code to check.
true if specified feature is supported by
ConnectionFactory, false otherwise.getSupportedFeatures(),
Featurespublic boolean isSendIgnore()
public Connection openConnection(java.lang.String host,
AuthenticationOptions authOptions)
throws java.io.IOException
host - host to connectauthOptions - Authentication Options (should be supported by connection
factory)
java.io.IOException - if I/O exception occurs
public abstract Connection openConnection(java.lang.String host,
int port,
AuthenticationOptions authOptions)
throws java.io.IOException
host - host to connectport - port to connectauthOptions - Authentication Options (should be supported by connection
factory)
java.io.IOException - if I/O exception occurspublic void setKexTimeout(int kexTimeout)
kexTimeout - the kexTimeout to setpublic void setPort(int port)
port - the port to connect to on the remote hostpublic void setSendIgnore(boolean sendIgnore)
sendIgnore - the send ignore flag to send random data packetspublic void setSoTimeout(int soTimeout)
SocketOptions.SO_TIMEOUT with the specified
timeout, in milliseconds. With this option set to a non-zero timeout, a
InputStream.read() will block for only this amount of time.
If the timeout expires, a SocketTimeoutException is raised,
though the Socket is still valid.
The timeout must be > 0. A timeout of zero is interpreted as an
infinite timeout.
soTimeout - the soTimeout to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||