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 #ifndef IT_MINIMISE_INCLUDES
00013 #include <it_bus_pdk/context_attrs/http_conf_xsdTypes.h>
00014 #endif
00015
00016 typedef IT_Vector<IT_Bus::String> vecString;
00017
00018 namespace IT_Bus
00019 {
00020 class BusContextRegistry;
00021 }
00022
00023 namespace IT_HTTP
00024 {
00025 class HttpListener;
00026 class HttpConnection;
00027 class HttpWSDLExtensionFactory;
00028
00033 class IT_BUS_API HTTPServerConfiguration :
00034 public IT_HTTP::HttpWSDLExtensionElement
00035 {
00036
00037 public:
00038 HTTPServerConfiguration(
00039 IT_Bus::BusContextRegistry* registry,
00040 unsigned long default_port
00041 );
00042
00043 HTTPServerConfiguration(
00044 IT_HTTP::HttpWSDLExtensionFactory * factory,
00045 IT_WSDL::WSDLExtensibleNode* parent,
00046 IT_Bus::BusContextRegistry* registry
00047 );
00048
00049 virtual
00050 ~HTTPServerConfiguration();
00051
00052 bool
00053 parse(
00054 const IT_Bus::XMLIterator & element_iterator,
00055 const IT_Bus::XMLNode & element,
00056 IT_WSDL::WSDLErrorHandler & error_handler
00057 );
00058
00066 void
00067 setURL(
00068 const IT_Bus::String& strURL,
00069 IT_WSDL::WSDLPort* wsdl_port = 0
00070 );
00071
00077 const IT_Bus::String&
00078 getURL();
00079
00088 const IT_Bus::String&
00089 get_path();
00090
00097 void
00098 get_port_from_url(
00099 IT_Bus::String & port_string
00100 );
00101
00102
00103 void
00104 initialize(
00105 IT_Bus::XMLHelper& Configuration
00106 );
00107
00108
00109 void
00110 initialize(
00111 const IT_Bus::XMLIterator& Configuration
00112 );
00113
00117 void
00118 ReadCookieConfiguration(
00119 IT_Bus::XMLHelper& Configuration
00120 );
00121
00125 void
00126 ReadCookieConfiguration(
00127 const IT_Bus::XMLIterator& Configuration
00128 );
00129
00136 void
00137 setContentType(
00138 const IT_Bus::String& strContentType
00139 );
00140
00146 const IT_Bus::String&
00147 getContentType();
00148
00149
00150 void
00151 SetListenParameters(
00152 unsigned long dynamic_port
00153 );
00154
00158 HTTPServerConfiguration(
00159 const HTTPServerConfiguration& copyThis
00160 );
00161
00162
00163 const HTTPServerConfiguration&
00164 operator=(
00165 const HTTPServerConfiguration& assignThis
00166 );
00167
00174 virtual void
00175 write(
00176 IT_Bus::XMLOutputStream & stream
00177 ) const throw((IT_Bus::IOException));
00178
00179
00183 virtual void
00184 read(
00185 const IT_Bus::QName& ,
00186 IT_Bus::ComplexTypeReader&
00187 ) throw((IT_Bus::DeserializationException))
00188 {
00189
00190 }
00191
00195 virtual void
00196 write(
00197 const IT_Bus::QName& ,
00198 IT_Bus::ComplexTypeWriter&
00199 ) const throw((IT_Bus::SerializationException))
00200 {
00201
00202 }
00203
00204
00210 virtual void
00211 write_attributes(
00212 IT_Bus::XMLOutputStream & stream
00213 ) const throw((IT_Bus::IOException));
00214
00221 IT_WSDL::WSDLExtensionElement*
00222 clone() const;
00223
00231 static HTTPServerConfiguration*
00232 get_from_port(
00233 const IT_WSDL::WSDLPort& wsdl_port
00234 );
00235
00247 void
00248 set_path(
00249 const IT_Bus::String & str_url
00250 );
00251
00255 virtual
00256 IT_Bus::AnyType&
00257 operator=(
00258 const IT_Bus::AnyType&
00259 )
00260 {
00261 return *this;
00262 }
00263
00270 const IT_Bus::BinaryBuffer &
00271 get_server_cert_data() const
00272 {
00273 return m_ServerCertificateData;
00274 }
00275
00282 const IT_Bus::BinaryBuffer &
00283 get_server_cert_chain_data() const
00284 {
00285 return m_ServerCertificateChainData;
00286 }
00287
00294 const IT_Bus::BinaryBuffer &
00295 get_server_privkey_data() const
00296 {
00297 return m_ServerPrivateKeyData;
00298 }
00299
00306 const IT_Bus::BinaryBuffer &
00307 get_trusted_cert_data() const
00308 {
00309 return m_TrustedRootCertificatesData;
00310 }
00311
00312 unsigned long
00313 get_default_port() const
00314 {
00315 return m_default_port;
00316 }
00317
00318 void
00319 set_default_port(
00320 unsigned long default_port
00321 )
00322 {
00323 m_default_port = default_port;
00324 }
00325
00326 unsigned long
00327 get_port();
00328
00343 bool m_bUseSecureSockets;
00344 IT_Bus::String m_ServerCertificate;
00345
00346
00347 IT_Bus::String m_ServerPrivateKey;
00348
00349 IT_Bus::String m_ServerPrivateKeyPassword;
00350 IT_Bus::String m_TrustedRootCertificates;
00351
00352
00353 IT_Bus::String m_ServerCertificateChain;
00354
00368 unsigned long m_ulPort;
00369 long m_lSendTimeout;
00370 long m_lReceiveTimeout;
00371 bool m_bSuppressClientSendErrors;
00372 bool m_bSuppressClientReceiveErrors;
00373
00377 IT_ULong m_HTTPReplyCode;
00378
00382 IT_Bus::String m_HTTPReply;
00383
00387 bool m_bHonorKeepAlive;
00388
00392 IT_Bus::String m_RedirectURL;
00393
00397 vecString m_cookies;
00398
00403 IT_Bus::String m_Pragma;
00404
00408 IT_Bus::String m_CacheControl;
00409
00413 IT_Bus::String m_ContentLocation;
00414
00418 IT_Bus::String m_ContentEncoding;
00419
00423 IT_Bus::String m_ContentLanguage;
00424
00428 IT_Bus::String m_ServerType;
00429
00434 IT_Bus::String m_WWWAuthenticate;
00435
00439 bool m_bSuppressTLSv1;
00440
00444 bool m_bSuppressBugTolerance;
00445
00449 unsigned long m_port_range_max;
00450
00451 void
00452 set_encoding(
00453 const IT_Bus::String& encoding
00454 )
00455 {
00456 m_encoding = encoding;
00457 }
00458
00459 const IT_Bus::String&
00460 get_encoding() const
00461 {
00462 return m_encoding;
00463 }
00464
00465 protected:
00466
00467 bool
00468 is_integer_string(
00469 const IT_Bus::String & to_test
00470 );
00471
00472
00473 private:
00474
00494 unsigned long m_default_port;
00495
00496 IT_Bus::String m_ContentType;
00497 IT_Bus::String m_URL;
00498 IT_Bus::String m_path;
00499
00500 IT_Bus::BinaryBuffer m_ServerCertificateData;
00501
00502
00503 IT_Bus::BinaryBuffer m_ServerCertificateChainData;
00504 IT_Bus::BinaryBuffer m_ServerPrivateKeyData;
00505
00506 IT_Bus::BinaryBuffer m_TrustedRootCertificatesData;
00507
00508 IT_HTTP::HttpWSDLExtensionFactory * m_extension_factory;
00509
00510 IT_Bus::BusContextRegistry* m_ctx_registry;
00511 IT_Bus::String m_encoding;
00512
00513 IT_Mutex m_mutex;
00514
00515 };
00516
00517 }
00518
00519 #endif
00520