Moved header files to include/yaz++. Switched to libtool and automake.
[yazpp-moved-to-github.git] / include / yaz++ / yaz-ir-assoc.h
1 /*
2  * Copyright (c) 1998-2000, Index Data.
3  * See the file LICENSE for details.
4  * 
5  * $Id: yaz-ir-assoc.h,v 1.1 2000-10-11 11:58:16 adam Exp $
6  */
7
8 #include <yaz++/yaz-z-assoc.h>
9 #include <yaz++/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);
23     /// Set Database Names
24     void set_databaseNames (int num, const char **list);
25     void set_databaseNames(const char *dblist, const char *sep);
26     /// Get Database Names
27     void get_databaseNames (int *num, char ***list);
28
29     void client(const char *addr);
30
31     /// Set Preferred Record Syntax
32     void set_preferredRecordSyntax (int value);
33     void set_preferredRecordSyntax (const char *syntax);
34     /// Get Preferred Record Syntax
35     void get_preferredRecordSyntax (int *val);
36     void get_preferredRecordSyntax (const char **syntax);
37
38     /// Set ElementSetName
39     void set_elementSetName (const char *elementSetName);
40     /// Get ElementSetName
41     void get_elementSetName (const char **elementSetName);
42     void get_elementSetName (Z_ElementSetNames **elementSetNames);
43
44     int get_lastReceived();
45     void set_lastReceived(int lastReceived);
46
47     /// Settings
48     void set_proxy(const char *str);
49     const char *get_proxy();
50     const char *get_host();
51
52     void set_cookie(const char *str);
53     const char *get_cookie();
54
55     /// Send Services
56     int send_initRequest(char* pRefId=NULL);
57     int send_searchRequest(Yaz_Z_Query *query, char* pResultSetId = NULL, char* pRefId = NULL);
58     int send_presentRequest(int start, int number, char* pResultSetId = NULL, char* pRefId = NULL);
59     int send_deleteResultSetRequest(char* pResultSetId = 0, char* pRefId = 0);
60     
61     /// Recv Services
62     virtual void recv_initRequest(Z_InitRequest *initRequest);
63     virtual void recv_initResponse(Z_InitResponse *initResponse);
64     virtual void recv_searchRequest(Z_SearchRequest *searchRequest);
65     virtual void recv_presentRequest(Z_PresentRequest *presentRequest);
66     virtual void recv_searchResponse(Z_SearchResponse *searchResponse);
67     virtual void recv_presentResponse(Z_PresentResponse *presentResponse);
68  private:
69     char *m_proxy;
70     char *m_host;
71     char *m_cookie;
72     int m_num_databaseNames;
73     char **m_databaseNames;
74     int m_preferredRecordSyntax;
75     Z_ElementSetNames *m_elementSetNames;
76     int m_lastReceived;
77     int m_log;
78 };