in server/src/main/java/org/apache/calcite/avatica/server/HttpServer.java [824:864]
public HttpServer build() {
switch (authenticationType) {
case NONE:
serverConfig = null;
subject = null;
handler = buildHandler(this, serverConfig);
break;
case BASIC:
case DIGEST:
// Build the configuration for BASIC or DIGEST authentication.
serverConfig = buildUserAuthenticationConfiguration(this);
subject = null;
handler = buildHandler(this, serverConfig);
break;
case SPNEGO:
LOG.debug("Not performing Kerberos login, Jetty does this now");
subject = null;
serverConfig = buildSpnegoConfiguration(this);
handler = buildHandler(this, serverConfig);
break;
case CUSTOM:
// We don't need to build any Config here since
// serverConfig is already assigned the required AvaticaServerConfiguration
serverConfig = buildCustomConfiguration(this);
subject = null;
break;
default:
throw new IllegalArgumentException("Unhandled AuthenticationType");
}
SslContextFactory.Server sslFactory = buildSSLContextFactory();
List<ServerCustomizer<Server>> jettyCustomizers = new ArrayList<>();
for (ServerCustomizer<?> customizer : this.serverCustomizers) {
// Type checked in withServerCustomizers
jettyCustomizers.add((ServerCustomizer<Server>) customizer);
}
return new HttpServer(port, handler, serverConfig, subject, sslFactory, jettyCustomizers,
maxAllowedHeaderSize);
}