<?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>
  </filter>
  <filter-mapping>
    <filter-name>ChatAuthenticationFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <listener>
    <listener-class>org.exoplatform.chat.listener.MigrateServiceListener</listener-class>
  </listener>
  <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>JuzuServlet</servlet-name>
    <servlet-class>juzu.bridge.servlet.JuzuServlet</servlet-class>
    <init-param>
      <param-name>juzu.app_name</param-name>
      <param-value>org.exoplatform.chat.server</param-value>
    </init-param>
    <init-param>
      <param-name>juzu.inject</param-name>
      <param-value>guice</param-value>
    </init-param>
    <init-param>
      <param-name>juzu.resource_bundle</param-name>
      <param-value>locale.chat.server.Resource</param-value>
    </init-param>
  </servlet>
  <servlet>
    <servlet-name>AssetServlet</servlet-name>
    <servlet-class>juzu.impl.asset.AssetServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <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.transport.JSONPTransport,org.cometd.server.transport.JSONTransport,org.cometd.websocket.server.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-mapping>
    <servlet-name>JuzuServlet</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AssetServlet</servlet-name>
    <url-pattern>/assets/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>cometd</servlet-name>
    <url-pattern>/cometd/*</url-pattern>
  </servlet-mapping>
</web-app>
