Class HttpService
java.lang.Object
org.nanonative.nano.core.model.Service
org.nanonative.nano.services.http.HttpService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Contextstatic final intstatic final intprotected HttpServerprotected static final LockFields inherited from class org.nanonative.nano.core.model.Service
createdAtMs, isReady, logger, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddress()protected byte[]encodeBody(byte[] body, String contentEncoding) static booleanisPortInUse(int portNumber) static intnextFreePort(int startPort) voidintport()protected voidsendResponse(HttpExchange exchange, HttpObject request, HttpObject response) server()setError(AtomicBoolean internalError) voidvoidMethods inherited from class org.nanonative.nano.core.model.Service
createdAtMs, isReady, logger, name, nanoThread, threadsOf
-
Field Details
-
server
-
context
-
CONFIG_SERVICE_HTTP_PORT
-
CONFIG_HTTP_CLIENT_VERSION
-
CONFIG_HTTP_CLIENT_MAX_RETRIES
-
CONFIG_HTTP_CLIENT_CON_TIMEOUT_MS
-
CONFIG_HTTP_CLIENT_READ_TIMEOUT_MS
-
CONFIG_HTTP_CLIENT_FOLLOW_REDIRECTS
-
EVENT_HTTP_REQUEST
public static final int EVENT_HTTP_REQUEST -
EVENT_HTTP_REQUEST_UNHANDLED
public static final int EVENT_HTTP_REQUEST_UNHANDLED -
STARTUP_LOCK
-
-
Constructor Details
-
HttpService
public HttpService()
-
-
Method Details
-
address
-
port
public int port() -
server
-
stop
-
start
-
onEvent
-
onFailure
-
sendResponse
-
encodeBody
-
nextFreePort
public static int nextFreePort(int startPort) -
isPortInUse
public static boolean isPortInUse(int portNumber) -
setError
-