blob: 2fa696af67c0e098fbf7bfd6d85160b7efc1c5bd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.container.http.xml;
import com.yahoo.config.model.builder.xml.XmlHelper;
import com.yahoo.config.model.producer.AbstractConfigProducer;
import com.yahoo.text.XML;
import com.yahoo.vespa.model.builder.xml.dom.VespaDomBuilder;
import com.yahoo.vespa.model.container.http.ConnectorFactory;
import org.w3c.dom.Element;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
* @since 5.21.0
*/
public class JettyConnectorBuilder extends VespaDomBuilder.DomConfigProducerBuilder<ConnectorFactory> {
private static final Logger log = Logger.getLogger(JettyConnectorBuilder.class.getName());
@Override
protected ConnectorFactory doBuild(AbstractConfigProducer ancestor, Element serverSpec) {
String name = XmlHelper.getIdString(serverSpec);
int port = HttpBuilder.readPort(serverSpec, ancestor.getRoot().getDeployState());
Element legacyServerConfig = XML.getChild(serverSpec, "config");
if (legacyServerConfig != null) {
String configName = legacyServerConfig.getAttribute("name");
if (configName.equals("container.jdisc.config.http-server")) {
ancestor.deployLogger().log(Level.WARNING, "The config 'container.jdisc.config.http-server' is deprecated and will be removed in a later version of Vespa."
+ " Please use 'jdisc.http.connector' instead, see https://github.com/pages/vespa-engine/documentation/documentation/jdisc/http-server-and-filters.html#configuring-jetty-server");
} else {
legacyServerConfig = null;
}
}
return new ConnectorFactory(name, port, legacyServerConfig);
}
}
|