minor
[yazpp-moved-to-github.git] / include / yaz-proxy.h
index 9d8e213..062c926 100644 (file)
@@ -1,22 +1,12 @@
 /*
- * Copyright (c) 1998-1999, Index Data.
+ * Copyright (c) 1998-2000, Index Data.
  * See the file LICENSE for details.
- * Sebastian Hammer, Adam Dickmeiss
  * 
- * $Log: yaz-proxy.h,v $
- * Revision 1.3  1999-04-09 11:47:23  adam
- * Added object Yaz_Z_Assoc. Much more functional client.
- *
- * Revision 1.2  1999/02/02 14:01:15  adam
- * First WIN32 port of YAZ++.
- *
- * Revision 1.1.1.1  1999/01/28 09:41:07  adam
- * First implementation of YAZ++.
- *
- *
+ * $Id: yaz-proxy.h,v 1.13 2000-09-08 10:23:42 adam Exp $
  */
 
 #include <yaz-z-assoc.h>
+#include <yaz-z-query.h>
 
 class Yaz_Proxy;
 
@@ -24,30 +14,53 @@ class Yaz_Proxy;
 class YAZ_EXPORT Yaz_ProxyClient : public Yaz_Z_Assoc {
     friend Yaz_Proxy;
     Yaz_ProxyClient(IYaz_PDU_Observable *the_PDU_Observable);
+    ~Yaz_ProxyClient();
     void recv_Z_PDU(Z_APDU *apdu);
     IYaz_PDU_Observer* clone(IYaz_PDU_Observable *the_PDU_Observable);
+    void shutdown();
     Yaz_Proxy *m_server;
     void failNotify();
-};
-
-/// Private class
-class YAZ_EXPORT Yaz_ProxyMap {
-    friend Yaz_Proxy;
-    char *m_databaseName;      /* from database name */
-    char *m_ZURL;              /* to this address */
-    Yaz_ProxyMap *m_next;
+    void timeoutNotify();
+    void connectNotify();
+    char m_cookie[32];
+    Yaz_ProxyClient *m_next;
+    Yaz_ProxyClient **m_prev;
+    int m_init_flag;
+    Yaz_Z_Query *m_last_query;
+    int m_last_resultCount;
+    int m_sr_transform;
+    int m_seqno;
+    int m_waiting;
 };
 
 /// Information Retrieval Proxy Server.
 class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc {
+ private:
+    char *get_cookie(Z_OtherInformation **otherInfo);
+    char *get_proxy(Z_OtherInformation **otherInfo);
+    Yaz_ProxyClient *get_client(Z_APDU *apdu);
+    Z_APDU *result_set_optimize(Z_APDU *apdu);
+    void shutdown();
+    
+    Yaz_ProxyClient *m_client;
+    IYaz_PDU_Observable *m_PDU_Observable;
+    Yaz_ProxyClient *m_clientPool;
+    Yaz_Proxy *m_parent;
+    int m_seqno;
+    int m_max_clients;
+    int m_keepalive;
+    char *m_proxyTarget;
+    long m_seed;
  public:
     Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable);
     ~Yaz_Proxy();
     void recv_Z_PDU(Z_APDU *apdu);
     IYaz_PDU_Observer* clone(IYaz_PDU_Observable *the_PDU_Observable);
     void failNotify();
-    Yaz_ProxyClient *m_client;
-    IYaz_PDU_Observable *m_PDU_Observable;
- private:
-    Yaz_ProxyMap *m_maps;
+    void timeoutNotify();
+    void connectNotify();
+    void set_proxyTarget(const char *target);
+    char *get_proxyTarget() { return m_proxyTarget; };
+    void set_max_clients(int m) { m_max_clients = m; };
 };
+