source: branches/z3950-branch/gsdl/src/recpt/z3950proto.h@ 1168

Last change on this file since 1168 was 1168, checked in by johnmcp, 24 years ago

added proper config file parsing for z39.50 servers, and minor changes
to pageaction (minor bug when display collections from >1 proto) and
cgiwrapper (announces which collections are z39.50 servers).

  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1
2#ifndef Z3950PROTO_H
3#define Z3050PROTO_H
4
5#include "recptproto.h"
6
7// each "server" (ie collection) consists of a {z39.50 server + database} pair.
8class z3950_server {
9 protected:
10 text_t title; // Descriptive name
11 text_t hostname; // network name (IP or host+domain name)
12 text_tmap meta; // metadata for this collection (ie server/database pair)
13 // this is currently only iconcollection (and iconcollectionsmall)
14 int count;
15 // z3950_DB_array* db;
16 ShortColInfo_t *info; // has (database) name, host and port
17
18 public:
19 z3950_server();
20 const text_t getName() {return title;}
21 void setMeta(const text_t &key, const text_t &value);
22 void setName(const text_t &newname);
23 void setInfo(ShortColInfo_t *newinfo) {info=newinfo;}
24 const ShortColInfo_t *getInfo() {return info;}
25 const text_tmap *getMeta() {return &meta;}
26};
27
28typedef vector<z3950_server> z3950_server_array;
29
30
31
32
33class z3950proto : public recptproto {
34protected:
35 int zserver_count;
36 z3950_server_array zservers;
37public:
38 z3950proto();
39 virtual ~z3950proto() {}
40
41 int getServerCount() { return zserver_count;}
42 /*
43 void add_collectserver (collectserver *thecserver)
44 {cservers.addcollectserver(thecserver);}
45 */
46
47 void add_server(const z3950_server& zserver);
48
49 void read_config_file(const text_t &filename);
50
51 void configure (const text_t &key, const text_tarray &cfgline);
52
53 bool init (ostream &logout);
54
55 text_t get_protocol_name () {return "z3950proto";}
56
57 void get_collection_list (text_tarray &collist, comerror_t &err,
58 ostream &logout);
59
60 void has_collection (const text_t &collection, bool &hascollection,
61 comerror_t &err, ostream &logout);
62
63 void ping (const text_t &collection, bool &wassuccess,
64 comerror_t &err, ostream &logout);
65
66 void get_collectinfo (const text_t &collection,
67 ColInfoResponse_t &collectinfo,
68 comerror_t &err, ostream &logout);
69
70 void get_filterinfo (const text_t &collection,
71 InfoFiltersResponse_t &response,
72 comerror_t &err, ostream &logout);
73
74 /* void get_info (const text_t &collection, const text_tset &metadata,
75 FilterResponse_t &response, ostream &logout);
76 */
77
78 void filter (const text_t &collection,
79 FilterRequest_t &request,
80 FilterResponse_t &response,
81 comerror_t &err, ostream &logout);
82
83 void get_document (const text_t &collection,
84 const DocumentRequest_t &request,
85 DocumentResponse_t &response,
86 comerror_t &err, ostream &logout);
87
88};
89
90
91#endif
Note: See TracBrowser for help on using the repository browser.