Qore DataStreamRequestHandler Module Reference  1.0
 All Classes Namespaces Functions Variables Groups Pages
DataStreamRequestHandler.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
2 // @file DataStreamRequestHandler.qm Qore user module implementing client support for the DataStream protocol: YAML-encoded HTTP chunked transfers where each chunk is a unique data entity
3 
4 /* DataStreamRequestHandler.qm Copyright (C) 2014 - 2017 Qore Technologies, s.r.o.
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
25 // this module requires Qore 0.8.10 or better
26 
27 // require type definitions everywhere
28 
29 // enable all warnings
30 
31 
32 // do not use $ signs in declarations
33 
34 
35 /* Version History: see docs below
36 */
37 
63 namespace DataStreamRequestHandler {
66 
69 class AbstractDataStreamRequestHandler : public RestHandler::AbstractRestStreamRequestHandler {
70 
71 public:
72  public :
74  code rcb;
75 
77  code scb;
78 
80  bool recv_done = False;
81 
83  bool send_done = False;
84 
86  int err;
87 
89  *string send_error;
90 
91 public:
92 
94  constructor(hash cx, *hash ah) ;
95 
96 
98 
100  *hash getErrorResponse();
101 
102 
104 
114 
115 
117  nothing recvImpl(hash v);
118 
119 
121  any sendImpl();
122 
123 
125 
126 private:
127  nothing recvDataDone(*string err);
128 public:
129 
130 
132 
135 private:
136  nothing recvData(any data);
137 public:
138 
139 
141 
144 private:
145  any sendData();
146 public:
147 
148 
150 
151 private:
152  nothing recvDataDoneImpl(*string err);
153 public:
154 
155 
157 
160 private:
161  abstract nothing recvDataImpl(any data);
162 public:
163 
165 
168 private:
169  abstract any sendDataImpl();
170 public:
171  };
172 };
*string send_error
send error string received
Definition: DataStreamRequestHandler.qm.dox.h:89
*hash getErrorResponse()
if an error occurred, then return a hash giving an error response, otherwise return nothing ...
nothing recvData(any data)
This is the concrete method called when data is received; it calls recvDataImpl() in turn...
hash getResponseHeaderMessageImpl()
returns the response header to the request
any sendImpl()
calls the send callback as returned by the DataStreamUtil module, which in turn calls sendDataImpl() ...
bool send_done
flag for when all data has been sent
Definition: DataStreamRequestHandler.qm.dox.h:83
nothing recvImpl(hash v)
calls the receive callback as returned by the DataStreamUtil module, which in turn calls recvDataImpl...
abstract nothing recvDataImpl(any data)
reimplement this method in subclasses to receive decoded and deserialized data
nothing recvDataDoneImpl(*string err)
this method is called when all data has been received
constructor(hash cx, *hash ah)
creates the chunked request handler according to the arguments
bool recv_done
flag for when all data has been received
Definition: DataStreamRequestHandler.qm.dox.h:80
nothing recvDataDone(*string err)
this method is called when all data has been received
this class implements a chunked request handler supporting the DataStream protocol ...
Definition: DataStreamRequestHandler.qm.dox.h:69
int err
HTTP status code for error response sent.
Definition: DataStreamRequestHandler.qm.dox.h:86
abstract any sendDataImpl()
reimplement this method in subclasses to support streamed data transfers; when this method returns no...
code scb
the send callback as returned by the DataStreamUtil module
Definition: DataStreamRequestHandler.qm.dox.h:77
any sendData()
This is the concrete method called when data is received; it calls recvDataImpl() in turn...
code rcb
the receive callback as returned by the DataStreamUtil module
Definition: DataStreamRequestHandler.qm.dox.h:74