2 * Copyright (c) 1998-1999, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
6 * $Id: yaz-z-assoc.h,v 1.2 1999-04-20 10:30:05 adam Exp $
11 #include <yaz-pdu-observer.h>
13 /** Z39.50 Assocation.
14 This object implements the client - and server role of a generic
17 class YAZ_EXPORT Yaz_Z_Assoc : public IYaz_PDU_Observer {
19 /// Create object using the PDU Observer specified
20 Yaz_Z_Assoc(IYaz_PDU_Observable *the_PDU_Observable);
21 /// Destroy assocation and close PDU Observer
22 virtual ~Yaz_Z_Assoc();
24 void recv_PDU(const char *buf, int len);
25 /// Connect notification
27 /// Failure notification
29 /// Timeout notification
31 /// Begin Z39.50 client role
32 void client(const char *addr);
33 /// Begin Z39.50 server role
34 void server(const char *addr);
37 /// Decode Z39.50 PDU.
38 Z_APDU *decode_Z_PDU(const char *buf, int len);
39 /// Encode Z39.50 PDU.
40 int encode_Z_PDU(Z_APDU *apdu, char **buf, int *len);
42 int send_Z_PDU(Z_APDU *apdu);
43 /// Receive Z39.50 PDU
44 virtual void recv_Z_PDU(Z_APDU *apdu) = 0;
45 /// Create Z39.50 PDU with reasonable defaults
46 Z_APDU *create_Z_PDU(int type);
52 Z_OtherInformationUnit *update_otherInformation (
53 Z_OtherInformation **otherInformationP, int createFlag,
54 int *oid, int categoryValue);
56 static int yaz_init_flag;
57 static int yaz_init_func();
58 IYaz_PDU_Observable *m_PDU_Observable;