365f684c35e3deffb3cf3fee57d4f64b67b4e63d
[metaproxy-moved-to-github.git] / doc / virt_db.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
2     "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3  <!ENTITY copyright SYSTEM "copyright.xml">
4  <!ENTITY % idcommon SYSTEM "common/common.ent">
5      %idcommon;
6 ]>
7 <refentry id="ref-virt_db">
8  <refentryinfo>
9   <productname>Metaproxy</productname>
10   <info><orgname>Index Data</orgname></info>
11  </refentryinfo>
12
13  <refmeta>
14   <refentrytitle>virt_db</refentrytitle>
15   <manvolnum>3mp</manvolnum>
16   <refmiscinfo class="manual">Metaproxy Module</refmiscinfo>
17  </refmeta>
18
19  <refnamediv>
20   <refname>virt_db</refname>
21   <refpurpose>Metaproxy Virtual Databases Module</refpurpose>
22  </refnamediv>
23
24  <refsect1><title>DESCRIPTION</title>
25   <para>
26    This filter allows one Z39.50 database to be me mapped to
27    another target; or even multiple targets.
28   </para>
29   <para>
30    The configuration of virt_db consists of zero or more
31    <literal>&lt;virtual&gt;</literal> elements each describing the
32    Z39.50 virtual database recognized.
33    The name of the database is the text content of the
34    <literal>&lt;database&gt;</literal> element which should be
35    first element inside the virtual section.
36   </para>
37   <para>
38    For Metaproxy 1.0.20 and later, the database is treated as a glob pattern.
39    This allows operators * (any number of any character) and
40    ? (any single character). The virtual sections are inspected in
41    the order given. The first matching virtual database is used.
42   </para>
43   <para>
44    Following that is one or more <literal>&lt;target&gt;</literal>
45    elements with the identifier of each target that the virtual database
46    maps to. If a database is given for a target (following a slash), that
47    database name is used as Z39.50 database for this target. If the
48    database is omitted for the target, the original (virtual) database
49    is used as Z39.50 database.
50   </para>
51   <para>
52    If multiple targets are given that has special meaning depending on the
53    filter following virt_db. If the following filter is load_balance, then
54    the load_balance filter will load balance between the targets given
55    (assuming they serve same content). If the following filter is multi,
56    then results will be merged from all targets instead.
57   </para>
58   <para>
59    The z3950_filter, on the other hand, does not support multiple targets.
60   </para>
61   <para>
62    For <literal>&lt;virtual&gt;</literal> a route may be given as
63    an attribute. This will make Metaproxy route traffic to the route
64    given. Note that virtual databases may not be combined if all
65    databases do not result in the same routing.
66   </para>
67  </refsect1>
68
69  <refsect1><title>SCHEMA</title>
70    <literallayout><xi:include
71                      xi:href="../xml/schema/filter_virt_db.rnc" xi:parse="text"
72                      xmlns:xi="http://www.w3.org/2001/XInclude" />
73    </literallayout>
74  </refsect1>
75
76  <refsect1><title>EXAMPLES</title>
77   <para>
78    Consider this virt_db configuration:
79    <screen><![CDATA[
80     <filter type="virt_db">
81       <virtual>
82         <database>db1</database>
83         <target>localhost:9999/Default</target>
84       </virtual>
85       <virtual>
86         <database>db2</database>
87         <target>indexdata.com/gils</target>
88       </virtual>
89       <virtual>
90         <database>combined</database>
91         <target>indexdata.com/gils</target>
92         <target>localhost:9999/Default</target>
93       </virtual>
94       <virtual route="special">
95         <database>db3</database>
96         <target>indexdata.com/special</target>
97       </virtual>
98       <virtual>
99         <database>*</database><!-- default -->
100         <target>localhost:9999</target><-- database not altered -->
101       </virtual>
102     </filter>
103 ]]>
104    </screen>
105    This will offer 4 databases, <literal>db1</literal>,
106    <literal>db2</literal>, <literal>combined</literal> and
107    <literal>db3</literal>. If a Z39.50 specifies <literal>db1</literal>
108    and <literal>db2</literal> that will have same effect as specifying
109    the single database <literal>combined</literal>.
110   </para>
111   <para>
112    Since <literal>db3</literal> routes differently from the other databases,
113    this database may not be combined with the others.
114   </para>
115  </refsect1>
116
117  <refsect1><title>SEE ALSO</title>
118   <para>
119    <citerefentry>
120     <refentrytitle>metaproxy</refentrytitle>
121     <manvolnum>1</manvolnum>
122    </citerefentry>
123   </para>
124   <para>
125    <citerefentry>
126     <refentrytitle>multi</refentrytitle>
127     <manvolnum>3mp</manvolnum>
128    </citerefentry>
129    <citerefentry>
130     <refentrytitle>load_balance</refentrytitle>
131     <manvolnum>3mp</manvolnum>
132    </citerefentry>
133   </para>
134  </refsect1>
135
136  &copyright;
137 </refentry>
138
139 <!-- Keep this comment at the end of the file
140 Local variables:
141 mode: nxml
142 nxml-child-indent: 1
143 End:
144 -->