2 * Copyright (c) 2018 Red Hat, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.aaa.web;
10 import javax.servlet.ServletException;
13 * Web server (HTTP). This service API allows ODL applications to register web
14 * components programmatically, instead of using a web.xml declaratively; see
15 * the {@link WebContext} for why this is preferable.
18 * This API has an OSGi-based as well as a "standalone" implementation suitable
21 * @author Michael Vorburger.ch
23 public interface WebServer {
26 * Register a new web context.
28 * @param webContext the web context
29 * @return registration which allows to close the context (and remove its servlets etc.)
30 * @throws ServletException if registration of any of the components of the web context failed
32 WebContextRegistration registerWebContext(WebContext webContext) throws ServletException;
35 * Base URL of this web server, without any contexts. In production, this would
36 * likely be HTTPS with a well known hostname and fixed port configured e.g. in
37 * a Karaf etc/ configuration file. In tests, this would be typically be HTTP on
38 * localhost and an arbitrarily chosen port.
40 * @return base URL, with http[s] prefix and port, NOT ending in slash