From: Adam Dickmeiss Date: Tue, 3 Apr 2001 14:37:19 +0000 (+0000) Subject: More work ILL-service. X-Git-Tag: YAZPP.0.3~48 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=ce735e1c32f736035580b9b14f32e6d1319ee06b;p=yazpp-moved-to-github.git More work ILL-service. --- diff --git a/include/yaz++/yaz-z-server.h b/include/yaz++/yaz-z-server.h index cff9582..6d48de4 100644 --- a/include/yaz++/yaz-z-server.h +++ b/include/yaz++/yaz-z-server.h @@ -2,7 +2,7 @@ * Copyright (c) 2000-2001, Index Data. * See the file LICENSE for details. * - * $Id: yaz-z-server.h,v 1.4 2001-04-02 13:39:34 adam Exp $ + * $Id: yaz-z-server.h,v 1.5 2001-04-03 14:37:19 adam Exp $ */ #include @@ -20,13 +20,17 @@ class YAZ_EXPORT IYaz_Server_Facility { class YAZ_EXPORT Yaz_Facility_ILL : public IYaz_Server_Facility { public: + virtual int ill_init (Z_InitRequest *initRequest, + Z_InitResponse *initResponse) = 0; + + virtual void ill_service (Z_ExtendedServicesRequest *req, + Z_ItemOrder *io, Z_ExtendedServicesResponse *res) = 0; + int init(Yaz_Z_Server *server, Z_InitRequest *initRequest, Z_InitResponse *initResponse); int recv(Yaz_Z_Server *server, Z_APDU *apdu); - virtual int ill_init (Z_InitRequest *initRequest, - Z_InitResponse *initResponse) = 0; void create_databaseRecord (Z_NamePlusRecord *rec, const char *dbname, int format, @@ -41,10 +45,6 @@ class YAZ_EXPORT Yaz_Facility_ILL : public IYaz_Server_Facility { class YAZ_EXPORT Yaz_Facility_Retrieval : public IYaz_Server_Facility { public: - int init(Yaz_Z_Server *server, - Z_InitRequest *initRequest, - Z_InitResponse *initResponse); - int recv(Yaz_Z_Server *server, Z_APDU *apdu); virtual int sr_init (Z_InitRequest *initRequest, Z_InitResponse *initResponse) = 0; @@ -58,6 +58,11 @@ class YAZ_EXPORT Yaz_Facility_Retrieval : public IYaz_Server_Facility { Z_RecordComposition *comp, Z_NamePlusRecord *namePlusRecord, Z_Records *diagnostics) = 0; + int init(Yaz_Z_Server *server, + Z_InitRequest *initRequest, + Z_InitResponse *initResponse); + int recv(Yaz_Z_Server *server, Z_APDU *apdu); + void create_databaseRecord (Z_NamePlusRecord *rec, const char *dbname, int format, const void *buf, int len); @@ -67,10 +72,7 @@ class YAZ_EXPORT Yaz_Facility_Retrieval : public IYaz_Server_Facility { Z_Records *create_nonSurrogateDiagnostics (int error, const char *addinfo); - - virtual ODR odr_encode(); - private: Z_Records *pack_records (const char *resultSetName, int start, int num, diff --git a/src/yaz-z-server-ill.cpp b/src/yaz-z-server-ill.cpp index 9563658..063c2a8 100644 --- a/src/yaz-z-server-ill.cpp +++ b/src/yaz-z-server-ill.cpp @@ -3,7 +3,10 @@ * See the file LICENSE for details. * * $Log: yaz-z-server-ill.cpp,v $ - * Revision 1.2 2001-03-29 15:14:26 adam + * Revision 1.3 2001-04-03 14:37:19 adam + * More work ILL-service. + * + * Revision 1.2 2001/03/29 15:14:26 adam * Minor updates. * * Revision 1.1 2001/03/27 14:47:45 adam @@ -81,9 +84,14 @@ int Yaz_Facility_ILL::recv(Yaz_Z_Server *s, Z_APDU *apdu_request) m_odr = s->odr_encode(); if (apdu_request->which != Z_APDU_extendedServicesRequest) return 0; - - yaz_log (LOG_LOG, "got extendedSericesRequest p=%p", this); + Z_ExtendedServicesRequest *req = apdu_request->u.extendedServicesRequest; + if (!req->taskSpecificParameters || req->taskSpecificParameters->which != + Z_External_itemOrder) + return 0; + yaz_log (LOG_LOG, "got ill p=%p", this); apdu_response = s->create_Z_PDU(Z_APDU_extendedServicesResponse); + ill_service(req, req->taskSpecificParameters->u.itemOrder, + apdu_response->u.extendedServicesResponse); s->send_Z_PDU(apdu_response); return 1; }