Class HttpServer
java.lang.Object
org.apache.calcite.avatica.server.HttpServer
Avatica HTTP server.
If you need to change the server's configuration, override the
configureConnector(ServerConnector, int)
method in a derived class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder class for creating instances ofHttpServer
. -
Constructor Summary
ConstructorsConstructorDescriptionHttpServer
(int port, AvaticaHandler handler) Constructs anHttpServer
with no additional configuration.HttpServer
(int port, AvaticaHandler handler, AvaticaServerConfiguration config) Constructs anHttpServer
.HttpServer
(int port, AvaticaHandler handler, AvaticaServerConfiguration config, Subject subject) Constructs anHttpServer
.HttpServer
(int port, AvaticaHandler handler, AvaticaServerConfiguration config, Subject subject, org.eclipse.jetty.util.ssl.SslContextFactory.Server sslFactory) Constructs anHttpServer
.HttpServer
(int port, AvaticaHandler handler, AvaticaServerConfiguration config, Subject subject, org.eclipse.jetty.util.ssl.SslContextFactory.Server sslFactory, int maxAllowedHeaderSize) Constructs anHttpServer
.HttpServer
(int port, org.eclipse.jetty.server.Handler handler) Deprecated.HttpServer
(AvaticaHandler handler) Constructs anHttpServer
which binds to an ephemeral port.HttpServer
(org.eclipse.jetty.server.Handler handler) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.eclipse.jetty.security.ConstraintSecurityHandler
configureBasicAuthentication
(org.eclipse.jetty.server.Server server, AvaticaServerConfiguration config) protected org.eclipse.jetty.security.ConstraintSecurityHandler
configureCommonAuthentication
(String constraintName, String[] allowedRoles, org.eclipse.jetty.security.Authenticator authenticator, String realm, org.eclipse.jetty.security.LoginService loginService) protected org.eclipse.jetty.server.ServerConnector
configureConnector
(org.eclipse.jetty.server.ServerConnector connector, int port) Configures the server connector.protected org.eclipse.jetty.security.ConstraintSecurityHandler
configureDigestAuthentication
(org.eclipse.jetty.server.Server server, AvaticaServerConfiguration config) protected org.eclipse.jetty.security.ConstraintSecurityHandler
configureSpnego
(org.eclipse.jetty.server.Server server, AvaticaServerConfiguration config) Configures theconnector
given theconfig
for using SPNEGO.protected AvaticaServerConfiguration
int
getPort()
protected org.eclipse.jetty.server.ServerConnector
protected void
void
join()
void
start()
void
stop()
-
Constructor Details
-
HttpServer
Deprecated. -
HttpServer
Constructs anHttpServer
which binds to an ephemeral port.- Parameters:
handler
- The Handler to run
-
HttpServer
Deprecated. -
HttpServer
Constructs anHttpServer
with no additional configuration.- Parameters:
port
- The listen porthandler
- The Handler to run
-
HttpServer
Constructs anHttpServer
.- Parameters:
port
- The listen porthandler
- The Handler to runconfig
- Optional configuration for the server
-
HttpServer
public HttpServer(int port, AvaticaHandler handler, AvaticaServerConfiguration config, Subject subject) Constructs anHttpServer
.- Parameters:
port
- The listen porthandler
- The Handler to runconfig
- Optional configuration for the serversubject
- The javax.security Subject for the server, or null
-
HttpServer
public HttpServer(int port, AvaticaHandler handler, AvaticaServerConfiguration config, Subject subject, org.eclipse.jetty.util.ssl.SslContextFactory.Server sslFactory) Constructs anHttpServer
.- Parameters:
port
- The listen porthandler
- The Handler to runconfig
- Optional configuration for the serversubject
- The javax.security Subject for the server, or nullsslFactory
- A configured SslContextFactory.Server, or null
-
HttpServer
public HttpServer(int port, AvaticaHandler handler, AvaticaServerConfiguration config, Subject subject, org.eclipse.jetty.util.ssl.SslContextFactory.Server sslFactory, int maxAllowedHeaderSize) Constructs anHttpServer
.- Parameters:
port
- The listen porthandler
- The Handler to runconfig
- Optional configuration for the serversubject
- The javax.security Subject for the server, or nullsslFactory
- A configured SslContextFactory.Server, or nullmaxAllowedHeaderSize
- A maximum size in bytes that are allowed in an HTTP header
-
-
Method Details
-
start
public void start() -
internalStart
protected void internalStart() -
getServerConnector
protected org.eclipse.jetty.server.ServerConnector getServerConnector() -
configureSpnego
protected org.eclipse.jetty.security.ConstraintSecurityHandler configureSpnego(org.eclipse.jetty.server.Server server, AvaticaServerConfiguration config) Configures theconnector
given theconfig
for using SPNEGO.- Parameters:
config
- The configuration
-
configureBasicAuthentication
protected org.eclipse.jetty.security.ConstraintSecurityHandler configureBasicAuthentication(org.eclipse.jetty.server.Server server, AvaticaServerConfiguration config) -
configureDigestAuthentication
protected org.eclipse.jetty.security.ConstraintSecurityHandler configureDigestAuthentication(org.eclipse.jetty.server.Server server, AvaticaServerConfiguration config) -
configureCommonAuthentication
-
configureConnector
protected org.eclipse.jetty.server.ServerConnector configureConnector(org.eclipse.jetty.server.ServerConnector connector, int port) Configures the server connector.The default configuration sets a timeout of 1 minute and disables TCP linger time.
To change the configuration, override this method in a derived class. The overriding method must call its super method.
- Parameters:
connector
- connector to be configuredport
- port number handed over in constructor
-
getConfig
-
stop
public void stop() -
join
- Throws:
InterruptedException
-
getPort
public int getPort()
-