File: D4AsyncUtil.h

package info (click to toggle)
libdap 3.21.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,256 kB
  • sloc: cpp: 46,310; sh: 44,047; xml: 23,535; ansic: 19,973; yacc: 2,505; exp: 1,544; makefile: 581; lex: 309; fortran: 8
file content (81 lines) | stat: -rw-r--r-- 2,567 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
 * D4AsyncUtil.h
 *
 *  Created on: Feb 18, 2014
 *      Author: ndp
 */

#ifndef D4ASYNCUTIL_H_
#define D4ASYNCUTIL_H_

#include "XMLWriter.h"

namespace libdap {

enum RejectReasonCode { TIME, UNAVAILABLE, PRIVILEGES, OTHER };

class D4AsyncUtil {
private:
#if 0
    // Not used
	string *d_stylesheet_ref;
#endif

public:
    D4AsyncUtil();
    virtual ~D4AsyncUtil();

    const static string STYLESHEET_REFERENCE_KEY;

    /**
     * @brief Write the DAP4 AsyncRequired response.
     * Print the AsyncRequired in XML form.
     * @param xml Print to this XMLWriter instance
     */
    void writeD4AsyncRequired(XMLWriter &xml, long expectedDelay, long responseLifetime, string *stylesheet_ref = 0);

    /**
     * @brief Write the DAP4 AsyncAccepted response.
     * Write the AsyncAccepted in XML form.
     * @param xml Print to this XMLWriter instance
     */
    void writeD4AsyncAccepted(XMLWriter &xml, long expectedDelay, long responseLifetime, string asyncResourceUrl,
                              string *stylesheet_ref = 0);

    /**
     * @brief Write the DAP4 AsyncPending response.
     * Write the DAP4 AsyncPending in XML form.
     * @param xml Print to this XMLWriter instance
     */
    void writeD4AsyncPending(XMLWriter &xml, string *stylesheet_ref = 0);

    /**
     * @brief Write the DAP4 AsyncResponseGone response.
     * Write the DAP4 AsyncRequired in XML form.
     * @param xml Print to this XMLWriter instance
     */
    void writeD4AsyncResponseGone(XMLWriter &xml, string *stylesheet_ref = 0);

    /**
     * @brief Write the DAP4 ResponseRejected response.
     * Write the DAP4 AsyncRequired in XML form.
     * @param xml Print to this XMLWriter instance
     */
    void writeD4AsyncResponseRejected(XMLWriter &xml, RejectReasonCode code, string description,
                                      string *stylesheet_ref = 0);
    string getRejectReasonCodeString(RejectReasonCode code);

    /**
     * @brief Write the DAP2 AsyncRequired response .
     * Write the DAP2 AsyncRequired in XML form.
     * @param xml Print to this XMLWriter instance
     */
    void writeD2AsyncRequired(XMLWriter &xml, long expectedDelay, long responseLifetime);
    void writeD2AsyncAccepted(XMLWriter &xml, long expectedDelay, long responseLifetime, string asyncResourceUrl);
    void writeD2AsyncPending(XMLWriter &xml);
    void writeD2AsyncResponseGone(XMLWriter &xml);
    void writeD2AsyncResponseRejected(XMLWriter &xml, RejectReasonCode code, string description);
};

} /* namespace libdap */
#endif /* D4ASYNCUTIL_H_ */