org.opennms.netmgt.provision.detector.simple.client
Class NrpeClient

java.lang.Object
  extended by org.opennms.netmgt.provision.detector.simple.client.NrpeClient
All Implemented Interfaces:
Client<NrpeRequest,NrpePacket>

public class NrpeClient
extends Object
implements Client<NrpeRequest,NrpePacket>

NrpeClient class.

Version:
$Id: $
Author:
Donald Desloge

Constructor Summary
NrpeClient()
           
 
Method Summary
 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
protected  Socket wrapSocket(Socket socket, String hostAddress, int port)
          wrapSocket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NrpeClient

public NrpeClient()
Method Detail

close

public void close()

close

Specified by:
close in interface Client<NrpeRequest,NrpePacket>

connect

public void connect(InetAddress address,
                    int port,
                    int timeout)
             throws IOException,
                    Exception

connect

Specified by:
connect in interface Client<NrpeRequest,NrpePacket>
Parameters:
address - a InetAddress object.
port - a int.
timeout - a int.
Throws:
IOException - if any.
Exception - if any.

getWrappedSocket

protected Socket getWrappedSocket(InetAddress address,
                                  int port,
                                  int timeout)
                           throws IOException

getWrappedSocket

Parameters:
address - a InetAddress object.
port - a int.
timeout - a int.
Returns:
a Socket object.
Throws:
IOException - if any.

wrapSocket

protected Socket wrapSocket(Socket socket,
                            String hostAddress,
                            int port)
                     throws Exception

wrapSocket

Parameters:
socket - a Socket object.
hostAddress - a String object.
port - a int.
Returns:
a Socket object.
Throws:
Exception - if any.

receiveBanner

public NrpePacket receiveBanner()
                         throws IOException,
                                Exception

receiveBanner

Specified by:
receiveBanner in interface Client<NrpeRequest,NrpePacket>
Returns:
a NrpePacket object.
Throws:
IOException - if any.
Exception - if any.

sendRequest

public NrpePacket sendRequest(NrpeRequest request)
                       throws IOException,
                              Exception

sendRequest

Specified by:
sendRequest in interface Client<NrpeRequest,NrpePacket>
Parameters:
request - a NrpeRequest object.
Returns:
a NrpePacket object.
Throws:
IOException - if any.
Exception - if any.

setPadding

public void setPadding(int padding)

setPadding

Parameters:
padding - a int.

getPadding

public int getPadding()

getPadding

Returns:
a int.

setUseSsl

public void setUseSsl(boolean useSsl)

setUseSsl

Parameters:
useSsl - a boolean.

isUseSsl

public boolean isUseSsl()

isUseSsl

Returns:
a boolean.

setOutput

public void setOutput(OutputStream out)

setOutput

Parameters:
out - a OutputStream object.

getOutput

public OutputStream getOutput()

getOutput

Returns:
a OutputStream object.

setInput

public void setInput(InputStream in)

setInput

Parameters:
in - a InputStream object.

getInput

public InputStream getInput()

getInput

Returns:
a InputStream object.


Copyright © 2011. All Rights Reserved.