Class AbstractSimpleServer
- java.lang.Object
-
- org.opennms.netmgt.provision.server.AbstractSimpleServer
-
public abstract class AbstractSimpleServer extends Object
Abstract AbstractSimpleServer class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractSimpleServer.BannerExchange
static interface
AbstractSimpleServer.Exchange
static interface
AbstractSimpleServer.RequestMatcher
static class
AbstractSimpleServer.SimpleServerExchange
-
Constructor Summary
Constructors Constructor Description AbstractSimpleServer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addRequestResponse(String request, String response)
addRequestResponseprotected boolean
attemptConversation(BufferedReader in, OutputStream out)
attemptConversationInetAddress
getInetAddress()
getInetAddressint
getLocalPort()
getLocalPortRunnable
getRunnable()
getRunnableint
getTimeout()
getTimeoutvoid
init()
initprotected void
onInit()
onInitprotected AbstractSimpleServer.RequestMatcher
regexpMatches(String regex)
regexpMatchesprotected void
setExpectedBanner(String banner)
setExpectedBannervoid
setTimeout(int timeout)
setTimeoutvoid
startServer()
startServer
-
-
-
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.
-
onInit
protected void onInit()
onInit
-
attemptConversation
protected boolean attemptConversation(BufferedReader in, OutputStream out) throws IOException
attemptConversation
- Parameters:
in
- aBufferedReader
object.out
- aOutputStream
object.- Returns:
- a boolean.
- Throws:
IOException
- if any.
-
setExpectedBanner
protected void setExpectedBanner(String banner)
setExpectedBanner
- Parameters:
banner
- aString
object.
-
addRequestResponse
protected void addRequestResponse(String request, String response)
addRequestResponse
-
regexpMatches
protected AbstractSimpleServer.RequestMatcher regexpMatches(String regex)
regexpMatches
- Parameters:
regex
- aString
object.- Returns:
- a
AbstractSimpleServer.RequestMatcher
object.
-
-