public class NrpeClient extends Object implements Client<NrpeRequest,NrpePacket>, SocketWrapper
NrpeClient class.
Constructor and Description |
---|
NrpeClient() |
Modifier and Type | Method and Description |
---|---|
void |
close()
close
|
void |
connect(InetAddress address,
int port,
int timeout)
connect
|
InputStream |
getInput()
getInput
|
OutputStream |
getOutput()
getOutput
|
int |
getPadding()
getPadding
|
protected Socket |
getWrappedSocket(InetAddress address,
int port,
int timeout)
getWrappedSocket
|
boolean |
isUseSsl()
isUseSsl
|
NrpePacket |
receiveBanner()
receiveBanner
|
NrpePacket |
sendRequest(NrpeRequest request)
sendRequest
|
void |
setInput(InputStream in)
setInput
|
void |
setOutput(OutputStream out)
setOutput
|
void |
setPadding(int padding)
setPadding
|
void |
setUseSsl(boolean useSsl)
setUseSsl
|
Socket |
wrapSocket(Socket socket)
wrapSocket
|
public void close()
close
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Client<NrpeRequest,NrpePacket>
public void connect(InetAddress address, int port, int timeout) throws IOException, Exception
connect
connect
in interface Client<NrpeRequest,NrpePacket>
address
- a InetAddress
object.port
- a int.timeout
- a int.IOException
- if any.Exception
- if any.protected Socket getWrappedSocket(InetAddress address, int port, int timeout) throws IOException
getWrappedSocket
address
- a InetAddress
object.port
- a int.timeout
- a int.Socket
object.IOException
- if any.public Socket wrapSocket(Socket socket) throws IOException
wrapSocket
wrapSocket
in interface SocketWrapper
socket
- a Socket
object.hostAddress
- a String
object.port
- a int.Socket
object.Exception
- if any.IOException
public NrpePacket receiveBanner() throws IOException, Exception
receiveBanner
receiveBanner
in interface Client<NrpeRequest,NrpePacket>
NrpePacket
object.IOException
- if any.Exception
- if any.public NrpePacket sendRequest(NrpeRequest request) throws IOException, Exception
sendRequest
sendRequest
in interface Client<NrpeRequest,NrpePacket>
request
- a NrpeRequest
object.NrpePacket
object.IOException
- if any.Exception
- if any.public void setPadding(int padding)
setPadding
padding
- a int.public int getPadding()
getPadding
public void setUseSsl(boolean useSsl)
setUseSsl
useSsl
- a boolean.public boolean isUseSsl()
isUseSsl
public void setOutput(OutputStream out)
setOutput
out
- a OutputStream
object.public OutputStream getOutput()
getOutput
OutputStream
object.public void setInput(InputStream in)
setInput
in
- a InputStream
object.public InputStream getInput()
getInput
InputStream
object.Copyright © 2017. All rights reserved.