Class LineOrientedClient
- java.lang.Object
-
- org.opennms.netmgt.provision.detector.simple.client.LineOrientedClient
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Client<LineOrientedRequest,LineOrientedResponse>
- Direct Known Subclasses:
DominoIIOPClient
,LdapDetectorClient
public class LineOrientedClient extends Object implements Client<LineOrientedRequest,LineOrientedResponse>
LineOrientedClient class.
- Version:
- $Id: $
- Author:
- brozow
-
-
Constructor Summary
Constructors Constructor Description LineOrientedClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
closevoid
connect(InetAddress host, int port, int timeout)
connectBufferedReader
getInput()
getInputOutputStream
getOutput()
getOutputLineOrientedResponse
receiveBanner()
receiveBannerLineOrientedResponse
sendRequest(LineOrientedRequest request)
sendRequestvoid
setInput(BufferedReader in)
setInputvoid
setOutput(OutputStream out)
setOutput
-
-
-
Field Detail
-
m_socket
protected Socket m_socket
-
-
Method Detail
-
connect
public void connect(InetAddress host, int port, int timeout) throws IOException, Exception
connect
- Specified by:
connect
in interfaceClient<LineOrientedRequest,LineOrientedResponse>
- Parameters:
host
- aInetAddress
object.port
- a int.timeout
- a int.- Throws:
IOException
- if any.Exception
- if any.
-
sendRequest
public LineOrientedResponse sendRequest(LineOrientedRequest request) throws IOException
sendRequest
- Specified by:
sendRequest
in interfaceClient<LineOrientedRequest,LineOrientedResponse>
- Parameters:
request
- aLineOrientedRequest
object.- Returns:
- a
LineOrientedResponse
object. - Throws:
IOException
- if any.
-
receiveBanner
public LineOrientedResponse receiveBanner() throws IOException
receiveBanner
- Specified by:
receiveBanner
in interfaceClient<LineOrientedRequest,LineOrientedResponse>
- Returns:
- a
LineOrientedResponse
object. - Throws:
IOException
- if any.
-
close
public void close()
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceClient<LineOrientedRequest,LineOrientedResponse>
- Specified by:
close
in interfaceCloseable
-
setOutput
public void setOutput(OutputStream out)
setOutput
- Parameters:
out
- aOutputStream
object.
-
getOutput
public OutputStream getOutput()
getOutput
- Returns:
- a
OutputStream
object.
-
setInput
public void setInput(BufferedReader in)
setInput
- Parameters:
in
- aBufferedReader
object.
-
getInput
public BufferedReader getInput()
getInput
- Returns:
- a
BufferedReader
object.
-
-