Class SshClient
- java.lang.Object
-
- org.opennms.netmgt.provision.detector.ssh.client.SshClient
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Client<NullRequest,SshResponse>
public class SshClient extends java.lang.Object implements Client<NullRequest,SshResponse>
SshClient class.
- Version:
- $Id: $
- Author:
- thedesloge
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_RETRY
-
Constructor Summary
Constructors Constructor Description SshClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
closevoid
connect(java.net.InetAddress address, int port, int timeout)
connectSshResponse
receiveBanner()
receiveBannerSshResponse
sendRequest(NullRequest request)
sendRequestvoid
setBanner(java.lang.String banner)
setBannervoid
setClientBanner(java.lang.String clientBanner)
setClientBannervoid
setMatch(java.lang.String match)
setMatch
-
-
-
Field Detail
-
DEFAULT_RETRY
public static final int DEFAULT_RETRY
- See Also:
- Constant Field Values
-
-
Method Detail
-
close
public void close()
close
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceClient<NullRequest,SshResponse>
- Specified by:
close
in interfacejava.io.Closeable
-
connect
public void connect(java.net.InetAddress address, int port, int timeout) throws java.lang.Exception
connect
- Specified by:
connect
in interfaceClient<NullRequest,SshResponse>
- Parameters:
address
- aInetAddress
object.port
- a int.timeout
- a int.- Throws:
java.io.IOException
- if any.java.lang.Exception
- if any.
-
receiveBanner
public SshResponse receiveBanner() throws java.io.IOException, java.lang.Exception
receiveBanner
- Specified by:
receiveBanner
in interfaceClient<NullRequest,SshResponse>
- Returns:
- a
SshResponse
object. - Throws:
java.io.IOException
- if any.java.lang.Exception
- if any.
-
sendRequest
public SshResponse sendRequest(NullRequest request) throws java.io.IOException, java.lang.Exception
sendRequest
- Specified by:
sendRequest
in interfaceClient<NullRequest,SshResponse>
- Parameters:
request
- aNullRequest
object.- Returns:
- a
SshResponse
object. - Throws:
java.io.IOException
- if any.java.lang.Exception
- if any.
-
setBanner
public void setBanner(java.lang.String banner)
setBanner
- Parameters:
banner
- aString
object.
-
setMatch
public void setMatch(java.lang.String match)
setMatch
- Parameters:
match
- aString
object.
-
setClientBanner
public void setClientBanner(java.lang.String clientBanner)
setClientBanner
- Parameters:
clientBanner
- aString
object.
-
-