Describe semantics for database for virtual target
[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. If a database is given for a target (following a slash), that
42    database name is used as Z39.50 database for this target. If the
43    database is omitted for the target, the original (virtual) database
44    is used as Z39.50 database.
45   </para>
46   <para>
47    If multiple targets are given that has special meaning depending on the
48    filter following virt_db. If the following filter is load_balance, then
49    the load_balance filter will load balance between the targets given
50    (assuming they serve same content). If the following filter is multi,
51    then results will be merged from all targets instead.
52   </para>
53   <para>
54    The z3950_filter, on the other hand, does not support multiple targets.
55   </para>
56   <para>
57    For <literal>&lt;virtual&gt;</literal> a route may be given as
58    an attribute. This will make Metaproxy route traffic to the route
59    given. Note that virtual databases may not be combined if all
60    databases do not result in the same routing.
61   </para>
62  </refsect1>
63  
64  <refsect1><title>EXAMPLES</title>
65   <para>
66    Consider this virt_db configuration:
67    <screen><![CDATA[
68     <filter type="virt_db">
69       <virtual>
70         <database>db1</database>
71         <target>localhost:9999/Default</target>
72       </virtual>
73       <virtual>
74         <database>db2</database>
75         <target>indexdata.com/gils</target>
76       </virtual>
77       <virtual>
78         <database>combined</database>
79         <target>indexdata.com/gils</target>
80         <target>localhost:9999/Default</target>
81       </virtual>
82       <virtual route="special">
83         <database>db3</database>
84         <target>indexdata.com/special</target>
85       </virtual>
86       <virtual>
87         <database>*</database><!-- default -->
88         <target>localhost:9999</target><-- database not altered -->
89       </virtual>
90     </filter>
91 ]]>
92    </screen>
93    This will offer 4 databases, <literal>db1</literal>, 
94    <literal>db2</literal>, <literal>combined</literal> and
95    <literal>db3</literal>. If a Z39.50 specifies <literal>db1</literal>
96    and <literal>db2</literal> that will have same effect as specifying
97    the single database <literal>combined</literal>.
98   </para>
99   <para>
100    Since <literal>db3</literal> routes differently from the other databases,
101    this database may not be combined with the others.
102   </para>
103  </refsect1> 
104  
105  <refsect1><title>SEE ALSO</title>
106   <para>
107    <citerefentry>
108     <refentrytitle>metaproxy</refentrytitle>
109     <manvolnum>1</manvolnum>
110    </citerefentry>
111   </para>
112   <para>
113    <citerefentry>
114     <refentrytitle>multi</refentrytitle>
115     <manvolnum>3mp</manvolnum>
116    </citerefentry>
117    <citerefentry>
118     <refentrytitle>load_balance</refentrytitle>
119     <manvolnum>3mp</manvolnum>
120    </citerefentry>
121   </para>
122  </refsect1>
123  
124  &copyright;
125 </refentry>
126
127 <!-- Keep this comment at the end of the file
128 Local variables:
129 mode: sgml
130 sgml-omittag:t
131 sgml-shorttag:t
132 sgml-minimize-attributes:nil
133 sgml-always-quote-attributes:t
134 sgml-indent-step:1
135 sgml-indent-data:t
136 sgml-parent-document:nil
137 sgml-local-catalogs: nil
138 sgml-namecase-general:t
139 End:
140 -->