public class Ssh extends AbstractPoll
Ssh class.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CLIENT_BANNER
Constant
DEFAULT_CLIENT_BANNER="SSH-1.99-OpenNMS_1.5" |
static int |
DEFAULT_PORT
Constant
DEFAULT_PORT=22 |
protected InetAddress |
m_address |
protected String |
m_banner |
protected Throwable |
m_error |
protected String |
m_password |
protected int |
m_port |
protected String |
m_serverBanner |
protected String |
m_username |
m_timeout
Constructor and Description |
---|
Ssh()
Constructor for Ssh.
|
Ssh(InetAddress address)
Constructor for Ssh.
|
Ssh(InetAddress address,
int port)
Constructor for Ssh.
|
Ssh(InetAddress address,
int port,
int timeout)
Constructor for Ssh.
|
Modifier and Type | Method and Description |
---|---|
protected void |
disconnect()
disconnect
|
InetAddress |
getAddress()
Get the address to connect to.
|
String |
getClientBanner()
Get the banner string used when connecting
|
protected Throwable |
getError()
getError
|
String |
getPassword()
Get the password to connect with.
|
int |
getPort()
Get the port to connect to.
|
String |
getServerBanner()
Get the SSH server version banner.
|
String |
getUsername()
Get the username to connect as.
|
PollStatus |
poll(TimeoutTracker tracker)
poll
|
void |
setAddress(InetAddress address)
Set the address to connect to.
|
void |
setClientBanner(String banner)
Set the banner string to use when connecting
|
protected void |
setError(Throwable t)
setError
|
void |
setPassword(String password)
Set the password to connect with.
|
void |
setPort(int port)
Set the port to connect to.
|
void |
setUsername(String username)
Set the username to connect as.
|
protected boolean |
tryConnect()
Attempt to connect, based on the parameters which have been set in
the object.
|
getTimeout, poll, setTimeout
public static final int DEFAULT_PORT
DEFAULT_PORT=22
public static final String DEFAULT_CLIENT_BANNER
DEFAULT_CLIENT_BANNER="SSH-1.99-OpenNMS_1.5"
protected int m_port
protected String m_username
protected String m_password
protected String m_banner
protected String m_serverBanner
protected InetAddress m_address
protected Throwable m_error
public Ssh()
Constructor for Ssh.
public Ssh(InetAddress address)
Constructor for Ssh.
address
- a InetAddress
object.public Ssh(InetAddress address, int port)
Constructor for Ssh.
address
- a InetAddress
object.port
- a int.public Ssh(InetAddress address, int port, int timeout)
Constructor for Ssh.
address
- a InetAddress
object.port
- a int.timeout
- a int.public void setAddress(InetAddress address)
address
- the addresspublic InetAddress getAddress()
public void setPort(int port)
port
- the portpublic int getPort()
public void setUsername(String username)
username
- the usernamepublic String getUsername()
public void setPassword(String password)
password
- the passwordpublic String getPassword()
public void setClientBanner(String banner)
banner
- the bannerpublic String getClientBanner()
public String getServerBanner()
protected boolean tryConnect() throws InsufficientParametersException
InsufficientParametersException
- if any.protected void disconnect()
disconnect
public PollStatus poll(TimeoutTracker tracker) throws InsufficientParametersException
poll
poll
in class AbstractPoll
tracker
- a TimeoutTracker
object.PollStatus
object.InsufficientParametersException
- if any.Copyright © 2021. All rights reserved.