if ( ( httpServerBean == null ) || httpServerBean.isDisabled() )
{
return null;
}
HttpServer httpServer = new HttpServer();
// HttpConfFile
httpServer.setConfFile( httpServerBean.getHttpConfFile() );
// The transports
TransportBean[] transports = httpServerBean.getTransports();
for ( TransportBean transportBean : transports )
{
if ( transportBean.isDisabled() )
{
continue;
}
if ( transportBean instanceof TcpTransportBean )
{
TcpTransport transport = new TcpTransport( transportBean.getSystemPort() );
transport.setAddress( transportBean.getTransportAddress() );
if ( transportBean.getTransportId().equalsIgnoreCase( HttpServer.HTTP_TRANSPORT_ID ) )
{
httpServer.setHttpTransport( transport );
}
else if ( transportBean.getTransportId().equalsIgnoreCase( HttpServer.HTTPS_TRANSPORT_ID ) )
{
httpServer.setHttpsTransport( transport );
}
else
{
LOG.warn( "Transport ids of HttpServer should be either 'http' or 'https'" );
}
}
}
// The webApps
httpServer.setWebApps( createHttpWebApps( httpServerBean.getHttpWebApps(), directoryService ) );
return httpServer;
}