1 #ifndef PSGS_OSGGETBLOB__HPP
2 #define PSGS_OSGGETBLOB__HPP
3 
4 /*  $Id: osg_getblob.hpp 629837 2021-04-22 12:47:49Z ivanov $
5  * ===========================================================================
6  *
7  *                            PUBLIC DOMAIN NOTICE
8  *               National Center for Biotechnology Information
9  *
10  *  This software/database is a "United States Government Work" under the
11  *  terms of the United States Copyright Act.  It was written as part of
12  *  the author's official duties as a United States Government employee and
13  *  thus cannot be copyrighted.  This software/database is freely available
14  *  to the public for use. The National Library of Medicine and the U.S.
15  *  Government have not placed any restriction on its use or reproduction.
16  *
17  *  Although all reasonable efforts have been taken to ensure the accuracy
18  *  and reliability of the software and data, the NLM and the U.S.
19  *  Government do not and cannot warrant the performance or results that
20  *  may be obtained by using this software or data. The NLM and the U.S.
21  *  Government disclaim all warranties, express or implied, including
22  *  warranties of performance, merchantability or fitness for any particular
23  *  purpose.
24  *
25  *  Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Eugene Vasilchenko
30  *
31  * File Description: processor to get blob/chunk from OSG
32  *
33  */
34 
35 #include "osg_getblob_base.hpp"
36 
37 
38 BEGIN_NCBI_NAMESPACE;
39 BEGIN_NAMESPACE(psg);
40 BEGIN_NAMESPACE(osg);
41 
42 class CPSGS_OSGGetBlob : public CPSGS_OSGGetBlobBase
43 {
44 public:
45     CPSGS_OSGGetBlob(const CRef<COSGConnectionPool>& pool,
46                      const shared_ptr<CPSGS_Request>& request,
47                      const shared_ptr<CPSGS_Reply>& reply,
48                      TProcessorPriority priority);
49     virtual ~CPSGS_OSGGetBlob();
50 
51     virtual string GetName() const override;
52 
53     static bool CanProcess(SPSGS_BlobBySatSatKeyRequest& request);
54 
55     virtual void NotifyOSGCallStart() override;
56     virtual void NotifyOSGCallReply(const CID2_Reply& reply) override;
57     virtual void NotifyOSGCallEnd() override;
58     virtual void CreateRequests() override;
59     virtual void ProcessReplies() override;
60 
61     static bool IsEmptyCDDBlob(const CID2_Reply& reply);
62 
63 private:
64     bool m_ApplyCDDFix;
65     bool m_EmptyCDDReceived;
66     CStopWatch m_RequestTime;
67 };
68 
69 
70 class CPSGS_OSGGetChunks : public CPSGS_OSGGetBlobBase
71 {
72 public:
73     CPSGS_OSGGetChunks(const CRef<COSGConnectionPool>& pool,
74                        const shared_ptr<CPSGS_Request>& request,
75                        const shared_ptr<CPSGS_Reply>& reply,
76                        TProcessorPriority priority);
77     virtual ~CPSGS_OSGGetChunks();
78 
79     virtual string GetName() const override;
80 
81     static bool CanProcess(SPSGS_TSEChunkRequest& request);
82 
83     virtual void CreateRequests() override;
84     virtual void ProcessReplies() override;
85 };
86 
87 
88 END_NAMESPACE(osg);
89 END_NAMESPACE(psg);
90 END_NCBI_NAMESPACE;
91 
92 #endif  // PSGS_OSGGETBLOB__HPP
93