public class HttpServer extends Object
If you need to change the server's configuration, override the
configureConnector(ServerConnector, int)
method in a derived class.
Modifier and Type | Class and Description |
---|---|
static class |
HttpServer.Builder<T>
Builder class for creating instances of
HttpServer . |
Constructor and Description |
---|
HttpServer(AvaticaHandler handler)
Constructs an
HttpServer which binds to an ephemeral port. |
HttpServer(org.eclipse.jetty.server.Handler handler)
Deprecated.
|
HttpServer(int port,
AvaticaHandler handler)
Constructs an
HttpServer with no additional configuration. |
HttpServer(int port,
AvaticaHandler handler,
AvaticaServerConfiguration config)
Constructs an
HttpServer . |
HttpServer(int port,
AvaticaHandler handler,
AvaticaServerConfiguration config,
Subject subject)
Constructs an
HttpServer . |
HttpServer(int port,
AvaticaHandler handler,
AvaticaServerConfiguration config,
Subject subject,
org.eclipse.jetty.util.ssl.SslContextFactory.Server sslFactory)
Constructs an
HttpServer . |
HttpServer(int port,
AvaticaHandler handler,
AvaticaServerConfiguration config,
Subject subject,
org.eclipse.jetty.util.ssl.SslContextFactory.Server sslFactory,
int maxAllowedHeaderSize)
Constructs an
HttpServer . |
HttpServer(int port,
org.eclipse.jetty.server.Handler handler)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected 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 the
connector given the config for using SPNEGO. |
protected AvaticaServerConfiguration |
getConfig() |
int |
getPort() |
protected org.eclipse.jetty.server.ServerConnector |
getServerConnector() |
protected void |
internalStart() |
void |
join() |
void |
start() |
void |
stop() |
@Deprecated public HttpServer(org.eclipse.jetty.server.Handler handler)
public HttpServer(AvaticaHandler handler)
HttpServer
which binds to an ephemeral port.handler
- The Handler to run@Deprecated public HttpServer(int port, org.eclipse.jetty.server.Handler handler)
public HttpServer(int port, AvaticaHandler handler)
HttpServer
with no additional configuration.port
- The listen porthandler
- The Handler to runpublic HttpServer(int port, AvaticaHandler handler, AvaticaServerConfiguration config)
HttpServer
.port
- The listen porthandler
- The Handler to runconfig
- Optional configuration for the serverpublic HttpServer(int port, AvaticaHandler handler, AvaticaServerConfiguration config, Subject subject)
HttpServer
.port
- The listen porthandler
- The Handler to runconfig
- Optional configuration for the serversubject
- The javax.security Subject for the server, or nullpublic HttpServer(int port, AvaticaHandler handler, AvaticaServerConfiguration config, Subject subject, org.eclipse.jetty.util.ssl.SslContextFactory.Server sslFactory)
HttpServer
.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 nullpublic HttpServer(int port, AvaticaHandler handler, AvaticaServerConfiguration config, Subject subject, org.eclipse.jetty.util.ssl.SslContextFactory.Server sslFactory, int maxAllowedHeaderSize)
HttpServer
.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 headerpublic void start()
protected void internalStart()
protected org.eclipse.jetty.server.ServerConnector getServerConnector()
protected org.eclipse.jetty.security.ConstraintSecurityHandler configureSpnego(org.eclipse.jetty.server.Server server, AvaticaServerConfiguration config)
connector
given the config
for using SPNEGO.config
- The configurationprotected org.eclipse.jetty.security.ConstraintSecurityHandler configureBasicAuthentication(org.eclipse.jetty.server.Server server, AvaticaServerConfiguration config)
protected org.eclipse.jetty.security.ConstraintSecurityHandler configureDigestAuthentication(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)
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.
connector
- connector to be configuredport
- port number handed over in constructorprotected AvaticaServerConfiguration getConfig()
public void stop()
public void join() throws InterruptedException
InterruptedException
public int getPort()
Copyright © 2012-2024 Apache Software Foundation. All Rights Reserved.