Deliver recordSchema in response
[yazpp-moved-to-github.git] / include / yaz++ / ir-assoc.h
1 /*
2  * Copyright (c) 1998-2000, Index Data.
3  * See the file LICENSE for details.
4  * 
5  * $Id: ir-assoc.h,v 1.3 2003-12-16 14:17:01 adam Exp $
6  */
7
8 #include <yaz++/z-assoc.h>
9 #include <yaz++/z-query.h>
10
11 /** Information Retrieval Assocation.
12     This object implements the client - and server role of a generic
13     Z39.50 Association.
14 */
15 class YAZ_EXPORT Yaz_IR_Assoc: public Yaz_Z_Assoc {
16  public:
17     /// Create object using the PDU Observer specified
18     Yaz_IR_Assoc(IYaz_PDU_Observable *the_PDU_Observable);
19     /// Destroy assocation and close PDU Observer
20     virtual ~Yaz_IR_Assoc();
21     /// Receive Z39.50 PDU
22     void recv_Z_PDU(Z_APDU *apdu, int len);
23     void recv_GDU(Z_GDU *apdu, int len);
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     /// Settings
49     void set_proxy(const char *str);
50     const char *get_proxy();
51     const char *get_host();
52
53     void set_cookie(const char *str);
54     const char *get_cookie();
55
56     /// Send Services
57     int send_initRequest(char* pRefId=NULL);
58     int send_searchRequest(Yaz_Z_Query *query, char* pResultSetId = NULL, char* pRefId = NULL);
59     int send_presentRequest(int start, int number, char* pResultSetId = NULL, char* pRefId = NULL);
60     int send_deleteResultSetRequest(char* pResultSetId = 0, char* pRefId = 0);
61     
62     /// Recv Services
63     virtual void recv_initRequest(Z_InitRequest *initRequest);
64     virtual void recv_initResponse(Z_InitResponse *initResponse);
65     virtual void recv_searchRequest(Z_SearchRequest *searchRequest);
66     virtual void recv_presentRequest(Z_PresentRequest *presentRequest);
67     virtual void recv_searchResponse(Z_SearchResponse *searchResponse);
68     virtual void recv_presentResponse(Z_PresentResponse *presentResponse);
69     virtual void recv_extendedServicesResponse(Z_ExtendedServicesResponse *extendedServicesResponse);
70  private:
71     char *m_proxy;
72     char *m_host;
73     char *m_cookie;
74     int m_num_databaseNames;
75     char **m_databaseNames;
76     int m_preferredRecordSyntax;
77     Z_ElementSetNames *m_elementSetNames;
78     int m_lastReceived;
79     int m_log;
80 };