1 | /************************************************************
|
---|
2 | *
|
---|
3 | * Collection set
|
---|
4 | *
|
---|
5 | ************************************************************/
|
---|
6 |
|
---|
7 | #ifndef COLLECTSET_H
|
---|
8 | #define COLLECTSET_H
|
---|
9 |
|
---|
10 | #include "collectserver.h"
|
---|
11 | #include "cnfgable.h"
|
---|
12 | #include "mgsearch.h"
|
---|
13 | #include "mgppsearch.h"
|
---|
14 | #include "lucenesearch.h"
|
---|
15 |
|
---|
16 | class collectset : public configurable
|
---|
17 | {
|
---|
18 | protected:
|
---|
19 | collectservermapclass cservers;
|
---|
20 | mgsearchclass *mgsearch;
|
---|
21 | mgppsearchclass *mgppsearch;
|
---|
22 | lucenesearchclass *lucenesearch;
|
---|
23 | int noofservers;
|
---|
24 | text_t httpdomain;
|
---|
25 | text_t httpprefix;
|
---|
26 |
|
---|
27 | public:
|
---|
28 | collectset(text_t &gsdlhome);
|
---|
29 | // this constructor is used by the local library
|
---|
30 | collectset() {}
|
---|
31 |
|
---|
32 | ~collectset();
|
---|
33 |
|
---|
34 | // initialise the collections
|
---|
35 | bool init(ostream &logout);
|
---|
36 |
|
---|
37 | // configure all the servers as supplied
|
---|
38 | void configure (const text_t &key, const text_tarray &cfgline);
|
---|
39 |
|
---|
40 | // Add/remove collections
|
---|
41 | void add_all_collections (const text_t &gsdlhome);
|
---|
42 | void remove_all_collections ();
|
---|
43 |
|
---|
44 | void remove_collection (const text_t &collection);
|
---|
45 | void remove_collection (const text_t &collection, ostream& logout);
|
---|
46 |
|
---|
47 | void add_collection (const text_t &collection,
|
---|
48 | const text_t &gsdlhome);
|
---|
49 |
|
---|
50 | void add_collection_group(const text_t& collection,
|
---|
51 | const text_t& gsdlhome);
|
---|
52 | void add_all_collection_groups (const text_t& gsdlhome);
|
---|
53 |
|
---|
54 | // return the total number of servers in the set
|
---|
55 | int size();
|
---|
56 |
|
---|
57 | void getCollectionList(text_tarray &collist);
|
---|
58 |
|
---|
59 | // return the component map
|
---|
60 | collectservermapclass servers();
|
---|
61 |
|
---|
62 | // return an individual collection server
|
---|
63 | collectserver *getCollectServer(const text_t &collection)
|
---|
64 | {
|
---|
65 | return cservers.getcollectserver(collection);
|
---|
66 | }
|
---|
67 | };
|
---|
68 |
|
---|
69 | #endif
|
---|