<?xml version="1.0" encoding="ISO-8859-1" ?>
<web-app
        version="3.0"
        metadata-complete="true"
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

  <absolute-ordering />

  <filter>
    <filter-name>ChatAuthenticationFilter</filter-name>
    <filter-class>org.exoplatform.chat.filter.ChatAuthenticationFilter</filter-class>
    <async-supported>true</async-supported>
  </filter>
  <filter-mapping>
    <filter-name>ChatAuthenticationFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <listener>
    <listener-class>org.exoplatform.chat.listener.GuiceManager</listener-class>
  </listener>
  <listener>
    <listener-class>org.exoplatform.chat.listener.ConnectionManager</listener-class>
  </listener>
  <listener>
    <listener-class>org.exoplatform.chat.listener.SchedulerManager</listener-class>
  </listener>

  <servlet>
    <servlet-name>cometd</servlet-name>
    <servlet-class>org.exoplatform.chat.server.CometdConfigurationServlet</servlet-class>

    <init-param>
      <param-name>filters</param-name>
      <param-value>/WEB-INF/filters.json</param-value>
    </init-param>
    <init-param>
      <param-name>timeout</param-name>
      <param-value>120000</param-value>
    </init-param>
    <init-param>
      <param-name>maxMessageSize</param-name>
      <param-value>1048576</param-value>
    </init-param>
    <init-param>
      <param-name>maxSessionsPerBrowser</param-name>
      <param-value>-1</param-value>
    </init-param>
    <init-param>
      <param-name>interval</param-name>
      <param-value>0</param-value>
    </init-param>
    <init-param>
      <param-name>long-polling.multiSessionInterval</param-name>
      <param-value>1500</param-value>
    </init-param>
    <init-param>
      <param-name>ws.cometdURLMapping</param-name>
      <param-value>/cometd/*</param-value>
    </init-param>
    <init-param>
      <param-name>transports</param-name>
      <param-value>
        org.cometd.server.http.JSONPTransport,org.cometd.server.http.JSONTransport,org.cometd.server.websocket.javax.WebSocketTransport
      </param-value>
    </init-param>
    <init-param>
      <param-name>JSONCommented</param-name>
      <param-value>false</param-value>
    </init-param>
    <init-param>
      <param-name>alwaysResumePoll</param-name>
      <param-value>false</param-value> <!-- use true for x-site cometd -->
    </init-param>

    <init-param>
      <param-name>oort.url</param-name>
      <param-value></param-value>
    </init-param>
    <init-param>
      <param-name>oort.secret</param-name>
      <param-value>exo</param-value>
    </init-param>
    <init-param>
      <param-name>oort.cloud</param-name>
      <param-value></param-value>
    </init-param>
    <init-param>
      <param-name>oort.channels</param-name>
      <param-value>/*</param-value>
    </init-param>
    <init-param>
      <param-name>services</param-name>
      <param-value>org.exoplatform.chat.server.CometdService</param-value>
    </init-param>

    <load-on-startup>1</load-on-startup>
    <async-supported>true</async-supported>
  </servlet>

  <servlet>
    <servlet-name>ChatServer</servlet-name>
    <servlet-class>org.exoplatform.chat.server.ChatServer</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>cometd</servlet-name>
    <url-pattern>/cometd/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>ChatServer</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>
</web-app>
