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 classAbstractSimpleServer.BannerExchangestatic interfaceAbstractSimpleServer.Exchangestatic interfaceAbstractSimpleServer.RequestMatcherstatic classAbstractSimpleServer.SimpleServerExchange
-
Constructor Summary
Constructors Constructor Description AbstractSimpleServer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddRequestResponse(String request, String response)addRequestResponseprotected booleanattemptConversation(BufferedReader in, OutputStream out)attemptConversationInetAddressgetInetAddress()getInetAddressintgetLocalPort()getLocalPortRunnablegetRunnable()getRunnableintgetTimeout()getTimeoutvoidinit()initprotected voidonInit()onInitprotected AbstractSimpleServer.RequestMatcherregexpMatches(String regex)regexpMatchesprotected voidsetExpectedBanner(String banner)setExpectedBannervoidsetTimeout(int timeout)setTimeoutvoidstartServer()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- aBufferedReaderobject.out- aOutputStreamobject.- Returns:
- a boolean.
- Throws:
IOException- if any.
-
setExpectedBanner
protected void setExpectedBanner(String banner)
setExpectedBanner
- Parameters:
banner- aStringobject.
-
addRequestResponse
protected void addRequestResponse(String request, String response)
addRequestResponse
-
regexpMatches
protected AbstractSimpleServer.RequestMatcher regexpMatches(String regex)
regexpMatches
- Parameters:
regex- aStringobject.- Returns:
- a
AbstractSimpleServer.RequestMatcherobject.
-
-