00001 #ifndef _IT_BUS_SERVICES_SESSION_MANAGER_SERVICE_H_
00002 #define _IT_BUS_SERVICES_SESSION_MANAGER_SERVICE_H_
00003
00004
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 #include <it_bus/types.h>
00016 #include <it_bus/bus.h>
00017
00018 namespace IT_Bus_Services
00019 {
00020 namespace IT_SessionManager
00021 {
00022
00023 extern const IT_WS_SM_SERVICE_API IT_Bus::QName SESSION_ID_CONTEXT_NAME;
00024 extern const IT_Bus::QName SESSION_ID_MESSAGE_NAME;
00025 extern const IT_Bus::String SESSION_ID_PART_NAME;
00026
00027 class IT_WS_SM_SERVICE_API SessionCreationException
00028 {
00029 public:
00030 SessionCreationException(
00031 const IT_Bus::String & error
00032 ) : m_error(error)
00033 {
00034
00035 }
00036
00037 const IT_Bus::String &
00038 get_error() const
00039 {
00040 return m_error;
00041 }
00042
00043 private:
00044
00045 IT_Bus::String m_error;
00046 };
00047
00048 class IT_WS_SM_SERVICE_API SessionRenewException
00049 {
00050 public:
00051 SessionRenewException(
00052 const IT_Bus::String & error
00053 ) : m_error(error)
00054 {
00055
00056 }
00057
00058 const IT_Bus::String &
00059 get_error() const
00060 {
00061 return m_error;
00062 }
00063
00064 private:
00065
00066 IT_Bus::String m_error;
00067 };
00068
00069
00070 class IT_WS_SM_SERVICE_API SessionManagementPolicyCallback
00071 {
00072 public:
00073
00074 virtual void
00075 begin_session(
00076 const IT_Bus::String& group,
00077 const IT_Bus::String& id,
00078 const IT_Bus::ULong& preferred_renew_timeout,
00079 IT_Bus::ULong& allocated_renew_timeout
00080 ) throw((SessionCreationException)) = 0;
00081
00082 virtual void
00083 renew_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((SessionRenewException)) = 0;
00089
00090 virtual void
00091 end_session(
00092 const IT_Bus::String& group,
00093 const IT_Bus::String& id
00094 ) = 0;
00095 };
00096
00097 class IT_WS_SM_SERVICE_API SessionManagerService
00098 {
00099 public:
00100
00101 static void
00102 register_policy_callback(
00103 IT_Bus::Bus_ptr bus,
00104 SessionManagementPolicyCallback & callback
00105 ) throw((IT_Bus::Exception));
00106
00107 static void
00108 deregister_policy_callback(
00109 IT_Bus::Bus_ptr bus
00110 );
00111 };
00112 }
00113 }
00114
00115 #endif