java.lang.Object
org.refcodes.observer.AbstractObservable<RestEndpoint,org.refcodes.web.HttpRequest>
org.refcodes.rest.AbstractRestServer
org.refcodes.rest.HttpRestServerImpl
- All Implemented Interfaces:
org.refcodes.component.Closable
,org.refcodes.component.Closable.CloseBuilder<org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<org.refcodes.web.HttpServerContext,
,HttpRestServer>> org.refcodes.component.ConnectionComponent<org.refcodes.web.HttpServerContext>
,org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<org.refcodes.web.HttpServerContext,
,HttpRestServer> org.refcodes.component.ConnectionOpenable<org.refcodes.web.HttpServerContext>
,org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<org.refcodes.web.HttpServerContext,
,org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<org.refcodes.web.HttpServerContext, HttpRestServer>> org.refcodes.component.ConnectionStatusAccessor
,org.refcodes.component.LinkComponent
,org.refcodes.component.Openable
,org.refcodes.component.OpenedAccessor
,org.refcodes.io.MaxConnectionsAccessor
,org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsBuilder<HttpRestServer>
,org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsMutator
,org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsProperty
,org.refcodes.mixin.Disposable
,org.refcodes.mixin.Loggable
,org.refcodes.mixin.PortAccessor
,org.refcodes.mixin.PortAccessor.PortBuilder<HttpRestServer>
,org.refcodes.mixin.PortAccessor.PortMutator
,org.refcodes.mixin.PortAccessor.PortProperty
,org.refcodes.observer.Observable<RestEndpoint>
,org.refcodes.observer.Observers<RestEndpoint,
,RestServer> HttpExceptionHandlerAccessor
,HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<RestServer>
,HttpExceptionHandlerAccessor.HttpExceptionHandlerMutator
,HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty
,HttpExceptionHandlingAccessor
,HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<RestServer>
,HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator
,HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty
,HttpRestServer
,RestServer
,org.refcodes.runtime.RequestCorrelation<RestServer>
,org.refcodes.runtime.SessionCorrelation<RestServer>
,org.refcodes.security.KeyStoreDescriptorAccessor
,org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorBuilder<HttpRestServer>
,org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorMutator
,org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorProperty
,org.refcodes.web.BaseLocatorAccessor
,org.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
,org.refcodes.web.BaseLocatorAccessor.BaseLocatorMutator
,org.refcodes.web.BaseLocatorAccessor.BaseLocatorProperty
,org.refcodes.web.BasicAuthObservable<HttpRestServer>
,org.refcodes.web.HttpsConnectionRequestObservable<HttpRestServer>
,org.refcodes.web.MediaTypeFactoryLookup
,org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
,org.refcodes.web.RealmAccessor
,org.refcodes.web.RealmAccessor.RealmBuilder<RestServer>
,org.refcodes.web.RealmAccessor.RealmMutator
,org.refcodes.web.RealmAccessor.RealmProperty
,org.refcodes.web.SchemeAccessor
,org.refcodes.web.SchemeAccessor.SchemeBuilder<HttpRestServer>
,org.refcodes.web.SchemeAccessor.SchemeMutator
,org.refcodes.web.SchemeAccessor.SchemeProperty
- Direct Known Subclasses:
HttpRestServerSingleton
Implementation of the
HttpRestServer
interface using the
HttpServer
defined in the com.sun.net.httpserver
package. The HttpRestServerImpl
is being initialized with some common
MediaTypeFactory
instances (as implemented by the
AbstractRestServer
). At the time of writing this document the
MediaTypeFactory
instances being preconfigured are:
JsonMediaTypeFactory
XmlMediaTypeFactory
TextMediaTypeFactory
FormMediaTypeFactory
HttpRestServerImpl
supports HTTP as well as HTTPS protocols as
being based on the HttpServer
as well as on the HttpsServer
.
For opening up an HTTPS connection, refer to the methods such as
HttpRestServer.open(String, KeyStoreDescriptor, int)
or
HttpRestServer.open(KeyStoreDescriptor, int)
and the like.
Set the system property SystemProperty.LOG_DEBUG
to true (set when
invoking the JRA by passing the argument -Dlog.debug=true
to the
java
executable) to log additional erroneous situations e.g.
related to content types and accept types alongside marshaling and
unmarshaling.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.web.BaseLocatorAccessor
org.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<B extends org.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<B>>, org.refcodes.web.BaseLocatorAccessor.BaseLocatorMutator, org.refcodes.web.BaseLocatorAccessor.BaseLocatorProperty
Nested classes/interfaces inherited from interface org.refcodes.component.Closable
org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionComponent
org.refcodes.component.ConnectionComponent.ConnectionAutomaton<CON extends Object>, org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON extends Object,
B extends org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON, B>> Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionOpenable
org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<CON extends Object>, org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON extends Object,
B extends org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON, B>> Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionStatusAccessor
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
Nested classes/interfaces inherited from interface org.refcodes.rest.HttpExceptionHandlerAccessor
HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<B extends HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<B>>, HttpExceptionHandlerAccessor.HttpExceptionHandlerMutator, HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty
Nested classes/interfaces inherited from interface org.refcodes.rest.HttpExceptionHandlingAccessor
HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<B extends HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<B>>, HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator, HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty
Nested classes/interfaces inherited from interface org.refcodes.security.KeyStoreDescriptorAccessor
org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorBuilder<B extends org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorBuilder<B>>, org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorMutator, org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorProperty
Nested classes/interfaces inherited from interface org.refcodes.component.LinkComponent
org.refcodes.component.LinkComponent.LinkAutomaton, org.refcodes.component.LinkComponent.LinkComponentBuilder<B extends org.refcodes.component.LinkComponent.LinkComponentBuilder<B>>
Nested classes/interfaces inherited from interface org.refcodes.io.MaxConnectionsAccessor
org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsBuilder<B extends org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsBuilder<B>>, org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsMutator, org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsProperty
Nested classes/interfaces inherited from interface org.refcodes.web.MediaTypeFactoryLookup
org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
Nested classes/interfaces inherited from interface org.refcodes.component.Openable
org.refcodes.component.Openable.OpenAutomaton, org.refcodes.component.Openable.OpenBuilder<B extends org.refcodes.component.Openable.OpenBuilder<B>>
Nested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.PortAccessor
org.refcodes.mixin.PortAccessor.PortBuilder<B extends org.refcodes.mixin.PortAccessor.PortBuilder<B>>, org.refcodes.mixin.PortAccessor.PortMutator, org.refcodes.mixin.PortAccessor.PortProperty
Nested classes/interfaces inherited from interface org.refcodes.web.RealmAccessor
org.refcodes.web.RealmAccessor.RealmBuilder<B extends org.refcodes.web.RealmAccessor.RealmBuilder<B>>, org.refcodes.web.RealmAccessor.RealmMutator, org.refcodes.web.RealmAccessor.RealmProperty
Nested classes/interfaces inherited from interface org.refcodes.web.SchemeAccessor
org.refcodes.web.SchemeAccessor.SchemeBuilder<B extends org.refcodes.web.SchemeAccessor.SchemeBuilder<B>>, org.refcodes.web.SchemeAccessor.SchemeMutator, org.refcodes.web.SchemeAccessor.SchemeProperty
-
Field Summary
Fields inherited from class org.refcodes.rest.AbstractRestServer
_hasRequestCorrelation, _hasSessionCorrelation, _httpExceptionHandler, _httpExceptionHandling, _isVerbose
Fields inherited from interface org.refcodes.mixin.Loggable
RUNTIME_LOGGER_CLASS, RUNTIME_LOGGER_FACTORY_CLASS, RUNTIME_LOGGER_FACTORY_METHOD
-
Constructor Summary
ConstructorDescriptionConstructs aHttpRestServerImpl
.HttpRestServerImpl
(boolean isVerbose) Constructs aHttpRestServerImpl
.HttpRestServerImpl
(ExecutorService aExecutorService) Constructs aHttpRestServerImpl
.HttpRestServerImpl
(ExecutorService aExecutorService, boolean isVerbose) Constructs aHttpRestServerImpl
.HttpRestServerImpl
(org.refcodes.controlflow.ThreadingModel aThreadingModel) Constructs aHttpRestServerImpl
.HttpRestServerImpl
(org.refcodes.controlflow.ThreadingModel aThreadingModel, boolean isVerbose) Constructs aHttpRestServerImpl
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
org.refcodes.component.ConnectionStatus
protected HttpServer
Gets the http server.org.refcodes.security.KeyStoreDescriptor
int
int
getPort()
org.refcodes.data.Scheme
onBasicAuthRequest
(org.refcodes.web.BasicAuthObserver aBasicAuthObserver) onConnectionRequest
(org.refcodes.web.HttpsConnectionRequestObserver aObserver) protected void
open
(HttpServer aHttpServer) A hook to be used when using customHttpServer
(HttpsServer
) by custom open(...) methods of sub-classes of thisHttpRestServerImpl
.void
open
(String aProtocol, org.refcodes.security.KeyStoreDescriptor aStoreDescriptor, int aPort, int aMaxConnections) Opens the HTTPS sever connection (socket) at the given port allowing the given number of maximum connections at the same time using the provided HTTPS configuration parameters.void
setKeyStoreDescriptor
(org.refcodes.security.KeyStoreDescriptor aKeyStoreDescriptor) void
setMaxConnections
(int aMaxConnections) void
setPort
(int aPort) void
setProtocol
(String aProtocol) void
setScheme
(org.refcodes.data.Scheme aScheme) Methods inherited from class org.refcodes.rest.AbstractRestServer
addMediaTypeFactory, dispose, doRequestCorrelation, doSessionCorrelation, fireEvent, getBaseLocator, getFactoryMediaTypes, getHttpExceptionHandler, getHttpExceptionHandling, getRealm, hasRequestCorrelation, hasSessionCorrelation, initMedaTypeFactories, isObserversActive, observers, onHttpRequest, setBaseLocator, setHttpExceptionHandler, setHttpExceptionHandling, setObserversActive, setRealm, setRequestCorrelation, setSessionCorrelation, subscribeObserver, toMediaTypeFactory, toNegotiatedContenType, toResponseBody, unsubscribeObserver
Methods inherited from class org.refcodes.observer.AbstractObservable
clear, doHandleEventListenerException, fireEvent, getThreadPriority, hasObserverSubscription, isEmpty, setThreadPriority, size
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.web.BaseLocatorAccessor
getBaseLocator
Methods inherited from interface org.refcodes.web.BaseLocatorAccessor.BaseLocatorMutator
setBaseLocator
Methods inherited from interface org.refcodes.web.BaseLocatorAccessor.BaseLocatorProperty
letBaseLocator
Methods inherited from interface org.refcodes.component.Closable
closeIn, closeQuietly, closeUnchecked
Methods inherited from interface org.refcodes.component.Closable.CloseBuilder
withCloseUnchecked
Methods inherited from interface org.refcodes.component.ConnectionOpenable
openUnchecked
Methods inherited from interface org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder
withOpenUnchecked
Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor
isOpened
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlerAccessor
getHttpExceptionHandler
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder
withOnHttpException
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlerAccessor.HttpExceptionHandlerMutator
onHttpException, setHttpExceptionHandler
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty
letHttpExceptionHandler
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlingAccessor
getHttpExceptionHandling
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator
setHttpExceptionHandling
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty
letHttpExceptionHandling
Methods inherited from interface org.refcodes.rest.HttpRestServer
open, open, open, open, open, open, open, open, open, open, open, open, withBaseLocator, withClose, withCloseIn, withCloseQuietly, withDisableRequestCorrelation, withDisableSessionCorrelation, withEnableRequestCorrelation, withEnableSessionCorrelation, withHttpExceptionHandler, withHttpExceptionHandling, withKeyStoreDescriptor, withMaxConnections, withOpen, withOpen, withPort, withProtocol, withRequestCorrelation, withScheme, withSessionCorrelation
Methods inherited from interface org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorProperty
letKeyStoreDescriptor
Methods inherited from interface org.refcodes.mixin.Loggable
alert, alert, critical, critical, debug, error, info, notice, panic, trace, warn, warn
Methods inherited from interface org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsProperty
letMaxConnections
Methods inherited from interface org.refcodes.web.MediaTypeFactoryLookup
getFactoryMediaTypes, hasMediaTypeFactory, toMediaTypeFactory
Methods inherited from interface org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
addMediaTypeFactory
Methods inherited from interface org.refcodes.observer.Observable
hasObserverSubscription, subscribeObserver, unsubscribeObserver
Methods inherited from interface org.refcodes.observer.Observers
disableObservers, enableObservers, isObserversActive, observers, setObserversActive
Methods inherited from interface org.refcodes.component.Openable
openUnchecked
Methods inherited from interface org.refcodes.mixin.PortAccessor.PortProperty
letPort
Methods inherited from interface org.refcodes.web.RealmAccessor
getRealm
Methods inherited from interface org.refcodes.web.RealmAccessor.RealmMutator
setRealm
Methods inherited from interface org.refcodes.web.RealmAccessor.RealmProperty
letRealm
Methods inherited from interface org.refcodes.runtime.RequestCorrelation
disableRequestCorrelation, enableRequestCorrelation, hasRequestCorrelation, setRequestCorrelation
Methods inherited from interface org.refcodes.rest.RestServer
onDelete, onDelete, onGet, onGet, onPost, onPost, onPut, onPut, onRequest, onRequest, onRequest, onRequest, onRequest, withDisableObservers, withEnableObservers, withObserversActive
Methods inherited from interface org.refcodes.web.SchemeAccessor.SchemeProperty
letProtocol, letScheme
Methods inherited from interface org.refcodes.runtime.SessionCorrelation
disableSessionCorrelation, enableSessionCorrelation, hasSessionCorrelation, setSessionCorrelation
-
Field Details
-
CONTEXT_PATH
-
-
Constructor Details
-
HttpRestServerImpl
public HttpRestServerImpl(org.refcodes.controlflow.ThreadingModel aThreadingModel) Constructs aHttpRestServerImpl
. UseHttpRestServer.open(int)
or similar to make it listen on your port. The providedThreadingModel
defines whether to use a single-threaded or a multi-threaded threading model. Threads are created as daemon threads. For more control on thread generation use the constructorHttpRestServerImpl(ExecutorService)
.- Parameters:
aThreadingModel
- Specifies to either use a single-threaded threading model (noExecutorService
) or a multi-threaded threading model with a defaultExecutorService
as ofControlFlowUtility.createCachedExecutorService(boolean)
.
-
HttpRestServerImpl
public HttpRestServerImpl(org.refcodes.controlflow.ThreadingModel aThreadingModel, boolean isVerbose) Constructs aHttpRestServerImpl
. UseHttpRestServer.open(int)
or similar to make it listen on your port. The providedThreadingModel
defines whether to use a single-threaded or a multi-threaded threading model. Threads are created as daemon threads. For more control on thread generation use the constructorHttpRestServerImpl(ExecutorService)
.- Parameters:
aThreadingModel
- Specifies to either use a single-threaded threading model (noExecutorService
) or a multi-threaded threading model with a defaultExecutorService
as ofControlFlowUtility.createCachedExecutorService(boolean)
.isVerbose
- When true, any unknown content- and accept-types are logged.
-
HttpRestServerImpl
public HttpRestServerImpl()Constructs aHttpRestServerImpl
. UseHttpRestServer.open(int)
or similar to make it listen on your port. Uses a multi threaded threading model with a defaultExecutorService
as ofControlFlowUtility.createCachedExecutorService(boolean)
. Threads are created as daemon threads. For more control on thread generation use the constructorHttpRestServerImpl(ExecutorService)
. -
HttpRestServerImpl
public HttpRestServerImpl(boolean isVerbose) Constructs aHttpRestServerImpl
. UseHttpRestServer.open(int)
or similar to make it listen on your port. Uses a multi threaded threading model with a defaultExecutorService
as ofControlFlowUtility.createCachedExecutorService(boolean)
. Threads are created as daemon threads. For more control on thread generation use the constructorHttpRestServerImpl(ExecutorService)
.- Parameters:
isVerbose
- When true, any unknown content- and accept-types are logged.
-
HttpRestServerImpl
Constructs aHttpRestServerImpl
. UseHttpRestServer.open(int)
or similar to make it listen on your port. Uses a multi threaded threading model.- Parameters:
aExecutorService
- An executor service to be used when creatingThread
s.
-
HttpRestServerImpl
Constructs aHttpRestServerImpl
. UseHttpRestServer.open(int)
or similar to make it listen on your port. Uses a multi threaded threading model.- Parameters:
aExecutorService
- An executor service to be used when creatingThread
s.isVerbose
- When true, any unknown content- and accept-types are logged.
-
-
Method Details
-
close
- Specified by:
close
in interfaceorg.refcodes.component.Closable
- Throws:
IOException
-
open
public void open(String aProtocol, org.refcodes.security.KeyStoreDescriptor aStoreDescriptor, int aPort, int aMaxConnections) throws IOException Opens the HTTPS sever connection (socket) at the given port allowing the given number of maximum connections at the same time using the provided HTTPS configuration parameters.- Specified by:
open
in interfaceHttpRestServer
- Parameters:
aProtocol
- The protocol to use, e.g. "TLS".aStoreDescriptor
- The store descriptor describing yourKeyStore
required for HTTPS.aPort
- The port on which to listen for requests.aMaxConnections
- The number of maximum connections at the same time.- Throws:
IOException
- thrown in case something went wrong such as the port being already in use.
-
getConnectionStatus
public org.refcodes.component.ConnectionStatus getConnectionStatus()- Specified by:
getConnectionStatus
in interfaceorg.refcodes.component.ConnectionStatusAccessor
-
onConnectionRequest
public HttpRestServer onConnectionRequest(org.refcodes.web.HttpsConnectionRequestObserver aObserver) - Specified by:
onConnectionRequest
in interfaceorg.refcodes.web.HttpsConnectionRequestObservable<HttpRestServer>
-
onBasicAuthRequest
- Specified by:
onBasicAuthRequest
in interfaceorg.refcodes.web.BasicAuthObservable<HttpRestServer>
-
withRealm
- Specified by:
withRealm
in interfaceHttpRestServer
- Specified by:
withRealm
in interfaceorg.refcodes.web.RealmAccessor.RealmBuilder<RestServer>
- Specified by:
withRealm
in interfaceRestServer
-
setPort
public void setPort(int aPort) - Specified by:
setPort
in interfaceorg.refcodes.mixin.PortAccessor.PortMutator
-
getPort
public int getPort()- Specified by:
getPort
in interfaceorg.refcodes.mixin.PortAccessor
-
setScheme
public void setScheme(org.refcodes.data.Scheme aScheme) - Specified by:
setScheme
in interfaceorg.refcodes.web.SchemeAccessor.SchemeMutator
-
getScheme
public org.refcodes.data.Scheme getScheme()- Specified by:
getScheme
in interfaceorg.refcodes.web.SchemeAccessor
-
toProtocol
- Specified by:
toProtocol
in interfaceorg.refcodes.web.SchemeAccessor
-
setProtocol
- Specified by:
setProtocol
in interfaceorg.refcodes.web.SchemeAccessor.SchemeMutator
-
getKeyStoreDescriptor
public org.refcodes.security.KeyStoreDescriptor getKeyStoreDescriptor()- Specified by:
getKeyStoreDescriptor
in interfaceorg.refcodes.security.KeyStoreDescriptorAccessor
-
setKeyStoreDescriptor
public void setKeyStoreDescriptor(org.refcodes.security.KeyStoreDescriptor aKeyStoreDescriptor) - Specified by:
setKeyStoreDescriptor
in interfaceorg.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorMutator
-
getMaxConnections
public int getMaxConnections()- Specified by:
getMaxConnections
in interfaceorg.refcodes.io.MaxConnectionsAccessor
-
setMaxConnections
public void setMaxConnections(int aMaxConnections) - Specified by:
setMaxConnections
in interfaceorg.refcodes.io.MaxConnectionsAccessor.MaxConnectionsMutator
-
getHttpServer
Gets the http server.- Returns:
- the http server
-
open
A hook to be used when using customHttpServer
(HttpsServer
) by custom open(...) methods of sub-classes of thisHttpRestServerImpl
. E.gHttpRestServerImpl
uses this hook to pre-configure aHttpsServer
for HTTPS. The passedHttpServer
(HttpsServer
) must already be bound to a port and enabled with the number of concurrent connections as ofHttpServer.bind(InetSocketAddress, int)
.- Parameters:
aHttpServer
- TheHttpServer
to be used. E.g. anHttpsServer
might be used to enable HTTPS.- Throws:
IOException
- in case opening with the providedHttpRestServer
fails.
-