2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.common.endpoints.http.server;
23 import java.util.List;
24 import java.util.Properties;
27 * Factory of HTTP Servlet-Enabled Servlets
29 public interface HttpServletServerFactory {
32 * builds an http server with support for servlets
35 * @param host binding host
37 * @param contextPath server base path
38 * @param swagger enable swagger documentation
39 * @param managed is it managed by infrastructure
41 * @throws IllegalArgumentException when invalid parameters are provided
43 public HttpServletServer build(String name, String host, int port, String contextPath, boolean swagger,
47 * list of http servers per properties
49 * @param properties properties based configuration
50 * @return list of http servers
51 * @throws IllegalArgumentException when invalid parameters are provided
53 public List<HttpServletServer> build(Properties properties);
56 * gets a server based on the port
61 public HttpServletServer get(int port);
64 * provides an inventory of servers
66 * @return inventory of servers
68 public List<HttpServletServer> inventory();
71 * destroys server bound to a port
75 public void destroy(int port);
78 * destroys the factory and therefore all servers
80 public void destroy();