Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

it_bus_pdk/context_attrs/wsaddressing_context_support.h

00001 //
00002 //      Copyright (c) 2006 IONA Technologies PLC. All Rights Reserved.
00003 //
00004 //   THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF IONA Technologies PLC
00005 //          The copyright notice above does not evidence any
00006 //          actual or intended publication of such source code.
00007 //
00008 #ifndef IT_WS_ADDRESSING_CONTEXT_SUPPORT_
00009 #define IT_WS_ADDRESSING_CONTEXT_SUPPORT_
00010 
00011 #include <it_bus/wsaddressing_xsdTypes.h>
00012 #include <it_bus_pdk/context_attrs/wsaddressing_xsdTypesFactory.h>
00013 
00014 #include <it_bus/bus.h>
00015 #include <it_bus/api_defines.h>
00016 
00017 namespace IT_WSAddressing
00018 {
00019     enum MessageDirection {Request, Response};
00020 
00021     class IT_CONTEXT_ATTRIBUTE_API ContextSupport
00022     {
00023 
00024       public:
00025         ContextSupport(
00026             IT_Bus::Bus_ptr         bus
00027         );
00028 
00029         ~ContextSupport();
00030 
00031         const IT_Bus::QName& messageid_name();
00032         const IT_Bus::QName& relatesto_name();
00033         const IT_Bus::QName& to_name();
00034         const IT_Bus::QName& action_name();
00035         const IT_Bus::QName& from_name();
00036         const IT_Bus::QName& replyto_name();
00037         const IT_Bus::QName& faultto_name();
00038         const IT_Bus::QName& reference_parameters_name();
00039 
00040         void
00041         set_message_id_header(
00042             MessageDirection                                direction,
00043             const WS_Addressing::AttributedURIType &        message_id
00044         );
00045         WS_Addressing::AttributedURIType*
00046         get_message_id_header(
00047             MessageDirection                                direction,
00048             bool                                            remove_from_context=false
00049         );
00050 
00051         void
00052         set_message_id_header(
00053             IT_Bus::ContextContainer* container,
00054             const WS_Addressing::AttributedURIType &        message_id
00055         );
00056         WS_Addressing::AttributedURIType*
00057         get_message_id_header(
00058             IT_Bus::ContextContainer* container,
00059             bool                                            remove_from_context=false
00060         );
00061 
00062         void
00063         set_to_header(
00064             MessageDirection                                direction,
00065             const WS_Addressing::AttributedURIType &        to
00066         );
00067         WS_Addressing::AttributedURIType*
00068         get_to_header(
00069             MessageDirection                                direction,
00070             bool                                            remove_from_context=false
00071         );
00072 
00073         void
00074         set_to_header(
00075              IT_Bus::ContextContainer*                      container,
00076             const WS_Addressing::AttributedURIType&         to
00077         );
00078 
00079         WS_Addressing::AttributedURIType*
00080         get_to_header(
00081             IT_Bus::ContextContainer*                       container,
00082             bool                                            remove_from_context=false
00083         );
00084 
00085         void
00086         set_action_header(
00087             MessageDirection                                direction,
00088             const WS_Addressing::AttributedURIType &        action
00089         );
00090         WS_Addressing::AttributedURIType*
00091         get_action_header(
00092             MessageDirection                                direction,
00093             bool                                            remove_from_context=false
00094         );
00095 
00096         void
00097         set_action_header(
00098             IT_Bus::ContextContainer*                       container,
00099             const WS_Addressing::AttributedURIType&         action
00100         );
00101 
00102         WS_Addressing::AttributedURIType*
00103         get_action_header(
00104             IT_Bus::ContextContainer*                       container,
00105             bool                                            remove_from_context=false
00106         );
00107 
00108         void
00109         set_from_header(
00110             MessageDirection                                direction,
00111             const WS_Addressing::EndpointReferenceType &    from
00112         );
00113 
00114         WS_Addressing::EndpointReferenceType*
00115         get_from_header(
00116             MessageDirection                                direction,
00117             bool                                            remove_from_context=false
00118         );
00119 
00120         void
00121         set_from_header(
00122             IT_Bus::ContextContainer*                       container,
00123             const WS_Addressing::EndpointReferenceType&     from
00124         );
00125         WS_Addressing::EndpointReferenceType*
00126         get_from_header(
00127             IT_Bus::ContextContainer*                       container,
00128             bool                                            remove_from_context=false
00129         );
00130 
00131         void
00132         set_reply_to_header(
00133             MessageDirection                                direction,
00134             const WS_Addressing::EndpointReferenceType &    reply_to
00135         );
00136 
00137         WS_Addressing::EndpointReferenceType*
00138         get_reply_to_header(
00139             MessageDirection                                direction,
00140             bool                                            remove_from_context=false
00141         );
00142 
00143         void
00144         set_reply_to_header(
00145             IT_Bus::ContextContainer*                       container,
00146             const WS_Addressing::EndpointReferenceType&     reply_to
00147         );
00148 
00149         WS_Addressing::EndpointReferenceType*
00150         get_reply_to_header(
00151             IT_Bus::ContextContainer*                       container,
00152             bool                                            remove_from_context=false
00153         );
00154 
00155         void
00156         set_fault_to_header(
00157             MessageDirection                                direction,
00158             const WS_Addressing::EndpointReferenceType &    fault_to
00159         );
00160 
00161         WS_Addressing::EndpointReferenceType*
00162         get_fault_to_header(
00163             MessageDirection                                direction,
00164             bool                                            remove_from_context=false
00165         );
00166 
00167         void
00168         set_reference_parameters_header(
00169             MessageDirection                                direction,
00170             const WS_Addressing::ReferenceParametersType&   ref_props
00171         );
00172 
00173         void
00174         set_reference_parameters_header(
00175             IT_Bus::ContextContainer*                       container,
00176             const WS_Addressing::ReferenceParametersType&   ref_props
00177         );
00178 
00179         WS_Addressing::ReferenceParametersType*
00180         get_reference_parameters_header(
00181             IT_Bus::ContextContainer*                       container,
00182             bool                                            remove_from_context=false
00183         );
00184 
00185         WS_Addressing::ReferenceParametersType*
00186         get_reference_parameters_header(
00187             MessageDirection                                direction,
00188             bool                                            remove_from_context=false
00189         );
00190 
00191         void
00192         clear_header_contexts(
00193             MessageDirection                                direction
00194         );
00195 
00196         void
00197         clear_header(
00198             MessageDirection                                direction,
00199             const IT_Bus::QName &                           header_id
00200         );
00201 
00202         void
00203         clear_header(
00204             IT_Bus::ContextContainer* container,
00205             const IT_Bus::QName&      header_id
00206         );
00207 
00208         // Populates multiple headers on Request message
00209         void
00210         populate_call_contexts(
00211             const WS_Addressing::AttributedURIType &        action,
00212             const WS_Addressing::EndpointReferenceType *    to_address,
00213             const WS_Addressing::EndpointReferenceType *    from_address,
00214             const WS_Addressing::EndpointReferenceType *    reply_to_address,
00215             const WS_Addressing::RelatesToType *            relates_to
00216         );
00217 
00218         void
00219         clear_call_contexts();
00220 
00221         void
00222         set_client_reply_timeout(
00223             IT_Bus::Int &                                   timeout
00224         );
00225 
00226         void
00227         set_client_request_timeout(
00228             IT_Bus::Int &                                   timeout
00229         );
00230 
00231         IT_Bus::ContextContainer*
00232         context_container(
00233             MessageDirection                                direction
00234         );
00235 
00236         IT_Bus::ContextRegistry*
00237         context_registry();
00238        
00239         static const IT_Bus::String                         WS_AddressingNamespace_ID;
00240         static const IT_Bus::String                         IT_WSAddressingNamespace_ID;
00241 
00242       protected:
00243         void resolve_services();
00244         void register_header_factories();
00245 
00246         IT_Bus::String
00247         make_message_id(
00248             const void*   ref_object
00249         );
00250 
00251         void
00252         populate_epr_ref_params_as_headers(
00253             const WS_Addressing::EndpointReferenceType&     epr,
00254             MessageDirection                                direction = IT_WSAddressing::Request,            
00255             IT_Bus::ContextContainer*                       context_container = 0
00256         );
00257 
00258       private:
00259         IT_Bus::Bus_ptr                                     m_bus;
00260         IT_Bus::ContextRegistry*                            m_context_registry;
00261 
00262         IT_Bus::QName                                       m_messageid_name;
00263         IT_Bus::QName                                       m_messageid_message_name;
00264         IT_Bus::QName                                       m_relatesto_name;
00265         IT_Bus::QName                                       m_relatesto_message_name;
00266         IT_Bus::QName                                       m_to_name;
00267         IT_Bus::QName                                       m_to_message_name;
00268         IT_Bus::QName                                       m_action_name;
00269         IT_Bus::QName                                       m_action_message_name;
00270         IT_Bus::QName                                       m_from_name;
00271         IT_Bus::QName                                       m_from_message_name;
00272         IT_Bus::QName                                       m_replyto_name;
00273         IT_Bus::QName                                       m_replyto_message_name;
00274         IT_Bus::QName                                       m_faultto_name;
00275         IT_Bus::QName                                       m_faultto_message_name;
00276         IT_Bus::QName                                       m_reference_parameters_name;
00277         IT_Bus::QName                                       m_reference_paramters_message_name;
00278     };
00279 
00280     inline IT_Bus::ContextRegistry*
00281     ContextSupport::context_registry() 
00282     {
00283         return m_context_registry;
00284     }
00285     
00286     inline const IT_Bus::QName&
00287     ContextSupport::messageid_name()
00288     {
00289         return m_messageid_name;
00290     }
00291     
00292     inline const IT_Bus::QName&
00293     ContextSupport::relatesto_name()
00294     {
00295         return m_relatesto_name;
00296     }
00297     
00298     inline const IT_Bus::QName&
00299     ContextSupport::to_name()
00300     {
00301         return m_to_name;
00302     }
00303     
00304     inline const IT_Bus::QName&
00305     ContextSupport::action_name()
00306     {
00307         return m_action_name;
00308     }
00309     
00310     inline const IT_Bus::QName&
00311     ContextSupport::from_name()
00312     {
00313         return m_from_name;
00314     }
00315     
00316     inline const IT_Bus::QName&
00317     ContextSupport::replyto_name()
00318     {
00319         return m_replyto_name;
00320     }
00321     
00322     inline const IT_Bus::QName&
00323     ContextSupport::faultto_name()
00324     {
00325         return m_faultto_name;
00326     }
00327 
00328     inline const IT_Bus::QName&
00329     ContextSupport::reference_parameters_name()
00330     {
00331         return m_reference_parameters_name;
00332     }
00333 }
00334 
00335 #endif /* IT_WS_ADDRESSING_CONTEXT_SUPPORT_ */
00336 
00337 

Generated on Wed Mar 22 12:23:15 2006 for Artix by  doxygen 1.3.9.1