1 /* This file is part of the yazpp toolkit.
2 * Copyright (C) 1998-2012 Index Data and Mike Taylor
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of Index Data nor the names of its contributors
13 * may be used to endorse or promote products derived from this
14 * software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #include <yazpp/z-assoc.h>
29 #include <yazpp/z-query.h>
32 /** Information Retrieval Assocation.
33 This object implements the client - and server role of a generic
36 class YAZ_EXPORT IR_Assoc: public Z_Assoc {
38 /// Create object using the PDU Observer specified
39 IR_Assoc(IPDU_Observable *the_PDU_Observable);
40 /// Destroy assocation and close PDU Observer
42 /// Receive Z39.50 PDU
43 void recv_Z_PDU(Z_APDU *apdu, int len);
44 void recv_GDU(Z_GDU *apdu, int len);
45 /// Set Database Names
46 void set_databaseNames (int num, const char **list);
47 void set_databaseNames(const char *dblist, const char *sep);
48 /// Get Database Names
49 void get_databaseNames (int *num, char ***list);
51 void client(const char *addr);
53 /// Set Preferred Record Syntax
54 void set_preferredRecordSyntax (int value);
55 void set_preferredRecordSyntax (const char *syntax);
56 /// Get Preferred Record Syntax
57 void get_preferredRecordSyntax (int *val);
58 void get_preferredRecordSyntax (const char **syntax);
60 /// Set ElementSetName
61 void set_elementSetName (const char *elementSetName);
62 /// Get ElementSetName
63 void get_elementSetName (const char **elementSetName);
64 void get_elementSetName (Z_ElementSetNames **elementSetNames);
66 int get_lastReceived();
67 void set_lastReceived(int lastReceived);
70 void set_proxy(const char *str);
71 const char *get_proxy();
72 const char *get_host();
74 void set_cookie(const char *str);
75 const char *get_cookie();
78 int send_initRequest(char* pRefId=NULL);
79 int send_searchRequest(Yaz_Z_Query *query, char* pResultSetId = NULL, char* pRefId = NULL);
80 int send_presentRequest(Odr_int start, Odr_int number, char* pResultSetId = NULL, char* pRefId = NULL);
81 int send_deleteResultSetRequest(char* pResultSetId = 0, char* pRefId = 0);
84 virtual void recv_initRequest(Z_InitRequest *initRequest);
85 virtual void recv_initResponse(Z_InitResponse *initResponse);
86 virtual void recv_searchRequest(Z_SearchRequest *searchRequest);
87 virtual void recv_presentRequest(Z_PresentRequest *presentRequest);
88 virtual void recv_searchResponse(Z_SearchResponse *searchResponse);
89 virtual void recv_presentResponse(Z_PresentResponse *presentResponse);
90 virtual void recv_extendedServicesResponse(Z_ExtendedServicesResponse *extendedServicesResponse);
95 int m_num_databaseNames;
96 char **m_databaseNames;
97 char *m_preferredRecordSyntax;
98 Z_ElementSetNames *m_elementSetNames;
106 * c-file-style: "Stroustrup"
107 * indent-tabs-mode: nil
109 * vim: shiftwidth=4 tabstop=8 expandtab