2 <!-- imagined config for yp2..
3 The router system understands yp2, sequence and filter elements.
4 Everything else interpreted by filters.
5 Each filter is invoked in a sequence (unless a filter invokes another
6 sequence.. A start sequence must be determined somehow.
8 <yp2 xmlns="http://indexdata.dk/yp2/config/1">
9 <start route="id_hytg"/>
11 <filter id="front_default" type="frontend-net">
12 <!-- the Z39.50/HTTP frontend -->
15 <filter id="log_out" type="log"> <!-- apply logging always -->
16 <logfile>out.log</logfile>
18 <filter id="log_cerr" type="log"> <!-- apply logging always -->
19 <logfile>std::cerr</logfile>
25 <filter refid="log_cout"/>
26 <filter type="cond"> <!-- conditional -->
27 <if test="port=210 and db=public" route="A"/>
28 <if test="port=210 and db=other" route="B"/>
30 <case test="blabla" route="C"/>
31 <case test="blabla2" route="C2"/>
35 <filter refid="log_out"/>
36 <filter refid="log_cerr"/>
37 <filter type="log"> <!-- apply logging always -->
38 <logfile>mylog.log</logfile>
40 <filter name="reject"> <!-- reject .. -->
42 <filter type="bounce"/>
45 <filter type="z3950-client">
46 <target>localhost:9999/A</target>
48 <filter type="bounce"/>
51 <filter type="z3950-client">
52 <target>localhost:9999/B</target>
54 <filter type="bounce"/>
57 <xml:include href="file://module2.xml#filter45"/>
58 <xml:include href="file://module4.xml#filter145"/>
59 <filter type="bounce"/>
65 <merge type="simple"/>
67 <filter type="bounce"/>
73 db returns Z39.50 database(s)
75 HTTP-header Any HTTP header (including content-type)
76 request-type Init,Search,HTTP,...
81 mother object filter-dom-hash
82 deletes pointers to contexts and filters on program exit
83 hash filter-type -> hash-filter-id -> Context
84 -> filter-binary-pointer
86 moher object router pointer hash
88 created in mother thread, read only structures.
90 Context* filter.configure(dom );
96 where each filter can have is own context class
98 yp2::filter::Log::Context : public Context
101 Filters are constructed with a FilterFactory class which exposes a
104 Filter* createFilter(std::string type)
106 .. which returns a filter
107 instance. (The interface pointer that is). The FilterFactory may later
109 loadModule(std::string filename);
111 loadModules(std::string filenamemask);
117 <!-- observation: the logic could be controlled by a XSLT! -->