Implemented various stuff for client and proxy. Updated calls
[yazpp-moved-to-github.git] / include / yaz-ir-assoc.h
1 /*
2  * Copyright (c) 1998-1999, Index Data.
3  * See the file LICENSE for details.
4  * Sebastian Hammer, Adam Dickmeiss
5  * 
6  * $Id: yaz-ir-assoc.h,v 1.6 1999-04-20 10:30:05 adam Exp $
7  */
8
9 #include <yaz-z-assoc.h>
10 #include <yaz-z-query.h>
11
12 /** Information Retrieval Assocation.
13     This object implements the client - and server role of a generic
14     Z39.50 Association.
15 */
16 class YAZ_EXPORT Yaz_IR_Assoc: public Yaz_Z_Assoc {
17  public:
18     /// Create object using the PDU Observer specified
19     Yaz_IR_Assoc(IYaz_PDU_Observable *the_PDU_Observable);
20     /// Destroy assocation and close PDU Observer
21     virtual ~Yaz_IR_Assoc();
22     /// Receive Z39.50 PDU
23     void recv_Z_PDU(Z_APDU *apdu);
24     /// Set Database Names
25     void set_databaseNames (int num, const char **list);
26     void set_databaseNames(const char *dblist, const char *sep);
27     /// Get Database Names
28     void get_databaseNames (int *num, char ***list);
29
30     void client(const char *addr);
31
32     /// Set Preferred Record Syntax
33     void set_preferredRecordSyntax (int value);
34     void set_preferredRecordSyntax (const char *syntax);
35     /// Get Preferred Record Syntax
36     void get_preferredRecordSyntax (int *val);
37     void get_preferredRecordSyntax (const char **syntax);
38
39     /// Set ElementSetName
40     void set_elementSetName (const char *elementSetName);
41     /// Get ElementSetName
42     void get_elementSetName (const char **elementSetName);
43     void get_elementSetName (Z_ElementSetNames **elementSetNames);
44
45     int get_lastReceived();
46     void set_lastReceived(int lastReceived);
47
48     /// OtherInformation
49     void set_otherInformationString (Z_OtherInformation **otherInformationP,
50                                      int *oid, int categoryValue,
51                                      const char *str);
52     void set_otherInformationString (
53         Z_OtherInformation **otherInformation,
54         int oidval, int categoryValue,
55         const char *str);
56     /// Settings
57     void set_proxy(const char *str);
58     const char *get_proxy();
59     const char *get_host();
60
61     void set_cookie(const char *str);
62     const char *get_cookie();
63
64     /// Send Services
65     int send_initRequest();
66     int send_searchRequest(Yaz_Z_Query *query);
67     int send_presentRequest(int start, int number);
68     /// Recv Services
69     virtual void recv_initRequest(Z_InitRequest *initRequest);
70     virtual void recv_initResponse(Z_InitResponse *initResponse);
71     virtual void recv_searchRequest(Z_SearchRequest *searchRequest);
72     virtual void recv_presentRequest(Z_PresentRequest *presentRequest);
73     virtual void recv_searchResponse(Z_SearchResponse *searchResponse);
74     virtual void recv_presentResponse(Z_PresentResponse *presentResponse);
75  private:
76     char *m_proxy;
77     char *m_host;
78     char *m_cookie;
79     int m_num_databaseNames;
80     char **m_databaseNames;
81     int m_preferredRecordSyntax;
82     Z_ElementSetNames *m_elementSetNames;
83     int m_lastReceived;
84 };