use of org.apereo.cas.configuration.model.core.web.tomcat.CasEmbeddedApacheTomcatAjpProperties in project cas by apereo.
the class CasEmbeddedContainerTomcatConfiguration method configureAjp.
private void configureAjp(final TomcatEmbeddedServletContainerFactory tomcat) {
final CasEmbeddedApacheTomcatAjpProperties ajp = casProperties.getServer().getAjp();
if (ajp.isEnabled() && ajp.getPort() > 0) {
LOGGER.debug("Creating AJP configuration for the embedded tomcat container...");
final Connector ajpConnector = new Connector(ajp.getProtocol());
ajpConnector.setProtocol(ajp.getProtocol());
ajpConnector.setPort(ajp.getPort());
ajpConnector.setSecure(ajp.isSecure());
ajpConnector.setAllowTrace(ajp.isAllowTrace());
ajpConnector.setScheme(ajp.getScheme());
ajpConnector.setAsyncTimeout(Beans.newDuration(ajp.getAsyncTimeout()).toMillis());
ajpConnector.setEnableLookups(ajp.isEnableLookups());
ajpConnector.setMaxPostSize(ajp.getMaxPostSize());
ajpConnector.addUpgradeProtocol(new Http2Protocol());
if (ajp.getProxyPort() > 0) {
LOGGER.debug("Set AJP proxy port to [{}]", ajp.getProxyPort());
ajpConnector.setProxyPort(ajp.getProxyPort());
}
if (ajp.getRedirectPort() > 0) {
LOGGER.debug("Set AJP redirect port to [{}]", ajp.getRedirectPort());
ajpConnector.setRedirectPort(ajp.getRedirectPort());
}
ajp.getAttributes().forEach(ajpConnector::setAttribute);
tomcat.addAdditionalTomcatConnectors(ajpConnector);
}
}
Aggregations