org.opennms.netmgt.provision.server
Class AbstractSimpleServer

java.lang.Object
  extended by org.opennms.netmgt.provision.server.AbstractSimpleServer

public abstract class AbstractSimpleServer
extends Object

Abstract AbstractSimpleServer class.

Version:
$Id: $
Author:
ranger

Nested Class Summary
static class AbstractSimpleServer.BannerExchange
           
static interface AbstractSimpleServer.Exchange
           
static interface AbstractSimpleServer.RequestMatcher
           
static class AbstractSimpleServer.SimpleServerExchange
           
 
Constructor Summary
AbstractSimpleServer()
           
 
Method Summary
protected  void addRequestResponse(String request, String response)
          addRequestResponse
protected  boolean attemptConversation(BufferedReader in, OutputStream out)
          attemptConversation
 InetAddress getInetAddress()
          getInetAddress
 int getLocalPort()
          getLocalPort
 Runnable getRunnable()
          getRunnable
 int getTimeout()
          getTimeout
 void init()
          init
 void onInit()
          onInit
protected  AbstractSimpleServer.RequestMatcher regexpMatches(String regex)
          regexpMatches
protected  void setExpectedBanner(String banner)
          setExpectedBanner
 void setTimeout(int timeout)
          setTimeout
 void startServer()
          startServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSimpleServer

public AbstractSimpleServer()
Method Detail

getTimeout

public int getTimeout()

getTimeout

Returns:
a int.

setTimeout

public void setTimeout(int timeout)

setTimeout

Parameters:
timeout - a int.

getInetAddress

public InetAddress getInetAddress()

getInetAddress

Returns:
InetAddress returns the inetaddress from the serversocket.

getLocalPort

public int getLocalPort()

getLocalPort

Returns:
a int.

init

public void init()
          throws Exception

init

Throws:
Exception - if any.

onInit

public void onInit()

onInit


startServer

public void startServer()
                 throws Exception

startServer

Throws:
Exception - if any.

getRunnable

public Runnable getRunnable()
                     throws Exception

getRunnable

Returns:
a Runnable object.
Throws:
Exception - if any.

attemptConversation

protected boolean attemptConversation(BufferedReader in,
                                      OutputStream out)
                               throws IOException

attemptConversation

Parameters:
in - a BufferedReader object.
out - a OutputStream object.
Returns:
a boolean.
Throws:
IOException - if any.

setExpectedBanner

protected void setExpectedBanner(String banner)

setExpectedBanner

Parameters:
banner - a String object.

addRequestResponse

protected void addRequestResponse(String request,
                                  String response)

addRequestResponse

Parameters:
request - a String object.
response - a String object.

regexpMatches

protected AbstractSimpleServer.RequestMatcher regexpMatches(String regex)

regexpMatches

Parameters:
regex - a String object.
Returns:
a AbstractSimpleServer.RequestMatcher object.


Copyright © 2011. All Rights Reserved.