Interface HttpRestServer

    • 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.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
      • Nested classes/interfaces inherited from interface org.refcodes.net.RealmAccessor

        org.refcodes.net.RealmAccessor.RealmBuilder<B extends org.refcodes.net.RealmAccessor.RealmBuilder<B>>, org.refcodes.net.RealmAccessor.RealmMutator, org.refcodes.net.RealmAccessor.RealmProperty
      • Nested classes/interfaces inherited from interface org.refcodes.net.SchemeAccessor

        org.refcodes.net.SchemeAccessor.SchemeBuilder<B extends org.refcodes.net.SchemeAccessor.SchemeBuilder<B>>, org.refcodes.net.SchemeAccessor.SchemeMutator, org.refcodes.net.SchemeAccessor.SchemeProperty
    • Method Detail

      • withRealm

        default HttpRestServer withRealm​(java.lang.String aRealm)
        Specified by:
        withRealm in interface org.refcodes.net.RealmAccessor.RealmBuilder<RestServer>
        Specified by:
        withRealm in interface RestServer
      • withBaseLocator

        default HttpRestServer withBaseLocator​(java.lang.String aBaseLocator)
        Specified by:
        withBaseLocator in interface org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
        Specified by:
        withBaseLocator in interface RestServer
      • withClose

        default HttpRestServer withClose​()
                                  throws org.refcodes.component.CloseException
        Specified by:
        withClose in interface org.refcodes.component.Closable.CloseBuilder<RestServer>
        Throws:
        org.refcodes.component.CloseException
      • withCloseQuietly

        default HttpRestServer withCloseQuietly​()
        Specified by:
        withCloseQuietly in interface org.refcodes.component.Closable.CloseBuilder<RestServer>
      • withCloseIn

        default HttpRestServer withCloseIn​(int aCloseInMillis)
        Specified by:
        withCloseIn in interface org.refcodes.component.Closable.CloseBuilder<RestServer>
      • withOpen

        default HttpRestServer withOpen​(org.refcodes.net.HttpServerContext aConnection)
                                 throws org.refcodes.component.OpenException
        Specified by:
        withOpen in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<RestEndpoint,RestServer>
        Throws:
        org.refcodes.component.OpenException
      • withOpen

        default HttpRestServer withOpen​(int aPort)
                                 throws org.refcodes.component.OpenException
        Builder method for opening the HttpRestServer. Delegates to open(int) and returns this method.
        Parameters:
        aPort - The port on which to listen for requests.
        Returns:
        This instance for applying method chaining.
        Throws:
        org.refcodes.component.OpenException - thrown in case something went wrong such as the port being already in use.
      • withPort

        default HttpRestServer withPort​(int aPort)
        Specified by:
        withPort in interface org.refcodes.mixin.PortAccessor.PortBuilder<HttpRestServer>
      • withScheme

        default HttpRestServer withScheme​(org.refcodes.data.Scheme aScheme)
        Specified by:
        withScheme in interface org.refcodes.net.SchemeAccessor.SchemeBuilder<HttpRestServer>
      • withProtocol

        default HttpRestServer withProtocol​(java.lang.String aProtocol)
        Specified by:
        withProtocol in interface org.refcodes.net.SchemeAccessor.SchemeBuilder<HttpRestServer>
      • withKeyStoreDescriptor

        default HttpRestServer withKeyStoreDescriptor​(org.refcodes.security.KeyStoreDescriptor aStoreDescriptor)
        Specified by:
        withKeyStoreDescriptor in interface org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorBuilder<HttpRestServer>
      • withMaxConnections

        default HttpRestServer withMaxConnections​(int aMaxConnections)
        Specified by:
        withMaxConnections in interface org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsBuilder<HttpRestServer>
      • open

        default void open​()
                   throws org.refcodes.component.OpenException
        Specified by:
        open in interface org.refcodes.component.Openable
        Throws:
        org.refcodes.component.OpenException
      • open

        default void open​(int aPort)
                   throws org.refcodes.component.OpenException
        Opens the HTTP sever connection (socket) at the given port
        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

        default void open​(int aPort,
                          int aMaxConnections)
                   throws org.refcodes.component.OpenException
        Opens the HTTP sever connection (socket) at the given port allowing the given number of maximum connections at the same time.
        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

        default void open​(java.lang.String aProtocol,
                          org.refcodes.security.KeyStoreDescriptor aStoreDescriptor,
                          int aPort)
                   throws org.refcodes.component.OpenException
        Same as open(String, KeyStoreDescriptor, int, int) but:
        • The number of maximum connections at the same time is decided upon by the implementations's default value.
        Parameters:
        aProtocol - The protocol to use, e.g. "TLS".
        aStoreDescriptor - The store descriptor describing your KeyStore required 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

        default void open​(java.lang.String aProtocol,
                          org.refcodes.security.KeyStoreDescriptor aStoreDescriptor)
                   throws org.refcodes.component.OpenException
        Same as open(String, KeyStoreDescriptor, int) but:
        • The number of maximum connections at the same time is decided upon by the implementations's default value.
        Parameters:
        aProtocol - The protocol to use, e.g. "TLS".
        aStoreDescriptor - The store descriptor describing your KeyStore required for HTTPS.
        Throws:
        org.refcodes.component.OpenException - thrown in case something went wrong such as the port being already in use.
      • open

        default void open​(org.refcodes.security.KeyStoreDescriptor aStoreDescriptor,
                          int aPort,
                          int aMaxConnections)
                   throws org.refcodes.component.OpenException
        Same as open(String, KeyStoreDescriptor, int, int) but:
        • The protocol for the underlying SSLContext used is set to "TLS".
        • The type of KeyStore is set to "JKS".
        • The password for the KeyStore's key is assumed to be the same as the provided KeyStore password.
        Parameters:
        aStoreDescriptor - The store descriptor describing your KeyStore required 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.
      • open

        default void open​(org.refcodes.security.KeyStoreDescriptor aStoreDescriptor,
                          int aPort)
                   throws org.refcodes.component.OpenException
        Same as open(String, KeyStoreDescriptor, int, int) but:
        • The protocol for the underlying SSLContext used is set to "TLS".
        • The type of KeyStore is set to "JKS".
        Parameters:
        aStoreDescriptor - The store descriptor describing your KeyStore required 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

        default void open​(org.refcodes.security.KeyStoreDescriptor aStoreDescriptor)
                   throws org.refcodes.component.OpenException
        Same as open(String, KeyStoreDescriptor, int) but:
        • The protocol for the underlying SSLContext used is set to "TLS".
        • The type of KeyStore is set to "JKS".
        Parameters:
        aStoreDescriptor - The store descriptor describing your KeyStore required for HTTPS.
        Throws:
        org.refcodes.component.OpenException - thrown in case something went wrong such as the port being already in use.
      • open

        default void open​(org.refcodes.data.Scheme aScheme,
                          org.refcodes.security.KeyStoreDescriptor aStoreDescriptor,
                          int aPort,
                          int aMaxConnections)
                   throws org.refcodes.component.OpenException
        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.
        Parameters:
        aScheme - The Scheme to use, e.g. Scheme.HTTPS defaults to "TLS".
        aStoreDescriptor - The store descriptor describing your KeyStore required 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.
      • open

        default void open​(org.refcodes.data.Scheme aScheme,
                          org.refcodes.security.KeyStoreDescriptor aStoreDescriptor,
                          int aPort)
                   throws org.refcodes.component.OpenException
        Same as open(String, KeyStoreDescriptor, int, int) but:
        • The number of maximum connections at the same time is decided upon by the implementations's default value.
        Parameters:
        aScheme - The Scheme to use, e.g. Scheme.HTTPS defaults to "TLS".
        aStoreDescriptor - The store descriptor describing your KeyStore required 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

        default void open​(org.refcodes.data.Scheme aScheme,
                          org.refcodes.security.KeyStoreDescriptor aStoreDescriptor)
                   throws org.refcodes.component.OpenException
        Same as open(String, KeyStoreDescriptor, int) but:
        • The number of maximum connections at the same time is decided upon by the implementations's default value.
        Parameters:
        aScheme - The Scheme to use, e.g. Scheme.HTTPS defaults to "TLS".
        aStoreDescriptor - The store descriptor describing your KeyStore required for HTTPS.
        Throws:
        org.refcodes.component.OpenException - thrown in case something went wrong such as the port being already in use.
      • open

        void open​(java.lang.String aProtocol,
                  org.refcodes.security.KeyStoreDescriptor aStoreDescriptor,
                  int aPort,
                  int aMaxConnections)
           throws org.refcodes.component.OpenException
        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.
        Parameters:
        aProtocol - The protocol to use, e.g. "TLS".
        aStoreDescriptor - The store descriptor describing your KeyStore required 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.
      • open

        default void open​(org.refcodes.net.HttpServerContext aConnection)
                   throws org.refcodes.component.OpenException
        Specified by:
        open in interface org.refcodes.component.ConnectionOpenable<RestServer>
        Throws:
        org.refcodes.component.OpenException