public interface HttpRestServer extends RestServer, org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<Integer,HttpRestServer>, org.refcodes.net.BasicAuthObservable<HttpRestServer>, org.refcodes.net.HttpsConnectionRequestObservable<HttpRestServer>
RestServer
to be capable of opening a server socket on the
local host with the provided port number via ConnectionOpenable.open(Object)
or with an
additional maximum number of connections via open(Integer, int)
.
To open a HTTPS port, use the methods such as:
open(File, String, Integer)
or
open(File, String, String, Integer)
or
open(String, File, String, String, String, Integer, int)
.
A HttpRestServer
can be shutdown via Closable.close()
.org.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
org.refcodes.net.RealmAccessor.RealmBuilder<B extends org.refcodes.net.RealmAccessor.RealmBuilder<B>>, org.refcodes.net.RealmAccessor.RealmMutator, org.refcodes.net.RealmAccessor.RealmProperty
org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B extends org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B>>, org.refcodes.net.BaseLocatorAccessor.BaseLocatorMutator, org.refcodes.net.BaseLocatorAccessor.BaseLocatorProperty
org.refcodes.component.ConnectionComponent.ConnectionAutomaton<CON>, org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON,B extends org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON,B>>
org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<CON>, org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON,B extends org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON,B>>
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_KEYSTORE_FORMAT |
static String |
DEFAULT_SSL_PROTOCOL |
Modifier and Type | Method and Description |
---|---|
default void |
open(File aKeyStoreFile,
String aPassword,
Integer aPort)
Same as
open(String, File, String, String, String, Integer, int)
but:
The protocol fore the underlying SSLContext used is set to
"TLS". |
default void |
open(File aKeyStoreFile,
String aKeyStorePassword,
Integer aPort,
int aMaxConnections)
Same as
open(String, File, String, String, String, Integer, int)
but:
The protocol fore the underlying SSLContext used is set to
"TLS". |
default void |
open(File aKeyStoreFile,
String aKeyStorePassword,
String aKeyPassword,
Integer aPort)
Same as
open(String, File, String, String, String, Integer, int)
but:
The protocol fore the underlying SSLContext used is set to
"TLS". |
default void |
open(File aKeyStoreFile,
String aKeyStorePassword,
String aKeyPassword,
Integer aPort,
int aMaxConnections)
Same as
open(String, File, String, String, String, Integer, int)
but:
The protocol fore the underlying SSLContext used is set to
"TLS". |
void |
open(Integer aPort,
int aMaxConnections)
Opens the HTTP sever connection (socket) at the given port allowing the
given number of maximum connections at the same time.
|
default void |
open(String aSecureSocketProtocol,
File aKeyStoreFile,
String aKeyStorePassword,
Integer aPort)
Same as
open(String, File, String, String, String, Integer, int)
but:
The type of KeyStore is set to "JKS". |
default void |
open(String aSecureSocketProtocol,
File aKeyStoreFile,
String aKeyStorePassword,
Integer aPort,
int aMaxConnections)
Same as
open(String, File, String, String, String, Integer, int)
but:
The type of KeyStore is set to "JKS". |
default void |
open(String aSecureSocketProtocol,
File aKeyStoreFile,
String aKeyStoreType,
String aKeyStorePassword,
String aKeyPassword,
Integer aPort)
Same as
open(String, File, String, String, String, Integer, int)
but:
The number of maximum connections at the same time is decided upon by
the implementations's default value. |
void |
open(String aSecureSocketProtocol,
File aKeyStoreFile,
String aKeyStoreType,
String aKeyStorePassword,
String aKeyPassword,
Integer 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.
|
default HttpRestServer |
withBaseLocator(String aBaseLocator)
With base locator.
|
default HttpRestServer |
withClose()
With close.
|
default HttpRestServer |
withCloseIn(int aCloseInMillis)
With close in.
|
default HttpRestServer |
withCloseQuietly()
With close quietly.
|
default HttpRestServer |
withDisableRequestCorrelation()
With disable request correlation.
|
default HttpRestServer |
withDisableSessionCorrelation()
With disable session correlation.
|
default HttpRestServer |
withEnableRequestCorrelation()
With enable request correlation.
|
default HttpRestServer |
withEnableSessionCorrelation()
With enable session correlation.
|
default HttpRestServer |
withOpen(Integer aConnection)
With open.
|
default HttpRestServer |
withRealm(String aRealm)
With realm.
|
default HttpRestServer |
withRequestCorrelation(boolean hasRequestCorrelation)
With request correlation.
|
default HttpRestServer |
withSessionCorrelation(boolean hasSessionCorrelation)
With session correlation.
|
onDelete, onGet, onPost, onPut, onRequest, onRequest, onRequest
hasObserverSubscription, subscribeObserver, unsubscribeObserver
addMediaTypeFactory
getFactoryMediaTypes, hasMediaTypeFactory, toMediaTypeFactory
setBaseLocator
disableRequestCorrelation, enableRequestCorrelation, hasRequestCorrelation, setRequestCorrelation
static final String DEFAULT_SSL_PROTOCOL
static final String DEFAULT_KEYSTORE_FORMAT
default HttpRestServer withSessionCorrelation(boolean hasSessionCorrelation)
withSessionCorrelation
in interface RestServer
withSessionCorrelation
in interface org.refcodes.runtime.SessionCorrelation<RestServer>
hasSessionCorrelation
- the has session correlationdefault HttpRestServer withEnableSessionCorrelation()
withEnableSessionCorrelation
in interface RestServer
withEnableSessionCorrelation
in interface org.refcodes.runtime.SessionCorrelation<RestServer>
default HttpRestServer withDisableSessionCorrelation()
withDisableSessionCorrelation
in interface RestServer
withDisableSessionCorrelation
in interface org.refcodes.runtime.SessionCorrelation<RestServer>
default HttpRestServer withRequestCorrelation(boolean hasRequestCorrelation)
withRequestCorrelation
in interface org.refcodes.runtime.RequestCorrelation<RestServer>
withRequestCorrelation
in interface RestServer
hasRequestCorrelation
- the has request correlationdefault HttpRestServer withEnableRequestCorrelation()
withEnableRequestCorrelation
in interface org.refcodes.runtime.RequestCorrelation<RestServer>
withEnableRequestCorrelation
in interface RestServer
default HttpRestServer withDisableRequestCorrelation()
withDisableRequestCorrelation
in interface org.refcodes.runtime.RequestCorrelation<RestServer>
withDisableRequestCorrelation
in interface RestServer
void open(Integer aPort, int aMaxConnections) throws org.refcodes.component.OpenException
aPort
- The port on which to listen for requests.aMaxConnections
- The number of maximum connections at the same timeorg.refcodes.component.OpenException
- thrown in case something went wrong such as the
port being already in use.void open(String aSecureSocketProtocol, File aKeyStoreFile, String aKeyStoreType, String aKeyStorePassword, String aKeyPassword, Integer aPort, int aMaxConnections) throws org.refcodes.component.OpenException
aSecureSocketProtocol
- The protocol to use, e.g. "TLS".aKeyStoreFile
- The file pointing to your KeyStore
.aKeyStoreType
- The type of KeyStore
, e.g. "JKS" format.aKeyStorePassword
- The password for the KeyStore
.aKeyPassword
- The password for the KeyStore
's key.aPort
- The port on which to listen for requests.aMaxConnections
- The number of maximum connections at the same timeorg.refcodes.component.OpenException
- thrown in case something went wrong such as the
port being already in use.default void open(String aSecureSocketProtocol, File aKeyStoreFile, String aKeyStoreType, String aKeyStorePassword, String aKeyPassword, Integer aPort) throws org.refcodes.component.OpenException
open(String, File, String, String, String, Integer, int)
but:
aSecureSocketProtocol
- The protocol to use, e.g. "TLS".aKeyStoreFile
- The file pointing to your KeyStore
.aKeyStoreType
- The type of KeyStore
, e.g. "JKS" format.aKeyStorePassword
- The password for the KeyStore
.aKeyPassword
- The password for the KeyStore
's key.aPort
- The port on which to listen for requests.org.refcodes.component.OpenException
- thrown in case something went wrong such as the
port being already in use.default void open(String aSecureSocketProtocol, File aKeyStoreFile, String aKeyStorePassword, Integer aPort, int aMaxConnections) throws org.refcodes.component.OpenException
aSecureSocketProtocol
- The protocol to use, e.g. "TLS".aKeyStoreFile
- The file pointing to your KeyStore
.aKeyStorePassword
- The password for the KeyStore
.aPort
- The port on which to listen for requests.aMaxConnections
- The number of maximum connections at the same timeorg.refcodes.component.OpenException
- thrown in case something went wrong such as the
port being already in use.default void open(String aSecureSocketProtocol, File aKeyStoreFile, String aKeyStorePassword, Integer aPort) throws org.refcodes.component.OpenException
aSecureSocketProtocol
- The protocol to use, e.g. "TLS".aKeyStoreFile
- The file pointing to your KeyStore
.aKeyStorePassword
- The password for the KeyStore
.aPort
- The port on which to listen for requests.org.refcodes.component.OpenException
- thrown in case something went wrong such as the
port being already in use.default void open(File aKeyStoreFile, String aKeyStorePassword, Integer aPort, int aMaxConnections) throws org.refcodes.component.OpenException
open(String, File, String, String, String, Integer, int)
but:
SSLContext
used is set to
"TLS".
KeyStore
is set to "JKS".
KeyStore
's key is assumed to be the same
as the provided KeyStore
password.
aKeyStoreFile
- The file pointing to your KeyStore
.aKeyStorePassword
- The password for the KeyStore
.aPort
- The port on which to listen for requests.aMaxConnections
- The number of maximum connections at the same timeorg.refcodes.component.OpenException
- thrown in case something went wrong such as the
port being already in use.default void open(File aKeyStoreFile, String aKeyStorePassword, String aKeyPassword, Integer aPort) throws org.refcodes.component.OpenException
open(String, File, String, String, String, Integer, int)
but:
SSLContext
used is set to
"TLS".
KeyStore
is set to "JKS".
aKeyStoreFile
- The file pointing to your KeyStore
.aKeyStorePassword
- The password for the KeyStore
.aKeyPassword
- The password for the KeyStore
's key.aPort
- The port on which to listen for requests.org.refcodes.component.OpenException
- thrown in case something went wrong such as the
port being already in use.default void open(File aKeyStoreFile, String aKeyStorePassword, String aKeyPassword, Integer aPort, int aMaxConnections) throws org.refcodes.component.OpenException
open(String, File, String, String, String, Integer, int)
but:
SSLContext
used is set to
"TLS".
KeyStore
is set to "JKS".
aKeyStoreFile
- The file pointing to your KeyStore
.aKeyStorePassword
- The password for the KeyStore
.aKeyPassword
- The password for the KeyStore
's key.aPort
- The port on which to listen for requests.aMaxConnections
- The number of maximum connections at the same timeorg.refcodes.component.OpenException
- thrown in case something went wrong such as the
port being already in use.default void open(File aKeyStoreFile, String aPassword, Integer aPort) throws org.refcodes.component.OpenException
open(String, File, String, String, String, Integer, int)
but:
SSLContext
used is set to
"TLS".
KeyStore
is set to "JKS".
KeyStore
's key is assumed to be the same
as the provided KeyStore
password.
default HttpRestServer withRealm(String aRealm)
withRealm
in interface org.refcodes.net.RealmAccessor.RealmBuilder<RestServer>
withRealm
in interface RestServer
aRealm
- the a realmdefault HttpRestServer withBaseLocator(String aBaseLocator)
withBaseLocator
in interface org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
withBaseLocator
in interface RestServer
aBaseLocator
- the a base locatordefault HttpRestServer withClose() throws org.refcodes.component.CloseException
withClose
in interface org.refcodes.component.Closable.CloseBuilder<org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<Integer,HttpRestServer>>
org.refcodes.component.CloseException
- the close exceptiondefault HttpRestServer withCloseQuietly()
withCloseQuietly
in interface org.refcodes.component.Closable.CloseBuilder<org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<Integer,HttpRestServer>>
default HttpRestServer withCloseIn(int aCloseInMillis)
withCloseIn
in interface org.refcodes.component.Closable.CloseBuilder<org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<Integer,HttpRestServer>>
aCloseInMillis
- the a close in millisdefault HttpRestServer withOpen(Integer aConnection) throws org.refcodes.component.OpenException
withOpen
in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<Integer,org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<Integer,HttpRestServer>>
aConnection
- the a connectionorg.refcodes.component.OpenException
- the open exceptionCopyright © 2017. All rights reserved.