00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #ifndef _connect_h
00056 #define _connect_h
00057
00058
00059 #include <stdio.h>
00060
00061 #include <string>
00062
00063 #ifndef _das_h
00064 #include "DAS.h"
00065 #endif
00066
00067 #ifndef _dds_h
00068 #include "DDS.h"
00069 #endif
00070
00071 #ifndef _error_h
00072 #include "Error.h"
00073 #endif
00074
00075 #ifndef _util_h
00076 #include "util.h"
00077 #endif
00078
00079 #ifndef _datadds_h
00080 #include "DataDDS.h"
00081 #endif
00082
00083 #ifndef _httpconnect_h
00084 #include "HTTPConnect.h"
00085 #endif
00086
00087 #ifndef response_h
00088 #include "Response.h"
00089 #endif
00090
00091 using std::string;
00092
00132 class Connect
00133 {
00134 private:
00135 bool _local;
00136
00137 HTTPConnect *d_http;
00138 string _URL;
00139 string _proj;
00140 string _sel;
00141
00142 string d_version;
00143 string d_protocol;
00144
00145 void process_data(DataDDS &data, Response *rs);
00146
00147
00148 void parse_mime(Response *rs);
00149
00150 protected:
00153 Connect()
00154 { }
00155 Connect(const Connect &)
00156 { }
00157 Connect &operator=(const Connect &)
00158 {
00159 throw InternalErr(__FILE__, __LINE__, "Unimplemented assignment");
00160 }
00162
00163 public:
00164 Connect(const string &name, string uname = "", string password = "")
00165 throw(Error, InternalErr);
00166
00167 virtual ~Connect();
00168
00169 bool is_local();
00170
00171
00172 virtual string URL(bool CE = true);
00173 virtual string CE();
00174
00175 void set_credentials(string u, string p);
00176 void set_accept_deflate(bool deflate);
00177
00178 void set_cache_enabled(bool enabled);
00179 bool is_cache_enabled();
00180
00190 string get_version()
00191 {
00192 return d_version;
00193 }
00194
00198 string get_protocol()
00199 {
00200 return d_protocol;
00201 }
00202
00203
00204 virtual string request_version();
00205 virtual string request_protocol();
00206
00207 virtual void request_das(DAS &das);
00208 virtual void request_das_url(DAS &das);
00209
00210 virtual void request_dds(DDS &dds, string expr = "");
00211 virtual void request_dds_url(DDS &dds);
00212
00213 virtual void request_ddx(DDS &dds, string expr = "");
00214 virtual void request_ddx_url(DDS &dds);
00215
00216 virtual void request_data(DataDDS &data, string expr = "");
00217 virtual void request_data_url(DataDDS &data);
00218
00219 virtual void read_data(DataDDS &data, Response *rs);
00220 virtual void read_data_no_mime(DataDDS &data, Response *rs);
00221 };
00222
00223 #endif // _connect_h