Class SshClient
- java.lang.Object
-
- org.opennms.netmgt.provision.detector.ssh.client.SshClient
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Client<NullRequest,SshResponse>
public class SshClient extends 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(InetAddress address, int port, int timeout)
connectSshResponse
receiveBanner()
receiveBannerSshResponse
sendRequest(NullRequest request)
sendRequestvoid
setBanner(String banner)
setBannervoid
setClientBanner(String clientBanner)
setClientBannervoid
setMatch(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 interfaceAutoCloseable
- Specified by:
close
in interfaceClient<NullRequest,SshResponse>
- Specified by:
close
in interfaceCloseable
-
connect
public void connect(InetAddress address, int port, int timeout) throws Exception
connect
- Specified by:
connect
in interfaceClient<NullRequest,SshResponse>
- Parameters:
address
- aInetAddress
object.port
- a int.timeout
- a int.- Throws:
IOException
- if any.Exception
- if any.
-
receiveBanner
public SshResponse receiveBanner() throws IOException, Exception
receiveBanner
- Specified by:
receiveBanner
in interfaceClient<NullRequest,SshResponse>
- Returns:
- a
SshResponse
object. - Throws:
IOException
- if any.Exception
- if any.
-
sendRequest
public SshResponse sendRequest(NullRequest request) throws IOException, Exception
sendRequest
- Specified by:
sendRequest
in interfaceClient<NullRequest,SshResponse>
- Parameters:
request
- aNullRequest
object.- Returns:
- a
SshResponse
object. - Throws:
IOException
- if any.Exception
- if any.
-
-