From 30a319511d4583cbd1b6a0694e097ea1c88ee4c0 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 3 May 2001 12:39:39 +0000 Subject: [PATCH] Added Update server service. --- ChangeLog | 3 +++ LICENSE | 2 +- include/yaz++/yaz-z-server.h | 18 ++++++++++++++---- src/Makefile.am | 4 ++-- src/yaz-my-server.cpp | 33 ++++++++++++++++++++++----------- src/yaz-z-server-ill.cpp | 7 +++++-- 6 files changed, 47 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1787fb..31c7ad1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,2 +1,5 @@ +2001-05-03 Adam Dickmeiss + * Added Update service for server. + 2001-04-25 Adam Dickmeiss * Server sets referenceId in responses.. diff --git a/LICENSE b/LICENSE index c27e7ce..5e59e8a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995-2000, Index Data. + * Copyright (c) 1995-2001, Index Data. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation, in whole or in part, for any purpose, is hereby granted, diff --git a/include/yaz++/yaz-z-server.h b/include/yaz++/yaz-z-server.h index 64d0ae3..766a1a2 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.8 2001-04-11 12:33:42 heikki Exp $ + * $Id: yaz-z-server.h,v 1.9 2001-05-03 12:39:39 adam Exp $ */ #include @@ -54,9 +54,6 @@ class YAZ_EXPORT Yaz_Facility_Ursula : public 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; @@ -67,6 +64,19 @@ class YAZ_EXPORT Yaz_Facility_ILL : public IYaz_Server_Facility { int recv(Yaz_Z_Server *server, Z_APDU *apdu); }; +class YAZ_EXPORT Yaz_Facility_Update : public IYaz_Server_Facility { + public: + virtual void update_service (Z_ExtendedServicesRequest *req, + Z_IUUpdate *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); +}; + + class YAZ_EXPORT Yaz_Facility_Retrieval : public IYaz_Server_Facility, public Yaz_Z_ServerUtility { public: diff --git a/src/Makefile.am b/src/Makefile.am index 76e2135..e34553b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.5 2001-04-05 13:09:44 adam Exp $ +## $Id: Makefile.am,v 1.6 2001-05-03 12:39:39 adam Exp $ INCLUDES=$(YAZINC) -I$(srcdir)/../include @@ -7,7 +7,7 @@ lib_LTLIBRARIES = libyaz++.la libyaz___la_SOURCES=yaz-socket-manager.cpp yaz-pdu-assoc.cpp \ yaz-z-assoc.cpp yaz-proxy.cpp yaz-z-query.cpp yaz-ir-assoc.cpp \ yaz-z-server.cpp yaz-pdu-assoc-thread.cpp yaz-z-server-sr.cpp \ - yaz-z-server-ill.cpp + yaz-z-server-ill.cpp yaz-z-server-update.cpp libyaz___la_LDFLAGS=-version-info 0:0:0 diff --git a/src/yaz-my-server.cpp b/src/yaz-my-server.cpp index 30c68cd..3e7e249 100644 --- a/src/yaz-my-server.cpp +++ b/src/yaz-my-server.cpp @@ -3,7 +3,10 @@ * See the file LICENSE for details. * * $Log: yaz-my-server.cpp,v $ - * Revision 1.4 2001-04-05 13:09:44 adam + * Revision 1.5 2001-05-03 12:39:39 adam + * Added Update server service. + * + * Revision 1.4 2001/04/05 13:09:44 adam * Removed ursula dependancy. * * Revision 1.3 2001/04/04 14:02:49 adam @@ -74,13 +77,19 @@ class MyILL : public Yaz_Facility_ILL { public: - int ill_init (Z_InitRequest *initRequest, - Z_InitResponse *initResponse); void ill_service (Z_ExtendedServicesRequest *req, Z_ItemOrder *io, Z_ExtendedServicesResponse *res); }; +class MyUpdate : public Yaz_Facility_Update { +public: + void update_service (Z_ExtendedServicesRequest *req, + Z_IUUpdate *io, + Z_ExtendedServicesResponse *res); +}; + + class MyRetrieval : public Yaz_Facility_Retrieval, Yaz_USMARC { public: int sr_init (Z_InitRequest *initRequest, @@ -119,19 +128,13 @@ public: private: MyRetrieval m_retrieval; MyILL m_ill; + MyUpdate m_update; #if HAVE_YAZ_URSULA_H MyUrsula m_ursula; #endif int m_no; }; -int MyILL::ill_init (Z_InitRequest *initRequest, - Z_InitResponse *initResponse) -{ - yaz_log (LOG_LOG, "MyILL::ill_init"); - return 1; -} - void MyILL::ill_service (Z_ExtendedServicesRequest *req, Z_ItemOrder *io, Z_ExtendedServicesResponse *res) @@ -139,6 +142,13 @@ void MyILL::ill_service (Z_ExtendedServicesRequest *req, yaz_log (LOG_LOG, "MyServer::ill_service"); } +void MyUpdate::update_service (Z_ExtendedServicesRequest *req, + Z_IUUpdate *io, + Z_ExtendedServicesResponse *res) +{ + yaz_log (LOG_LOG, "MyServer::update_service"); +} + #if HAVE_YAZ_URSULA_H void MyUrsula::ursula_service (Z_ExtendedServicesRequest *req, @@ -229,8 +239,9 @@ IYaz_PDU_Observer *MyServer::sessionNotify( new_server->timeout(900); new_server->facility_add(&new_server->m_retrieval, "my sr"); new_server->facility_add(&new_server->m_ill, "my ill"); + new_server->facility_add(&new_server->m_update, "my update"); #if HAVE_YAZ_URSULA_H - new_server->facility_add(&new_server->m_ursula, "my ill"); + new_server->facility_add(&new_server->m_ursula, "my ursula"); #endif new_server->set_APDU_log(get_APDU_log()); diff --git a/src/yaz-z-server-ill.cpp b/src/yaz-z-server-ill.cpp index dd0c277..f7797e4 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.5 2001-04-25 19:40:18 adam + * Revision 1.6 2001-05-03 12:39:39 adam + * Added Update server service. + * + * Revision 1.5 2001/04/25 19:40:18 adam * Added refernceId handling for other services. * * Revision 1.4 2001/04/04 14:02:49 adam @@ -31,7 +34,7 @@ int Yaz_Facility_ILL::init(Yaz_Z_Server *s, Z_InitRequest *initRequest, if (ODR_MASK_GET(req, Z_Options_extendedServices)) ODR_MASK_SET(res, Z_Options_extendedServices); - return ill_init (initRequest, initResponse); + return 1; } int Yaz_Facility_ILL::recv(Yaz_Z_Server *s, Z_APDU *apdu_request) -- 1.7.10.4