it_bus_services/session_manager_service.h

00001 #ifndef _IT_BUS_SERVICES_SESSION_MANAGER_SERVICE_H_
00002 #define _IT_BUS_SERVICES_SESSION_MANAGER_SERVICE_H_
00003 
00004 // @Copyright 2004 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 
00007 #if !defined(IT_WS_SM_SERVICE_API)
00008 #if defined(IT_WS_SM_SERVICE_API_EXPORT)
00009 #define IT_WS_SM_SERVICE_API    IT_DECLSPEC_EXPORT
00010 #else
00011 #define IT_WS_SM_SERVICE_API    IT_DECLSPEC_IMPORT
00012 #endif
00013 #endif
00014 
00015 #ifndef IT_MINIMISE_INCLUDES
00016 #include <it_bus/bus.h>
00017 #endif
00018 
00019 #include <it_bus/types.h>
00020 #include <it_bus/bus_type_alias.h>
00021 
00022 namespace IT_Bus
00023 {
00024     class QName;
00025 }
00026 namespace IT_Bus_Services
00027 {
00028     namespace IT_SessionManager
00029     {
00030         // SessionManager contexts
00031         extern const IT_WS_SM_SERVICE_API IT_Bus::QName SESSION_ID_CONTEXT_NAME;
00032         extern const IT_Bus::QName SESSION_ID_MESSAGE_NAME;
00033         extern const IT_Bus::String SESSION_ID_PART_NAME;
00034 
00035         class IT_WS_SM_SERVICE_API SessionCreationException
00036         {
00037           public:
00038             SessionCreationException(
00039                 const IT_Bus::String & error
00040             ) : m_error(error)
00041             {
00042                 // complete
00043             }
00044 
00045             const IT_Bus::String &
00046             get_error() const
00047             {
00048                 return m_error;
00049             }
00050 
00051           private:
00052 
00053             IT_Bus::String m_error;
00054         };
00055 
00056         class IT_WS_SM_SERVICE_API SessionRenewException
00057         {
00058           public:
00059             SessionRenewException(
00060                 const IT_Bus::String & error
00061             ) : m_error(error)
00062             {
00063                 // complete
00064             }
00065 
00066             const IT_Bus::String &
00067             get_error() const
00068             {
00069                 return m_error;
00070             }
00071 
00072           private:
00073 
00074             IT_Bus::String m_error;
00075         };
00076 
00077 
00078         class IT_WS_SM_SERVICE_API SessionManagementPolicyCallback
00079         {
00080           public:
00081 
00082             virtual void
00083             begin_session(
00084                 const IT_Bus::String& group,
00085                 const IT_Bus::String& id,
00086                 const IT_Bus::ULong&  preferred_renew_timeout,
00087                 IT_Bus::ULong&        allocated_renew_timeout
00088             ) throw((SessionCreationException)) = 0;
00089 
00090             virtual void
00091             renew_session(
00092                 const IT_Bus::String& group,
00093                 const IT_Bus::String& id,
00094                 const IT_Bus::ULong&  preferred_renew_timeout,
00095                 IT_Bus::ULong&        allocated_renew_timeout
00096             ) throw((SessionRenewException)) = 0;
00097 
00098             virtual void
00099             end_session(
00100                 const IT_Bus::String& group,
00101                 const IT_Bus::String& id
00102             ) = 0;
00103         };
00104 
00105         class IT_WS_SM_SERVICE_API SessionManagerService
00106         {
00107             public:
00108 
00109             static void
00110             register_policy_callback(
00111                 IT_Bus::Bus_ptr bus,
00112                 SessionManagementPolicyCallback & callback
00113             ) throw((IT_Bus::Exception));
00114 
00115             static void
00116             deregister_policy_callback(
00117                 IT_Bus::Bus_ptr bus
00118             );
00119         };
00120     }
00121 }
00122 
00123 #endif  

Generated on Tue Mar 20 15:27:53 2007 for Artix by  doxygen 1.5.1-p1