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