00001 #ifndef _IT_BUS_CONFIG_HTTP_WSDL_SERVER_H_
00002 #define _IT_BUS_CONFIG_HTTP_WSDL_SERVER_H_
00003
00004
00005
00006
00007 #include <it_dsa/vector.h>
00008 #include <it_ts/mutex.h>
00009 #include <it_bus/types.h>
00010 #include <it_bus_config/http_wsdl_extension_element.h>
00011 #include <it_bus_pdk/messaging_transport.h>
00012 #include <it_bus_pdk/context_attrs/http_conf_xsdTypes.h>
00013
00014 typedef IT_Vector<IT_Bus::String> vecString;
00015
00016 namespace IT_Bus
00017 {
00018 class BusContextRegistry;
00019 }
00020
00021 namespace IT_HTTP
00022 {
00023 class HttpListener;
00024 class HttpConnection;
00025 class HttpWSDLExtensionFactory;
00026
00031 class IT_BUS_API HTTPServerConfiguration :
00032 public IT_HTTP::HttpWSDLExtensionElement
00033 {
00034
00035 public:
00036 HTTPServerConfiguration(
00037 IT_Bus::BusContextRegistry* registry,
00038 unsigned long default_port
00039 );
00040
00041 HTTPServerConfiguration(
00042 IT_HTTP::HttpWSDLExtensionFactory * factory,
00043 IT_WSDL::WSDLExtensibleNode* parent,
00044 IT_Bus::BusContextRegistry* registry
00045 );
00046
00047 virtual
00048 ~HTTPServerConfiguration();
00049
00050 bool
00051 parse(
00052 const IT_Bus::XMLIterator & element_iterator,
00053 const IT_Bus::XMLNode & element,
00054 IT_WSDL::WSDLErrorHandler & error_handler
00055 );
00056
00064 void
00065 setURL(
00066 const IT_Bus::String& strURL,
00067 IT_WSDL::WSDLPort* wsdl_port = 0
00068 );
00069
00075 const IT_Bus::String&
00076 getURL();
00077
00086 const IT_Bus::String&
00087 get_path();
00088
00095 void
00096 get_port_from_url(
00097 IT_Bus::String & port_string
00098 );
00099
00100
00101 void
00102 initialize(
00103 IT_Bus::XMLHelper& Configuration
00104 );
00105
00106
00107 void
00108 initialize(
00109 const IT_Bus::XMLIterator& Configuration
00110 );
00111
00115 void
00116 ReadCookieConfiguration(
00117 IT_Bus::XMLHelper& Configuration
00118 );
00119
00123 void
00124 ReadCookieConfiguration(
00125 const IT_Bus::XMLIterator& Configuration
00126 );
00127
00134 void
00135 setContentType(
00136 const IT_Bus::String& strContentType
00137 );
00138
00144 const IT_Bus::String&
00145 getContentType();
00146
00147
00148 void
00149 SetListenParameters(
00150 unsigned long dynamic_port
00151 );
00152
00156 HTTPServerConfiguration(
00157 const HTTPServerConfiguration& copyThis
00158 );
00159
00160
00161 const HTTPServerConfiguration&
00162 operator=(
00163 const HTTPServerConfiguration& assignThis
00164 );
00165
00172 virtual void
00173 write(
00174 IT_Bus::XMLOutputStream & stream
00175 ) const throw((IT_Bus::IOException));
00176
00177
00181 virtual void
00182 read(
00183 const IT_Bus::QName& ,
00184 IT_Bus::ComplexTypeReader&
00185 ) throw((IT_Bus::DeserializationException))
00186 {
00187
00188 }
00189
00193 virtual void
00194 write(
00195 const IT_Bus::QName& ,
00196 IT_Bus::ComplexTypeWriter&
00197 ) const throw((IT_Bus::SerializationException))
00198 {
00199
00200 }
00201
00202
00208 virtual void
00209 write_attributes(
00210 IT_Bus::XMLOutputStream & stream
00211 ) const throw((IT_Bus::IOException));
00212
00219 IT_WSDL::WSDLExtensionElement*
00220 clone() const;
00221
00229 static HTTPServerConfiguration*
00230 get_from_port(
00231 const IT_WSDL::WSDLPort& wsdl_port
00232 );
00233
00245 void
00246 set_path(
00247 const IT_Bus::String & str_url
00248 );
00249
00253 virtual
00254 IT_Bus::AnyType&
00255 operator=(
00256 const IT_Bus::AnyType&
00257 )
00258 {
00259 return *this;
00260 }
00261
00268 const IT_Bus::BinaryBuffer &
00269 get_server_cert_data() const
00270 {
00271 return m_ServerCertificateData;
00272 }
00273
00280 const IT_Bus::BinaryBuffer &
00281 get_server_cert_chain_data() const
00282 {
00283 return m_ServerCertificateChainData;
00284 }
00285
00292 const IT_Bus::BinaryBuffer &
00293 get_server_privkey_data() const
00294 {
00295 return m_ServerPrivateKeyData;
00296 }
00297
00304 const IT_Bus::BinaryBuffer &
00305 get_trusted_cert_data() const
00306 {
00307 return m_TrustedRootCertificatesData;
00308 }
00309
00310 unsigned long
00311 get_default_port() const
00312 {
00313 return m_default_port;
00314 }
00315
00316 void
00317 set_default_port(
00318 unsigned long default_port
00319 )
00320 {
00321 m_default_port = default_port;
00322 }
00323
00324 unsigned long
00325 get_port();
00326
00341 bool m_bUseSecureSockets;
00342 IT_Bus::String m_ServerCertificate;
00343
00344
00345 IT_Bus::String m_ServerPrivateKey;
00346
00347 IT_Bus::String m_ServerPrivateKeyPassword;
00348 IT_Bus::String m_TrustedRootCertificates;
00349
00350
00351 IT_Bus::String m_ServerCertificateChain;
00352
00366 unsigned long m_ulPort;
00367 long m_lSendTimeout;
00368 long m_lReceiveTimeout;
00369 bool m_bSuppressClientSendErrors;
00370 bool m_bSuppressClientReceiveErrors;
00371
00375 IT_ULong m_HTTPReplyCode;
00376
00380 IT_Bus::String m_HTTPReply;
00381
00385 bool m_bHonorKeepAlive;
00386
00390 IT_Bus::String m_RedirectURL;
00391
00395 vecString m_cookies;
00396
00401 IT_Bus::String m_Pragma;
00402
00406 IT_Bus::String m_CacheControl;
00407
00411 IT_Bus::String m_ContentLocation;
00412
00416 IT_Bus::String m_ContentEncoding;
00417
00421 IT_Bus::String m_ContentLanguage;
00422
00426 IT_Bus::String m_ServerType;
00427
00432 IT_Bus::String m_WWWAuthenticate;
00433
00437 bool m_bSuppressTLSv1;
00438
00442 bool m_bSuppressBugTolerance;
00443
00447 unsigned long m_port_range_max;
00448
00449 void
00450 set_encoding(
00451 const IT_Bus::String& encoding
00452 )
00453 {
00454 m_encoding = encoding;
00455 }
00456
00457 const IT_Bus::String&
00458 get_encoding() const
00459 {
00460 return m_encoding;
00461 }
00462
00463 protected:
00464
00465 bool
00466 is_integer_string(
00467 const IT_Bus::String & to_test
00468 );
00469
00470
00471 private:
00472
00492 unsigned long m_default_port;
00493
00494 IT_Bus::String m_ContentType;
00495 IT_Bus::String m_URL;
00496 IT_Bus::String m_path;
00497
00498 IT_Bus::BinaryBuffer m_ServerCertificateData;
00499
00500
00501 IT_Bus::BinaryBuffer m_ServerCertificateChainData;
00502 IT_Bus::BinaryBuffer m_ServerPrivateKeyData;
00503
00504 IT_Bus::BinaryBuffer m_TrustedRootCertificatesData;
00505
00506 IT_HTTP::HttpWSDLExtensionFactory * m_extension_factory;
00507
00508 IT_Bus::BusContextRegistry* m_ctx_registry;
00509 IT_Bus::String m_encoding;
00510
00511 IT_Mutex m_mutex;
00512
00513 };
00514
00515 }
00516
00517 #endif
00518