All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cisco.oss.foundation.http.server.HttpServerFactory Maven / Gradle / Ivy

Go to download

This project is the http server api library in the cisco vss foundation runtime

There is a newer version: 1.4.0-3
Show newest version
/*
 * Copyright 2015 Cisco Systems, Inc.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package com.cisco.oss.foundation.http.server;

import com.google.common.collect.ListMultimap;

import javax.servlet.Filter;
import javax.servlet.Servlet;
import java.util.EventListener;
import java.util.List;
import java.util.Map;

/**
 * Created by Yair Ogen on 2/5/14.
 * a common factory for creating nre Servers
 */
public interface HttpServerFactory {

    static final String X_FORWARD_FOR_HEADER = "x-forwarded-for";
    static final String FLOW_CONTEXT_HEADER_UPPER = "FLOW_CONTEXT";
    static final String FLOW_CONTEXT_HEADER_LOWER = "flow_context";

    /**
     * start a new http server
     *
     * @param serviceName - the http logical service name
     * @param servlets    - a mapping between servlet path and servlet instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}.
     *                    
Example of usage: * {@code ArrayListMultimap servletMap = ArrayListMultimap.create()} */ void startHttpServer(String serviceName, ListMultimap servlets); /** * start a new http server * * @param serviceName - the http logical service name * @param servlets - a mapping between servlet path and servlet instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap servletMap = ArrayListMultimap.create()} * @param eventListeners event listeners to be applied on this server */ void startHttpServer(String serviceName, ListMultimap servlets, List eventListeners) ; /** * start a new http server * * @param serviceName - the http logical service name * @param servlets - a mapping between servlet path and servlet instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap servletMap = ArrayListMultimap.create()} * @param filters - a mapping between filter path and filter instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap filterMap = ArrayListMultimap.create()} */ void startHttpServer(String serviceName, ListMultimap servlets, ListMultimap filters); /** * start a new http server * * @param serviceName - the http logical service name * @param servlets - a mapping between servlet path and servlet instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap servletMap = ArrayListMultimap.create()} * @param filters - a mapping between filter path and filter instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap filterMap = ArrayListMultimap.create()} * @param eventListeners event listeners to be applied on this server */ void startHttpServer(String serviceName, ListMultimap servlets, ListMultimap filters, List eventListeners); /** * start a new http server * * @param serviceName - the http logical service name * @param servlets - a mapping between servlet path and servlet instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap servletMap = ArrayListMultimap.create()} * @param filters - a mapping between filter path and filter instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap filterMap = ArrayListMultimap.create()} * @param keyStorePath - a path to the keystore file * @param keyStorePassword - the keystore password */ void startHttpServer(String serviceName, ListMultimap servlets, ListMultimap filters, String keyStorePath, String keyStorePassword); /** * start a new http server * * @param serviceName - the http logical service name * @param servlets - a mapping between servlet path and servlet instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap servletMap = ArrayListMultimap.create()} * @param keyStorePath - a path to the keystore file * @param keyStorePassword - the keystore password */ void startHttpServer(String serviceName, ListMultimap servlets, String keyStorePath, String keyStorePassword); /** * start a new http server * * @param serviceName - the http logical service name * @param servlets - a mapping between servlet path and servlet instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap servletMap = ArrayListMultimap.create()} * @param keyStorePath - a path to the keystore file * @param keyStorePassword - the keystore password * @param trustStorePath - the trust store file path * @param trustStorePassword - the trust store password */ void startHttpServer(String serviceName, ListMultimap servlets, String keyStorePath, String keyStorePassword, String trustStorePath, String trustStorePassword); /** * start a new http server * * @param serviceName - the http logical service name * @param servlets - a mapping between servlet path and servlet instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap servletMap = ArrayListMultimap.create()} * @param filters - a mapping between filter path and filter instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap filterMap = ArrayListMultimap.create()} * @param keyStorePath - a path to the keystore file * @param keyStorePassword - the keystore password * @param trustStorePath - the trust store file path * @param trustStorePassword - the trust store password */ void startHttpServer(String serviceName, ListMultimap servlets, ListMultimap filters, String keyStorePath, String keyStorePassword, String trustStorePath, String trustStorePassword); /** * start a new http server * * @param serviceName - the http logical service name * @param servlets - a mapping between servlet path and servlet instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap servletMap = ArrayListMultimap.create()} * @param filters - a mapping between filter path and filter instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap filterMap = ArrayListMultimap.create()} * @param eventListeners event listeners to be applied on this server * @param keyStorePath - a path to the keystore file * @param keyStorePassword - the keystore password * @param trustStorePath - the trust store file path * @param trustStorePassword - the trust store password */ void startHttpServer(String serviceName, ListMultimap servlets, ListMultimap filters, List eventListeners, String keyStorePath, String keyStorePassword, String trustStorePath, String trustStorePassword); /** * /** * start a new http server * * @param serviceName - the http logical service name * @param servlets - a mapping between servlet path and servlet instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap servletMap = ArrayListMultimap.create()} * @param initParams - a map containing potential init parameters for the servlets */ void startHttpServer(String serviceName, ListMultimap servlets, Map initParams); /** * start a new http server * * @param serviceName - the http logical service name * @param servlets - a mapping between servlet path and servlet instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap servletMap = ArrayListMultimap.create()} * @param filterMap - a mapping between filter path and filter instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap filterMap = ArrayListMultimap.create()} * @param eventListeners event listeners to be applied on this server * @param initParams - a map containing potential init parameters for the servlets */ void startHttpServer(String serviceName, ListMultimap servlets, ListMultimap filterMap, List eventListeners, Map initParams); /** * start a new http server * * @param serviceName - the http logical service name * @param servlets - a mapping between servlet path and servlet instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap servletMap = ArrayListMultimap.create()} * @param filters - a mapping between filter path and filter instance. This mapping uses the google collections {@link com.google.common.collect.ListMultimap}. *
Example of usage: * {@code ArrayListMultimap filterMap = ArrayListMultimap.create()} * @param eventListeners event listeners to be applied on this server * @param initParams - a map containing potential init parameters for the servlets * @param keyStorePath - a path to the keystore file * @param keyStorePassword - the keystore password * @param trustStorePath - the trust store file path * @param trustStorePassword - the trust store password */ void startHttpServer(String serviceName, ListMultimap servlets, ListMultimap filters, List eventListeners, Map initParams, String keyStorePath, String keyStorePassword, String trustStorePath, String trustStorePassword); /** * stop a running server * @param serviceName */ void stopHttpServer(String serviceName); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy