Package org.refcodes.rest
Class AbstractHttpRestServerDecorator<B extends HttpRestServer>
- java.lang.Object
-
- org.refcodes.rest.AbstractHttpRestServerDecorator<B>
-
- All Implemented Interfaces:
org.refcodes.component.Closable,org.refcodes.component.Closable.CloseBuilder<B>,org.refcodes.component.ConnectionComponent<B>,org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<org.refcodes.net.HttpServerContext,HttpRestServer>,org.refcodes.component.ConnectionOpenable<B>,org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<RestEndpoint,RestServer>,org.refcodes.component.ConnectionStatusAccessor,org.refcodes.component.LinkComponent,org.refcodes.component.Openable,org.refcodes.io.MaxConnectionsAccessor,org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsBuilder<B>,org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsMutator,org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsProperty,org.refcodes.mixin.PortAccessor,org.refcodes.mixin.PortAccessor.PortBuilder<B>,org.refcodes.mixin.PortAccessor.PortMutator,org.refcodes.mixin.PortAccessor.PortProperty,org.refcodes.net.BaseLocatorAccessor,org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B>,org.refcodes.net.BaseLocatorAccessor.BaseLocatorMutator,org.refcodes.net.BaseLocatorAccessor.BaseLocatorProperty,org.refcodes.net.BasicAuthObservable<B>,org.refcodes.net.HttpsConnectionRequestObservable<B>,org.refcodes.net.MediaTypeFactoryLookup,org.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup,org.refcodes.net.RealmAccessor,org.refcodes.net.RealmAccessor.RealmBuilder<B>,org.refcodes.net.RealmAccessor.RealmMutator,org.refcodes.net.RealmAccessor.RealmProperty,org.refcodes.net.SchemeAccessor,org.refcodes.net.SchemeAccessor.SchemeBuilder<B>,org.refcodes.net.SchemeAccessor.SchemeMutator,org.refcodes.net.SchemeAccessor.SchemeProperty,org.refcodes.observer.Observable<B>,org.refcodes.observer.Observers<RestEndpoint,RestServer>,HttpExceptionHandlerAccessor,HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<B>,HttpExceptionHandlerAccessor.HttpExceptionHandlerMutator,HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty,HttpExceptionHandlingAccessor,HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<B>,HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator,HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty,HttpRestServer,RestServer,org.refcodes.runtime.RequestCorrelation<B>,org.refcodes.runtime.SessionCorrelation<B>,org.refcodes.security.KeyStoreDescriptorAccessor,org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorBuilder<B>,org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorMutator,org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorProperty
- Direct Known Subclasses:
AbstractHttpRegistryRestServerDecorator
public abstract class AbstractHttpRestServerDecorator<B extends HttpRestServer> extends java.lang.Object implements HttpRestServer
Abstract class for easily decorating aHttpRestServer.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.net.BaseLocatorAccessor
org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B extends org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B>>, org.refcodes.net.BaseLocatorAccessor.BaseLocatorMutator, org.refcodes.net.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 java.lang.Object>, org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON extends java.lang.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 java.lang.Object>, org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON extends java.lang.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.net.MediaTypeFactoryLookup
org.refcodes.net.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.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
-
-
Field Summary
Fields Modifier and Type Field Description protected HttpRestServer_server
-
Constructor Summary
Constructors Constructor Description AbstractHttpRestServerDecorator(HttpRestServer aServer)Decorates the givenHttpRestServerwith additional functionality.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddMediaTypeFactory(org.refcodes.net.MediaTypeFactory aMediaTypeFactory)voidclose()voidcloseIn(int aCloseInMillis)voidcloseQuietly()voidcloseUnchecked()voiddisableRequestCorrelation()voiddisableSessionCorrelation()voidenableRequestCorrelation()voidenableSessionCorrelation()java.lang.StringgetBaseLocator()org.refcodes.net.MediaType[]getFactoryMediaTypes()org.refcodes.security.KeyStoreDescriptorgetKeyStoreDescriptor()intgetMaxConnections()intgetPort()java.lang.StringgetRealm()org.refcodes.data.SchemegetScheme()booleanhasMediaTypeFactory(org.refcodes.net.MediaType aMediaType)booleanhasObserverSubscription(RestEndpoint aObserver)booleanhasRequestCorrelation()booleanhasSessionCorrelation()java.util.Iterator<RestEndpoint>observers()BonBasicAuthRequest(org.refcodes.net.BasicAuthObserver aObserver)BonConnectionRequest(org.refcodes.net.HttpsConnectionRequestObserver aObserver)RestEndpointBuilderonDelete(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)Even more convenient: Everything done here can also be done usingRestServer.onRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming DELETE methods.RestEndpointBuilderonGet(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)Even more convenient: Everything done here can also be done usingRestServer.onRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming GET methods.RestEndpointBuilderonPost(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)Even more convenient: Everything done here can also be done usingRestServer.onRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming POST methods.RestEndpointBuilderonPut(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)Even more convenient: Everything done here can also be done usingRestServer.onRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming PUT methods.RestEndpointBuilderonRequest(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)Registers a pre-configuredRestEndpoint, triggerd by any HTTP method, and returns its instance.RestEndpointBuilderonRequest(org.refcodes.net.HttpMethod aHttpMethod, java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)Registers a pre-configuredRestEndpointwith the least required attributes and returns its instance.booleanonRequest(RestEndpoint aRestEndpoint)For the sake of unified naming, this method just delegates toObservable.subscribeObserver(Object).voidopen(int aPort)Opens the HTTP sever connection (socket) at the given portvoidopen(int aPort, int aMaxConnections)Opens the HTTP sever connection (socket) at the given port allowing the given number of maximum connections at the same time.voidopen(java.lang.String aProtocol, org.refcodes.security.KeyStoreDescriptor aStoreDescriptor, int aPort)Same asHttpRestServer.open(String, KeyStoreDescriptor, int, int)but: The number of maximum connections at the same time is decided upon by the implementations's default value.voidopen(java.lang.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.voidopenUnchecked(org.refcodes.net.HttpServerContext aConnection)voidsetBaseLocator(java.lang.String aBaseLocator)voidsetKeyStoreDescriptor(org.refcodes.security.KeyStoreDescriptor aStoreDescriptor)voidsetMaxConnections(int aMaxConnections)voidsetPort(int aPort)voidsetProtocol(java.lang.String aProtocol)voidsetRealm(java.lang.String aRealm)voidsetRequestCorrelation(boolean hasRequestCorrelation)voidsetScheme(org.refcodes.data.Scheme aScheme)voidsetSessionCorrelation(boolean hasSessionCorrelation)booleansubscribeObserver(RestEndpoint aObserver)org.refcodes.net.MediaTypeFactorytoMediaTypeFactory(org.refcodes.net.MediaType aMediaType)java.lang.StringtoProtocol()booleanunsubscribeObserver(RestEndpoint aObserver)BwithBaseLocator(java.lang.String aBaseLocator)BwithClose()BwithCloseIn(int aCloseInMillis)BwithCloseQuietly()BwithCloseUnchecked()BwithDisableRequestCorrelation()BwithDisableSessionCorrelation()BwithEnableRequestCorrelation()BwithEnableSessionCorrelation()BwithOpen(org.refcodes.net.HttpServerContext aConnection)BwithOpenUnchecked(org.refcodes.net.HttpServerContext aConnection)BwithRealm(java.lang.String aRealm)BwithRequestCorrelation(boolean hasRequestCorrelation)BwithSessionCorrelation(boolean hasSessionCorrelation)-
Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor
getConnectionStatus, isConnectionOpened
-
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.HttpExceptionHandlingAccessor
getHttpExceptionHandling
-
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator
setHttpExceptionHandling
-
Methods inherited from interface org.refcodes.rest.HttpRestServer
open, open, open, open, open, open, open, open, open, withHttpExceptionHandler, withHttpExceptionHandling, withKeyStoreDescriptor, withMaxConnections, withOpen, withPort, withProtocol, withScheme
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.refcodes.observer.Observers
disableObservers, enableObservers, isObserversActive, setObserversActive
-
Methods inherited from interface org.refcodes.rest.RestServer
withDisableObservers, withEnableObservers, withObserversActive
-
-
-
-
Field Detail
-
_server
protected HttpRestServer _server
-
-
Constructor Detail
-
AbstractHttpRestServerDecorator
public AbstractHttpRestServerDecorator(HttpRestServer aServer)
Decorates the givenHttpRestServerwith additional functionality.- Parameters:
aServer- TheHttpRestServerto be decorated.
-
-
Method Detail
-
getPort
public int getPort()
- Specified by:
getPortin interfaceorg.refcodes.mixin.PortAccessor
-
setPort
public void setPort(int aPort)
- Specified by:
setPortin interfaceorg.refcodes.mixin.PortAccessor.PortMutator
-
getScheme
public org.refcodes.data.Scheme getScheme()
- Specified by:
getSchemein interfaceorg.refcodes.net.SchemeAccessor
-
setScheme
public void setScheme(org.refcodes.data.Scheme aScheme)
- Specified by:
setSchemein interfaceorg.refcodes.net.SchemeAccessor.SchemeMutator
-
addMediaTypeFactory
public boolean addMediaTypeFactory(org.refcodes.net.MediaTypeFactory aMediaTypeFactory)
- Specified by:
addMediaTypeFactoryin interfaceorg.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
-
close
public void close() throws org.refcodes.component.CloseException- Specified by:
closein interfaceorg.refcodes.component.Closable- Throws:
org.refcodes.component.CloseException
-
closeIn
public void closeIn(int aCloseInMillis)
- Specified by:
closeInin interfaceorg.refcodes.component.Closable
-
closeQuietly
public void closeQuietly()
- Specified by:
closeQuietlyin interfaceorg.refcodes.component.Closable
-
closeUnchecked
public void closeUnchecked()
- Specified by:
closeUncheckedin interfaceorg.refcodes.component.Closable
-
disableRequestCorrelation
public void disableRequestCorrelation()
- Specified by:
disableRequestCorrelationin interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestServer>
-
disableSessionCorrelation
public void disableSessionCorrelation()
- Specified by:
disableSessionCorrelationin interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestServer>
-
enableRequestCorrelation
public void enableRequestCorrelation()
- Specified by:
enableRequestCorrelationin interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestServer>
-
enableSessionCorrelation
public void enableSessionCorrelation()
- Specified by:
enableSessionCorrelationin interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestServer>
-
getBaseLocator
public java.lang.String getBaseLocator()
- Specified by:
getBaseLocatorin interfaceorg.refcodes.net.BaseLocatorAccessor
-
getFactoryMediaTypes
public org.refcodes.net.MediaType[] getFactoryMediaTypes()
- Specified by:
getFactoryMediaTypesin interfaceorg.refcodes.net.MediaTypeFactoryLookup
-
getRealm
public java.lang.String getRealm()
- Specified by:
getRealmin interfaceorg.refcodes.net.RealmAccessor
-
hasMediaTypeFactory
public boolean hasMediaTypeFactory(org.refcodes.net.MediaType aMediaType)
- Specified by:
hasMediaTypeFactoryin interfaceorg.refcodes.net.MediaTypeFactoryLookup
-
hasObserverSubscription
public boolean hasObserverSubscription(RestEndpoint aObserver)
- Specified by:
hasObserverSubscriptionin interfaceorg.refcodes.observer.Observable<B extends HttpRestServer>
-
hasRequestCorrelation
public boolean hasRequestCorrelation()
- Specified by:
hasRequestCorrelationin interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestServer>
-
hasSessionCorrelation
public boolean hasSessionCorrelation()
- Specified by:
hasSessionCorrelationin interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestServer>
-
onBasicAuthRequest
public B onBasicAuthRequest(org.refcodes.net.BasicAuthObserver aObserver)
- Specified by:
onBasicAuthRequestin interfaceorg.refcodes.net.BasicAuthObservable<B extends HttpRestServer>
-
onConnectionRequest
public B onConnectionRequest(org.refcodes.net.HttpsConnectionRequestObserver aObserver)
- Specified by:
onConnectionRequestin interfaceorg.refcodes.net.HttpsConnectionRequestObservable<B extends HttpRestServer>
-
onDelete
public RestEndpointBuilder onDelete(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done usingRestServer.onRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming DELETE methods. Attention: InvokeOpenable.open()to activate this endpoint!- Specified by:
onDeletein interfaceRestServer- Parameters:
aLocatorPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestObserver- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The pre-configured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onGet
public RestEndpointBuilder onGet(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done usingRestServer.onRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming GET methods. Attention: InvokeOpenable.open()to activate this endpoint!- Specified by:
onGetin interfaceRestServer- Parameters:
aLocatorPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestObserver- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The pre-configured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onPost
public RestEndpointBuilder onPost(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done usingRestServer.onRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming POST methods. Attention: InvokeOpenable.open()to activate this endpoint!- Specified by:
onPostin interfaceRestServer- Parameters:
aLocatorPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestObserver- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The pre-configured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onPut
public RestEndpointBuilder onPut(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done usingRestServer.onRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming PUT methods. Attention: InvokeOpenable.open()to activate this endpoint!- Specified by:
onPutin interfaceRestServer- Parameters:
aLocatorPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestObserver- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The pre-configured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onRequest
public RestEndpointBuilder onRequest(org.refcodes.net.HttpMethod aHttpMethod, java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Registers a pre-configuredRestEndpointwith the least required attributes and returns its instance. To unsubscribe viaObservable.unsubscribeObserver(Object), use the returned instance. Attention: InvokeOpenable.open()to activate this endpoint!- Specified by:
onRequestin interfaceRestServer- Parameters:
aHttpMethod- The HTTP-Method to which thisRestEndpointis bound. A value ofnullmeans that any HTTP-Method may trigger thisRestEndpoint.aLocatorPattern- The local Locator-Pattern to which thisRestEndpointis bound. A value ofnullmeans that any locator may trigger thisRestEndpoint.aRequestObserver- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The pre-configured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onRequest
public boolean onRequest(RestEndpoint aRestEndpoint)
For the sake of unified naming, this method just delegates toObservable.subscribeObserver(Object).- Specified by:
onRequestin interfaceRestServer- Parameters:
aRestEndpoint- the rest endpoint- Returns:
- true, if successful
-
onRequest
public RestEndpointBuilder onRequest(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Registers a pre-configuredRestEndpoint, triggerd by any HTTP method, and returns its instance. To unsubscribe viaObservable.unsubscribeObserver(Object), use the returned instance. Attention: InvokeOpenable.open()to activate this endpoint!- Specified by:
onRequestin interfaceRestServer- Parameters:
aLocatorPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestObserver- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The pre-configured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
open
public void open(int aPort) throws org.refcodes.component.OpenExceptionOpens the HTTP sever connection (socket) at the given port- Specified by:
openin interfaceHttpRestServer- Parameters:
aPort- The port on which to listen for requests.- Throws:
org.refcodes.component.OpenException- thrown in case something went wrong such as the port being already in use.
-
open
public void open(int aPort, int aMaxConnections) throws org.refcodes.component.OpenExceptionOpens the HTTP sever connection (socket) at the given port allowing the given number of maximum connections at the same time.- Specified by:
openin interfaceHttpRestServer- Parameters:
aPort- The port on which to listen for requests.aMaxConnections- The number of maximum connections at the same time.- Throws:
org.refcodes.component.OpenException- thrown in case something went wrong such as the port being already in use.
-
open
public void open(java.lang.String aProtocol, org.refcodes.security.KeyStoreDescriptor aStoreDescriptor, int aPort) throws org.refcodes.component.OpenExceptionSame asHttpRestServer.open(String, KeyStoreDescriptor, int, int)but:- The number of maximum connections at the same time is decided upon by the implementations's default value.
- Specified by:
openin interfaceHttpRestServer- Parameters:
aProtocol- The protocol to use, e.g. "TLS".aStoreDescriptor- The store descriptor describing yourKeyStorerequired for HTTPS.aPort- The port on which to listen for requests.- Throws:
org.refcodes.component.OpenException- thrown in case something went wrong such as the port being already in use.
-
open
public void open(java.lang.String aProtocol, org.refcodes.security.KeyStoreDescriptor aStoreDescriptor, int aPort, int aMaxConnections) throws org.refcodes.component.OpenExceptionOpens 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:
openin interfaceHttpRestServer- Parameters:
aProtocol- The protocol to use, e.g. "TLS".aStoreDescriptor- The store descriptor describing yourKeyStorerequired for HTTPS.aPort- The port on which to listen for requests.aMaxConnections- The number of maximum connections at the same time.- Throws:
org.refcodes.component.OpenException- thrown in case something went wrong such as the port being already in use.
-
openUnchecked
public void openUnchecked(org.refcodes.net.HttpServerContext aConnection)
- Specified by:
openUncheckedin interfaceorg.refcodes.component.ConnectionOpenable<B extends HttpRestServer>
-
setBaseLocator
public void setBaseLocator(java.lang.String aBaseLocator)
- Specified by:
setBaseLocatorin interfaceorg.refcodes.net.BaseLocatorAccessor.BaseLocatorMutator
-
setRealm
public void setRealm(java.lang.String aRealm)
- Specified by:
setRealmin interfaceorg.refcodes.net.RealmAccessor.RealmMutator
-
setRequestCorrelation
public void setRequestCorrelation(boolean hasRequestCorrelation)
- Specified by:
setRequestCorrelationin interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestServer>
-
setSessionCorrelation
public void setSessionCorrelation(boolean hasSessionCorrelation)
- Specified by:
setSessionCorrelationin interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestServer>
-
subscribeObserver
public boolean subscribeObserver(RestEndpoint aObserver)
- Specified by:
subscribeObserverin interfaceorg.refcodes.observer.Observable<B extends HttpRestServer>
-
toMediaTypeFactory
public org.refcodes.net.MediaTypeFactory toMediaTypeFactory(org.refcodes.net.MediaType aMediaType)
- Specified by:
toMediaTypeFactoryin interfaceorg.refcodes.net.MediaTypeFactoryLookup
-
unsubscribeObserver
public boolean unsubscribeObserver(RestEndpoint aObserver)
- Specified by:
unsubscribeObserverin interfaceorg.refcodes.observer.Observable<B extends HttpRestServer>
-
observers
public java.util.Iterator<RestEndpoint> observers()
- Specified by:
observersin interfaceorg.refcodes.observer.Observers<RestEndpoint,RestServer>
-
withBaseLocator
public B withBaseLocator(java.lang.String aBaseLocator)
- Specified by:
withBaseLocatorin interfaceorg.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B extends HttpRestServer>- Specified by:
withBaseLocatorin interfaceHttpRestServer- Specified by:
withBaseLocatorin interfaceRestServer
-
withClose
public B withClose() throws org.refcodes.component.CloseException
- Specified by:
withClosein interfaceorg.refcodes.component.Closable.CloseBuilder<B extends HttpRestServer>- Specified by:
withClosein interfaceHttpRestServer- Throws:
org.refcodes.component.CloseException
-
withCloseIn
public B withCloseIn(int aCloseInMillis)
- Specified by:
withCloseInin interfaceorg.refcodes.component.Closable.CloseBuilder<B extends HttpRestServer>- Specified by:
withCloseInin interfaceHttpRestServer
-
withCloseQuietly
public B withCloseQuietly()
- Specified by:
withCloseQuietlyin interfaceorg.refcodes.component.Closable.CloseBuilder<B extends HttpRestServer>- Specified by:
withCloseQuietlyin interfaceHttpRestServer
-
withCloseUnchecked
public B withCloseUnchecked()
- Specified by:
withCloseUncheckedin interfaceorg.refcodes.component.Closable.CloseBuilder<B extends HttpRestServer>
-
withDisableRequestCorrelation
public B withDisableRequestCorrelation()
- Specified by:
withDisableRequestCorrelationin interfaceHttpRestServer- Specified by:
withDisableRequestCorrelationin interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestServer>- Specified by:
withDisableRequestCorrelationin interfaceRestServer
-
withDisableSessionCorrelation
public B withDisableSessionCorrelation()
- Specified by:
withDisableSessionCorrelationin interfaceHttpRestServer- Specified by:
withDisableSessionCorrelationin interfaceRestServer- Specified by:
withDisableSessionCorrelationin interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestServer>
-
withEnableRequestCorrelation
public B withEnableRequestCorrelation()
- Specified by:
withEnableRequestCorrelationin interfaceHttpRestServer- Specified by:
withEnableRequestCorrelationin interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestServer>- Specified by:
withEnableRequestCorrelationin interfaceRestServer
-
withEnableSessionCorrelation
public B withEnableSessionCorrelation()
- Specified by:
withEnableSessionCorrelationin interfaceHttpRestServer- Specified by:
withEnableSessionCorrelationin interfaceRestServer- Specified by:
withEnableSessionCorrelationin interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestServer>
-
withOpen
public B withOpen(org.refcodes.net.HttpServerContext aConnection) throws org.refcodes.component.OpenException
- Specified by:
withOpenin interfaceorg.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<RestEndpoint,RestServer>- Specified by:
withOpenin interfaceHttpRestServer- Throws:
org.refcodes.component.OpenException
-
withOpenUnchecked
public B withOpenUnchecked(org.refcodes.net.HttpServerContext aConnection)
- Specified by:
withOpenUncheckedin interfaceorg.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<RestEndpoint,RestServer>
-
withRealm
public B withRealm(java.lang.String aRealm)
- Specified by:
withRealmin interfaceHttpRestServer- Specified by:
withRealmin interfaceorg.refcodes.net.RealmAccessor.RealmBuilder<B extends HttpRestServer>- Specified by:
withRealmin interfaceRestServer
-
withRequestCorrelation
public B withRequestCorrelation(boolean hasRequestCorrelation)
- Specified by:
withRequestCorrelationin interfaceHttpRestServer- Specified by:
withRequestCorrelationin interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestServer>- Specified by:
withRequestCorrelationin interfaceRestServer
-
withSessionCorrelation
public B withSessionCorrelation(boolean hasSessionCorrelation)
- Specified by:
withSessionCorrelationin interfaceHttpRestServer- Specified by:
withSessionCorrelationin interfaceRestServer- Specified by:
withSessionCorrelationin interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestServer>
-
getMaxConnections
public int getMaxConnections()
- Specified by:
getMaxConnectionsin interfaceorg.refcodes.io.MaxConnectionsAccessor
-
getKeyStoreDescriptor
public org.refcodes.security.KeyStoreDescriptor getKeyStoreDescriptor()
- Specified by:
getKeyStoreDescriptorin interfaceorg.refcodes.security.KeyStoreDescriptorAccessor
-
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
-
setProtocol
public void setProtocol(java.lang.String aProtocol)
- Specified by:
setProtocolin interfaceorg.refcodes.net.SchemeAccessor.SchemeMutator
-
toProtocol
public java.lang.String toProtocol()
- Specified by:
toProtocolin interfaceorg.refcodes.net.SchemeAccessor
-
-