Chapter 18. XML Configuration File Description

Artur Hefczyc <artur.hefczyc@tigase.net> v2.0, June 2014: Reformatted for AsciiDoc. :toc: :numbered: :website: http://tigase.net :Date: 2010-04-06 21:18

If you look inside configuration file you can see that this is just normal XML file with a few top-level separate sections. These sections are called components.

This is it. Tigase server consists of components and without components there is no application at all. This is why the only configuration settings you can find there are only under some component level.

More precisely top level element in this XML file is called: &lt;tigase-config/&gt; and it doesn’t contain any top level configuration settings.

Under the top level element there are at least 2 or more &lt;component/&gt; elements. Each component can be distinguished from others by it’s 'name'. That is, 'name' attribute is mandatory and must be distinct within configuration file. It is just component ID. Each component can be named any way you like it doesn’t need to mean anything. It is just easier to manage configuration if you select sensible names.

&lt;component/&gt; elements keep configuration settings for server modules.

Example 1:

<tigase-config>
  <component name="basic-conf">
    .... settings
  </component>
  <component name="message-router">
    .... settings
  </component>
</tigase-config>

Configuration settings are kept in "simple" maps like structures (key, values, type) triplets.

Configuration settings are stored in &lt;map/&gt; element which contains list of &lt;entry/&gt; elements. If there are multiple values for a parameter they are stored as a list of &lt;item&gt; elements.

Example 2:

<map>
   <entry value="localhost" type="String" key="remote-host"/>
   <entry value="false" type="Boolean" key="demo-mode"/>
   <entry value="1000" type="Integer" key="max-queue-size"/>
   <entry type="String[]" key="hostnames">
      <item value="test-a"/>
      <item value="localhost"/>
   </entry>
   <entry type="int[]" key="ports">
      <item value="5222"/>
      <item value="5223"/>
   </entry>
</map>

Configuration settings can be organised hierarchically using &lt;node&gt; elements:

Example 3:

<component name="c2s">
  <map>
    <entry type="String[]" key="hostnames">
      <item value="test-d"/>
      <item value="localhost"/>
    </entry>
  </map>
  <node name="connections">
    <map>
      <entry type="int[]" key="ports">
         <item value="5222"/>
         <item value="5223"/>
      </entry>
    </map>
    <node name="5222">
      <map>
         <entry value="localhost" type="String" key="remote-host"/>
         <entry value="plain" type="String" key="socket"/>
         <entry value="accept" type="String" key="type"/>
      </map>
    </node>
  </node>
</component>

Detailed description for all possible settings is split to per-component chapter. Please look for particular component description for details.