Package org.refcodes.net
Class HttpServerContextBuilderImpl
- java.lang.Object
-
- org.refcodes.net.HttpServerContextBuilderImpl
-
- All Implemented Interfaces:
org.refcodes.io.MaxConnectionsAccessor,org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsBuilder<HttpServerContext.HttpServerContextBuilder>,org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsMutator,org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsProperty,org.refcodes.mixin.PortAccessor,org.refcodes.mixin.PortAccessor.PortBuilder<HttpServerContext.HttpServerContextBuilder>,org.refcodes.mixin.PortAccessor.PortMutator,org.refcodes.mixin.PortAccessor.PortProperty,HttpServerContext.HttpServerContextBuilder,SchemeAccessor,SchemeAccessor.SchemeBuilder<HttpServerContext.HttpServerContextBuilder>,SchemeAccessor.SchemeMutator,SchemeAccessor.SchemeProperty,org.refcodes.security.KeyStoreDescriptorAccessor,org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorBuilder<HttpServerContext.HttpServerContextBuilder>,org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorMutator,org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorProperty
public class HttpServerContextBuilderImpl extends java.lang.Object implements HttpServerContext.HttpServerContextBuilder
TheHttpServerContextBuilderImplimplements theHttpServerContext.HttpServerContextBuilderinterface and can be used asHttpServerContextfor opening an HTTP-Server such as the `HttpRestServer` from the `org.refcodes:refcodes-rest` artifact.
-
-
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.net.SchemeAccessor
SchemeAccessor.SchemeBuilder<B extends SchemeAccessor.SchemeBuilder<B>>, SchemeAccessor.SchemeMutator, SchemeAccessor.SchemeProperty
-
-
Constructor Summary
Constructors Constructor Description HttpServerContextBuilderImpl(java.lang.String aProtocol, int aPort, org.refcodes.security.KeyStoreDescriptor aStoreDescriptor, int aMaxConnections)Constructs aHttpClientContextwith the given data.HttpServerContextBuilderImpl(org.refcodes.data.Scheme aScheme, int aPort, org.refcodes.security.KeyStoreDescriptor aStoreDescriptor, int aMaxConnections)Constructs aHttpClientContextwith the given data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.refcodes.security.KeyStoreDescriptorgetKeyStoreDescriptor()intgetMaxConnections()intgetPort()org.refcodes.data.SchemegetScheme()Retrieves the UrlScheme from the URL scheme.voidsetKeyStoreDescriptor(org.refcodes.security.KeyStoreDescriptor aStoreDescriptor)voidsetMaxConnections(int aMaxConnections)voidsetPort(int aPort)voidsetProtocol(java.lang.String aProtocol)Sets the protocolStringrepresentation for the scheme property.voidsetScheme(org.refcodes.data.Scheme aScheme)Sets the UrlScheme for the URL scheme.java.lang.StringtoProtocol()Retrieves the protocol representation from theScheme.-
Methods inherited from interface org.refcodes.net.HttpServerContext.HttpServerContextBuilder
withKeyStoreDescriptor, withMaxConnections, withPort, withProtocol, withScheme
-
-
-
-
Constructor Detail
-
HttpServerContextBuilderImpl
public HttpServerContextBuilderImpl(org.refcodes.data.Scheme aScheme, int aPort, org.refcodes.security.KeyStoreDescriptor aStoreDescriptor, int aMaxConnections)Constructs aHttpClientContextwith the given data.- Parameters:
aScheme- TheScheme(HTTP or HTTPS) to be used.aPort- The TCP port to be used.aStoreDescriptor- The descriptor describing the keystore to be used.aMaxConnections- The maximum allowed open connections.
-
HttpServerContextBuilderImpl
public HttpServerContextBuilderImpl(java.lang.String aProtocol, int aPort, org.refcodes.security.KeyStoreDescriptor aStoreDescriptor, int aMaxConnections)Constructs aHttpClientContextwith the given data.- Parameters:
aProtocol- The protocol such as theTransportLayerProtocolelements.aPort- The TCP port to be used.aStoreDescriptor- The descriptor describing the keystore to be used.aMaxConnections- The maximum allowed open connections.
-
-
Method Detail
-
getKeyStoreDescriptor
public org.refcodes.security.KeyStoreDescriptor getKeyStoreDescriptor()
- Specified by:
getKeyStoreDescriptorin interfaceorg.refcodes.security.KeyStoreDescriptorAccessor
-
getMaxConnections
public int getMaxConnections()
- Specified by:
getMaxConnectionsin interfaceorg.refcodes.io.MaxConnectionsAccessor
-
getPort
public int getPort()
- Specified by:
getPortin interfaceorg.refcodes.mixin.PortAccessor
-
getScheme
public org.refcodes.data.Scheme getScheme()
Retrieves the UrlScheme from the URL scheme.- Specified by:
getSchemein interfaceSchemeAccessor- Returns:
- The UrlScheme stored by the URL scheme.
-
setKeyStoreDescriptor
public void setKeyStoreDescriptor(org.refcodes.security.KeyStoreDescriptor aStoreDescriptor)
- Specified by:
setKeyStoreDescriptorin interfaceorg.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorMutator
-
setMaxConnections
public void setMaxConnections(int aMaxConnections)
- Specified by:
setMaxConnectionsin interfaceorg.refcodes.io.MaxConnectionsAccessor.MaxConnectionsMutator
-
setPort
public void setPort(int aPort)
- Specified by:
setPortin interfaceorg.refcodes.mixin.PortAccessor.PortMutator
-
setScheme
public void setScheme(org.refcodes.data.Scheme aScheme)
Sets the UrlScheme for the URL scheme.- Specified by:
setSchemein interfaceSchemeAccessor.SchemeMutator- Parameters:
aScheme- The UrlScheme to be stored by the URL scheme.
-
toProtocol
public java.lang.String toProtocol()
Retrieves the protocol representation from theScheme. In case of a scheme unknown by theSchemeenumeration, thenSchemeAccessor.getScheme()might return null whilstSchemeAccessor.toProtocol()still retrieves the unknown scheme's protocol representation (as ofSchemeAccessor.SchemeMutator.setProtocol(String)).- Specified by:
toProtocolin interfaceSchemeAccessor- Returns:
- The protocol representation for the URL.
-
setProtocol
public void setProtocol(java.lang.String aProtocol)
Sets the protocolStringrepresentation 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 theSchemeenumeration, then the scheme property will not be set, though theSchemeAccessor.toProtocol()still returns your protocol.- Specified by:
setProtocolin interfaceSchemeAccessor.SchemeMutator- Parameters:
aProtocol- The UrlScheme'sStringrepresentation to be stored by the URL scheme.
-
-