<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you 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.
  -->

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
    <display-name>Apache Atlas</display-name>
    <description>Metadata Management and Data Governance Platform over Hadoop</description>

    <servlet>
        <servlet-name>jersey-servlet</servlet-name>
        <servlet-class>
            com.sun.jersey.spi.spring.container.servlet.SpringServlet
        </servlet-class>
        <init-param>
            <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
            <param-value>true</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
         <servlet-name>LoginServlet</servlet-name>
         <servlet-class>org.apache.atlas.web.servlets.AtlasLoginServlet</servlet-class>
    </servlet>

    <servlet-mapping>
         <servlet-name>LoginServlet</servlet-name>
         <url-pattern>/login.jsp</url-pattern>
    </servlet-mapping>

    <servlet>
         <servlet-name>ErrorServlet</servlet-name>
         <servlet-class>org.apache.atlas.web.servlets.AtlasErrorServlet</servlet-class>
    </servlet>

    <servlet-mapping>
         <servlet-name>ErrorServlet</servlet-name>
         <url-pattern>/error.jsp</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>jersey-servlet</servlet-name>
        <url-pattern>/api/atlas/*</url-pattern>
    </servlet-mapping>

    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter>
        <filter-name>AuditFilter</filter-name>
        <filter-class>org.apache.atlas.web.filters.AuditFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>AuditFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter>
        <filter-name>HeaderFilter</filter-name>
        <filter-class>org.apache.atlas.web.filters.AtlasHeaderFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>HeaderFilter</filter-name>
        <url-pattern>/api/atlas/admin/metrics</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>HeaderFilter</filter-name>
        <url-pattern>/api/atlas/admin/status</url-pattern>
    </filter-mapping>

    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>

    <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>

    <listener>
        <listener-class>org.apache.atlas.web.setup.KerberosAwareListener</listener-class>
    </listener>


    <session-config>
        <session-timeout>60</session-timeout>
        <tracking-mode>COOKIE</tracking-mode>
        <cookie-config>
            <name>ATLASSESSIONID</name>
            <http-only>true</http-only>
        </cookie-config>
    </session-config>

    <error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/error.jsp</location>
    </error-page>
    <error-page>
        <error-code>404</error-code>
        <location>/error.jsp</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/error.jsp</location>
    </error-page>

</web-app>
