Use Odr_oid for OIDs. Require YAZ 3.0.2.
[yazpp-moved-to-github.git] / include / yazpp / ir-assoc.h
1 /*
2  * Copyright (c) 1998-2005, Index Data.
3  * See the file LICENSE for details.
4  * 
5  * $Id: ir-assoc.h,v 1.2 2007-04-12 15:00:33 adam Exp $
6  */
7
8 #include <yazpp/z-assoc.h>
9 #include <yazpp/z-query.h>
10
11 namespace yazpp_1 {
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 IR_Assoc: public Z_Assoc {
17  public:
18     /// Create object using the PDU Observer specified
19     IR_Assoc(IPDU_Observable *the_PDU_Observable);
20     /// Destroy assocation and close PDU Observer
21     virtual ~IR_Assoc();
22     /// Receive Z39.50 PDU
23     void recv_Z_PDU(Z_APDU *apdu, int len);
24     void recv_GDU(Z_GDU *apdu, int len);
25     /// Set Database Names
26     void set_databaseNames (int num, const char **list);
27     void set_databaseNames(const char *dblist, const char *sep);
28     /// Get Database Names
29     void get_databaseNames (int *num, char ***list);
30
31     void client(const char *addr);
32
33     /// Set Preferred Record Syntax
34     void set_preferredRecordSyntax (int value);
35     void set_preferredRecordSyntax (const char *syntax);
36     /// Get Preferred Record Syntax
37     void get_preferredRecordSyntax (int *val);
38     void get_preferredRecordSyntax (const char **syntax);
39
40     /// Set ElementSetName
41     void set_elementSetName (const char *elementSetName);
42     /// Get ElementSetName
43     void get_elementSetName (const char **elementSetName);
44     void get_elementSetName (Z_ElementSetNames **elementSetNames);
45
46     int get_lastReceived();
47     void set_lastReceived(int lastReceived);
48
49     /// Settings
50     void set_proxy(const char *str);
51     const char *get_proxy();
52     const char *get_host();
53
54     void set_cookie(const char *str);
55     const char *get_cookie();
56
57     /// Send Services
58     int send_initRequest(char* pRefId=NULL);
59     int send_searchRequest(Yaz_Z_Query *query, char* pResultSetId = NULL, char* pRefId = NULL);
60     int send_presentRequest(int start, int number, char* pResultSetId = NULL, char* pRefId = NULL);
61     int send_deleteResultSetRequest(char* pResultSetId = 0, char* pRefId = 0);
62     
63     /// Recv Services
64     virtual void recv_initRequest(Z_InitRequest *initRequest);
65     virtual void recv_initResponse(Z_InitResponse *initResponse);
66     virtual void recv_searchRequest(Z_SearchRequest *searchRequest);
67     virtual void recv_presentRequest(Z_PresentRequest *presentRequest);
68     virtual void recv_searchResponse(Z_SearchResponse *searchResponse);
69     virtual void recv_presentResponse(Z_PresentResponse *presentResponse);
70     virtual void recv_extendedServicesResponse(Z_ExtendedServicesResponse *extendedServicesResponse);
71  private:
72     char *m_proxy;
73     char *m_host;
74     char *m_cookie;
75     int m_num_databaseNames;
76     char **m_databaseNames;
77     char *m_preferredRecordSyntax;
78     Z_ElementSetNames *m_elementSetNames;
79     int m_lastReceived;
80     int m_log;
81 };
82 };
83 /*
84  * Local variables:
85  * c-basic-offset: 4
86  * indent-tabs-mode: nil
87  * End:
88  * vim: shiftwidth=4 tabstop=8 expandtab
89  */
90