Merge "docs: Update installation instructions"
[fuel.git] / mcp / salt-formulas / opendaylight / files / jetty.xml
1 {%- from "opendaylight/map.jinja" import server with context -%}
2 <?xml version="1.0"?>
3 <!--
4  Licensed to the Apache Software Foundation (ASF) under one
5  or more contributor license agreements.  See the NOTICE file
6  distributed with this work for additional information
7  regarding copyright ownership.  The ASF licenses this file
8  to you under the Apache License, Version 2.0 (the
9  "License"); you may not use this file except in compliance
10  with the License.  You may obtain a copy of the License at
11
12    http://www.apache.org/licenses/LICENSE-2.0
13
14  Unless required by applicable law or agreed to in writing,
15  software distributed under the License is distributed on an
16  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  KIND, either express or implied.  See the License for the
18  specific language governing permissions and limitations
19  under the License.
20 -->
21 <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//
22 DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
23
24 <Configure id="Server" class="org.eclipse.jetty.server.Server">
25
26     <!-- =========================================================== -->
27     <!-- Set connectors -->
28     <!-- =========================================================== -->
29     <!-- One of each type! -->
30     <!-- =========================================================== -->
31
32     <!-- Use this connector for many frequently idle connections and for
33         threadless continuations. -->
34     <New id="http-default" class="org.eclipse.jetty.server.HttpConfiguration">
35         <Set name="secureScheme">https</Set>
36         <Set name="securePort">
37             <Property name="jetty.secure.port" default="8543" />
38         </Set>
39         <Set name="outputBufferSize">32768</Set>
40         <Set name="requestHeaderSize">8192</Set>
41         <Set name="responseHeaderSize">8192</Set>
42
43         <!-- Default security setting: do not leak our version -->
44         <Set name="sendServerVersion">false</Set>
45
46         <Set name="sendDateHeader">false</Set>
47         <Set name="headerCacheSize">512</Set>
48     </New>
49
50     <New id="http-legacy" class="org.eclipse.jetty.server.HttpConfiguration">
51         <Set name="secureScheme">https</Set>
52         <Set name="securePort">
53             <Property name="jetty.secure.port" default="8443" />
54         </Set>
55         <Set name="outputBufferSize">32768</Set>
56         <Set name="requestHeaderSize">8192</Set>
57         <Set name="responseHeaderSize">8192</Set>
58
59         <!-- Default security setting: do not leak our version -->
60         <Set name="sendServerVersion">false</Set>
61
62         <Set name="sendDateHeader">false</Set>
63         <Set name="headerCacheSize">512</Set>
64     </New>
65
66     <Call name="addConnector">
67         <Arg>
68             <New class="org.eclipse.jetty.server.ServerConnector">
69                 <Arg name="server">
70                     <Ref refid="Server" />
71                 </Arg>
72                 <Arg name="factories">
73                     <Array type="org.eclipse.jetty.server.ConnectionFactory">
74                         <Item>
75                             <New class="org.eclipse.jetty.server.HttpConnectionFactory">
76                                 <Arg name="config">
77                                     <Ref refid="http-default"/>
78                                 </Arg>
79                             </New>
80                         </Item>
81                     </Array>
82                 </Arg>
83                 <Set name="host">{{ server.odl_bind_ip }}
84                     <Property name="jetty.host"/>
85                 </Set>
86                 <Set name="port">
87                     <Property name="jetty.port" default="8181"/>
88                 </Set>
89                 <Set name="idleTimeout">
90                     <Property name="http.timeout" default="300000"/>
91                 </Set>
92                 <Set name="name">jetty-default</Set>
93             </New>
94         </Arg>
95     </Call>
96
97     <Call name="addConnector">
98         <Arg>
99             <New class="org.eclipse.jetty.server.ServerConnector">
100                 <Arg name="server">
101                     <Ref refid="Server" />
102                 </Arg>
103                 <Arg name="factories">
104                     <Array type="org.eclipse.jetty.server.ConnectionFactory">
105                         <Item>
106                             <New class="org.eclipse.jetty.server.HttpConnectionFactory">
107                                 <Arg name="config">
108                                     <Ref refid="http-legacy" />
109                                 </Arg>
110                             </New>
111                         </Item>
112                     </Array>
113                 </Arg>
114                 <Set name="host">{{ server.odl_bind_ip }}
115                     <Property name="jetty.host"/>
116                 </Set>
117                 <Set name="port">
118                     <Property name="jetty.port" default="{{ server.odl_rest_port }}"/>
119                 </Set>
120                 <Set name="idleTimeout">
121                     <Property name="http.timeout" default="300000"/>
122                 </Set>q
123                 <Set name="name">jetty-legacy</Set>
124             </New>
125         </Arg>
126     </Call>
127
128     <!-- =========================================================== -->
129     <!-- Configure Authentication Realms -->
130     <!-- Realms may be configured for the entire server here, or -->
131     <!-- they can be configured for a specific web app in a context -->
132     <!-- configuration (see $(jetty.home)/contexts/test.xml for an -->
133     <!-- example). -->
134     <!-- =========================================================== -->
135     <Call name="addBean">
136         <Arg>
137             <New class="org.eclipse.jetty.jaas.JAASLoginService">
138                 <Set name="name">karaf</Set>
139                 <Set name="loginModuleName">karaf</Set>
140                 <Set name="roleClassNames">
141                     <Array type="java.lang.String">
142                         <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal
143                         </Item>
144                     </Array>
145                 </Set>
146             </New>
147         </Arg>
148     </Call>
149     <Call name="addBean">
150         <Arg>
151             <New class="org.eclipse.jetty.jaas.JAASLoginService">
152                 <Set name="name">default</Set>
153                 <Set name="loginModuleName">karaf</Set>
154                 <Set name="roleClassNames">
155                     <Array type="java.lang.String">
156                         <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal
157                         </Item>
158                     </Array>
159                 </Set>
160             </New>
161         </Arg>
162     </Call>
163 </Configure>