java.lang.Object
org.refcodes.web.HttpServerContextBuilder
- All Implemented Interfaces:
org.refcodes.io.MaxConnectionsAccessor
,org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsBuilder<HttpServerContextBuilder>
,org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsMutator
,org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsProperty
,org.refcodes.mixin.PortAccessor
,org.refcodes.mixin.PortAccessor.PortBuilder<HttpServerContextBuilder>
,org.refcodes.mixin.PortAccessor.PortMutator
,org.refcodes.mixin.PortAccessor.PortProperty
,org.refcodes.security.KeyStoreDescriptorAccessor
,org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorBuilder<HttpServerContextBuilder>
,org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorMutator
,org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorProperty
,HttpServerContext
,SchemeAccessor
,SchemeAccessor.SchemeBuilder<HttpServerContextBuilder>
,SchemeAccessor.SchemeMutator
,SchemeAccessor.SchemeProperty
public class HttpServerContextBuilder
extends Object
implements HttpServerContext, SchemeAccessor.SchemeProperty, SchemeAccessor.SchemeBuilder<HttpServerContextBuilder>, org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorProperty, org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorBuilder<HttpServerContextBuilder>, org.refcodes.mixin.PortAccessor.PortProperty, org.refcodes.mixin.PortAccessor.PortBuilder<HttpServerContextBuilder>, org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsProperty, org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsBuilder<HttpServerContextBuilder>
The
HttpServerContextBuilder
implements the HttpServerContext
interface extending it with builder functionality..-
Nested Class Summary
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.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.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.SchemeAccessor
SchemeAccessor.SchemeBuilder<B extends SchemeAccessor.SchemeBuilder<B>>, SchemeAccessor.SchemeMutator, SchemeAccessor.SchemeProperty
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final org.refcodes.data.Scheme
-
Constructor Summary
ConstructorDescriptionConstructs aHttpClientContext
with a default schemeScheme.HTTP
for port 8080.HttpServerContextBuilder
(int aPort) Constructs aHttpClientContext
with a default scheme.HttpServerContextBuilder
(String aProtocol, int aPort) Constructs aHttpClientContext
with a default scheme.HttpServerContextBuilder
(String aProtocol, int aPort, org.refcodes.security.KeyStoreDescriptor aKeyStoreDescriptor, int aMaxConnections) Constructs aHttpClientContext
with the given data.HttpServerContextBuilder
(org.refcodes.data.Scheme aScheme, int aPort) Constructs aHttpClientContext
with a default scheme.HttpServerContextBuilder
(org.refcodes.data.Scheme aScheme, int aPort, org.refcodes.security.KeyStoreDescriptor aKeyStoreDescriptor, int aMaxConnections) Constructs aHttpClientContext
with the given data. -
Method Summary
Modifier and TypeMethodDescriptionorg.refcodes.security.KeyStoreDescriptor
int
int
getPort()
org.refcodes.data.Scheme
Retrieves the UrlScheme from the URL scheme.void
setKeyStoreDescriptor
(org.refcodes.security.KeyStoreDescriptor aKeyStoreDescriptor) void
setMaxConnections
(int aMaxConnections) void
setPort
(int aPort) void
setProtocol
(String aProtocol) Sets the protocolString
representation for the scheme property.void
setScheme
(org.refcodes.data.Scheme aScheme) Sets the UrlScheme for the URL scheme.Retrieves the protocol representation from theScheme
.withKeyStoreDescriptor
(org.refcodes.security.KeyStoreDescriptor aKeyStoreDescriptor) withMaxConnections
(int aMaxConnections) withPort
(int aPort) withProtocol
(String aProtocol) Sets the protocol for the URL scheme.withScheme
(org.refcodes.data.Scheme aScheme) Sets the UrlScheme for the URL scheme.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorProperty
letKeyStoreDescriptor
Methods inherited from interface org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsProperty
letMaxConnections
Methods inherited from interface org.refcodes.mixin.PortAccessor.PortProperty
letPort
Methods inherited from interface org.refcodes.web.SchemeAccessor.SchemeProperty
letProtocol, letScheme
-
Field Details
-
DEFAULT_SCHEME
public static final org.refcodes.data.Scheme DEFAULT_SCHEME -
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
-
Constructor Details
-
HttpServerContextBuilder
public HttpServerContextBuilder()Constructs aHttpClientContext
with a default schemeScheme.HTTP
for port 8080. -
HttpServerContextBuilder
public HttpServerContextBuilder(int aPort) Constructs aHttpClientContext
with a default scheme.- Parameters:
aPort
- The TCP port to be used.
-
HttpServerContextBuilder
public HttpServerContextBuilder(org.refcodes.data.Scheme aScheme, int aPort) Constructs aHttpClientContext
with a default scheme.- Parameters:
aScheme
- TheScheme
(HTTP or HTTPS) to be used.aPort
- The TCP port to be used.
-
HttpServerContextBuilder
Constructs aHttpClientContext
with a default scheme.- Parameters:
aProtocol
- The protocol such as theTransportLayerProtocol
aPort
- The TCP port to be used.
-
HttpServerContextBuilder
public HttpServerContextBuilder(org.refcodes.data.Scheme aScheme, int aPort, org.refcodes.security.KeyStoreDescriptor aKeyStoreDescriptor, int aMaxConnections) Constructs aHttpClientContext
with the given data.- Parameters:
aScheme
- TheScheme
(HTTP or HTTPS) to be used.aPort
- The TCP port to be used.aKeyStoreDescriptor
- The descriptor describing the keystore to be used.aMaxConnections
- The maximum allowed open connections.
-
HttpServerContextBuilder
public HttpServerContextBuilder(String aProtocol, int aPort, org.refcodes.security.KeyStoreDescriptor aKeyStoreDescriptor, int aMaxConnections) Constructs aHttpClientContext
with the given data.- Parameters:
aProtocol
- The protocol such as theTransportLayerProtocol
elements.aPort
- The TCP port to be used.aKeyStoreDescriptor
- The descriptor describing the keystore to be used.aMaxConnections
- The maximum allowed open connections.
-
-
Method Details
-
getKeyStoreDescriptor
public org.refcodes.security.KeyStoreDescriptor getKeyStoreDescriptor()- Specified by:
getKeyStoreDescriptor
in interfaceorg.refcodes.security.KeyStoreDescriptorAccessor
-
getMaxConnections
public int getMaxConnections()- Specified by:
getMaxConnections
in interfaceorg.refcodes.io.MaxConnectionsAccessor
-
getPort
public int getPort()- Specified by:
getPort
in interfaceorg.refcodes.mixin.PortAccessor
-
getScheme
public org.refcodes.data.Scheme getScheme()Retrieves the UrlScheme from the URL scheme.- Specified by:
getScheme
in interfaceSchemeAccessor
- Returns:
- The UrlScheme stored by the URL scheme.
-
setKeyStoreDescriptor
public void setKeyStoreDescriptor(org.refcodes.security.KeyStoreDescriptor aKeyStoreDescriptor) - Specified by:
setKeyStoreDescriptor
in interfaceorg.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorMutator
-
setMaxConnections
public void setMaxConnections(int aMaxConnections) - Specified by:
setMaxConnections
in interfaceorg.refcodes.io.MaxConnectionsAccessor.MaxConnectionsMutator
-
setPort
public void setPort(int aPort) - Specified by:
setPort
in interfaceorg.refcodes.mixin.PortAccessor.PortMutator
-
setScheme
public void setScheme(org.refcodes.data.Scheme aScheme) Sets the UrlScheme for the URL scheme.- Specified by:
setScheme
in interfaceSchemeAccessor.SchemeMutator
- Parameters:
aScheme
- The UrlScheme to be stored by the URL scheme.
-
toProtocol
Retrieves the protocol representation from theScheme
. In case of a scheme unknown by theScheme
enumeration, thenSchemeAccessor.getScheme()
might return null whilstSchemeAccessor.toProtocol()
still retrieves the unknown scheme's protocol representation (as ofSchemeAccessor.SchemeMutator.setProtocol(String)
).- Specified by:
toProtocol
in interfaceSchemeAccessor
- Returns:
- The protocol representation for the URL.
-
setProtocol
Sets the protocolString
representation for the scheme property. You must provide the scheme's specific part as well. In case of HTTP, provide "http://". In case your provided protocol is unknown by theScheme
enumeration, then the scheme property will not be set, though theSchemeAccessor.toProtocol()
still returns your protocol.- Specified by:
setProtocol
in interfaceSchemeAccessor.SchemeMutator
- Parameters:
aProtocol
- The UrlScheme'sString
representation to be stored by the URL scheme.
-
withKeyStoreDescriptor
public HttpServerContextBuilder withKeyStoreDescriptor(org.refcodes.security.KeyStoreDescriptor aKeyStoreDescriptor) - Specified by:
withKeyStoreDescriptor
in interfaceorg.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorBuilder<HttpServerContextBuilder>
-
withMaxConnections
- Specified by:
withMaxConnections
in interfaceorg.refcodes.io.MaxConnectionsAccessor.MaxConnectionsBuilder<HttpServerContextBuilder>
-
withPort
- Specified by:
withPort
in interfaceorg.refcodes.mixin.PortAccessor.PortBuilder<HttpServerContextBuilder>
-
withProtocol
Sets the protocol for the URL scheme.- Specified by:
withProtocol
in interfaceSchemeAccessor.SchemeBuilder<HttpServerContextBuilder>
- Parameters:
aProtocol
- The protocol to be stored by the URL scheme.- Returns:
- The builder for applying multiple build operations.
-
withScheme
Sets the UrlScheme for the URL scheme.- Specified by:
withScheme
in interfaceSchemeAccessor.SchemeBuilder<HttpServerContextBuilder>
- Parameters:
aScheme
- The UrlScheme to be stored by the URL scheme.- Returns:
- The builder for applying multiple build operations.
-