Class AbstractHttpService
- java.lang.Object
-
- com.github.toolarium.network.server.service.AbstractHttpService
-
- All Implemented Interfaces:
IHttpService
- Direct Known Subclasses:
EchoService,PingService
public abstract class AbstractHttpService extends java.lang.Object implements IHttpService
Abstract base http service class
-
-
Constructor Summary
Constructors Constructor Description AbstractHttpService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IHttpConnectionHandlergetHttpConnectionHandler()Get the http connection handlerprotected java.lang.StringgetRFC1123Timestamp()Get the current time stamp in RFC 1123 formatprotected HttpReponseprepareResponse(IHttpRequest request)Prepare responsebooleanstart(IHttpServerLogger httpServerLogger, int port)Start the servicevoidstop(IHttpServerLogger httpServerLogger, int port)Stops the service-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.toolarium.network.server.service.IHttpService
processRequest
-
-
-
-
Method Detail
-
start
public boolean start(IHttpServerLogger httpServerLogger, int port)
Description copied from interface:IHttpServiceStart the service- Specified by:
startin interfaceIHttpService- Parameters:
httpServerLogger- the server loggerport- the port- Returns:
- true to continue startup; otherwise stop startup
- See Also:
IHttpService.start(com.github.toolarium.network.server.logger.IHttpServerLogger, int)
-
stop
public void stop(IHttpServerLogger httpServerLogger, int port)
Description copied from interface:IHttpServiceStops the service- Specified by:
stopin interfaceIHttpService- Parameters:
httpServerLogger- the server loggerport- the port- See Also:
IHttpService.stop(com.github.toolarium.network.server.logger.IHttpServerLogger, int)
-
getHttpConnectionHandler
public IHttpConnectionHandler getHttpConnectionHandler()
Description copied from interface:IHttpServiceGet the http connection handler- Specified by:
getHttpConnectionHandlerin interfaceIHttpService- Returns:
- the http connection handler
- See Also:
IHttpService.getHttpConnectionHandler()
-
prepareResponse
protected HttpReponse prepareResponse(IHttpRequest request)
Prepare response- Parameters:
request- the request- Returns:
- the response
-
getRFC1123Timestamp
protected java.lang.String getRFC1123Timestamp()
Get the current time stamp in RFC 1123 format- Returns:
- the current time stamp in RFC 1123 format
-
-