it_bus_pdk/db_config.h

00001 #ifndef _IT_DB_CONFIG_H_
00002 #define _IT_DB_CONFIG_H_
00003 
00004 // @Copyright 2004 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 
00007 #ifndef IT_MINIMISE_INCLUDES
00008 #include <it_bus/bus.h>
00009 #endif
00010 
00011 #include <it_dsa/vector.h>
00012 #include <it_bus/types.h>
00013 #include <it_bus/api_defines.h>
00014 #include <it_bus/bus_type_alias.h>
00015 #include <omg/orb.hh>
00016 #include <orbix/configuration.hh>
00017 #include <it_bus_pdk/db_exception.h>
00018 #include <it_bus/logging_defs.h>
00019 
00020 // Forward declare some required structures
00021 //
00022 struct __db;
00023 typedef struct __db DB;
00024 struct __db_env;
00025 typedef struct __db_env DB_ENV;
00026 struct __dbc;           
00027 typedef struct __dbc DBC;
00028 
00029 namespace IT_Bus
00030 {   
00031     class DBEnv;
00032     class QName;
00033     class String;
00034 
00035     class IT_DBM_API DBConfig
00036     {
00037       public:           
00038         
00039         DBConfig(
00040             IT_Bus::Bus_ptr bus
00041         ) IT_THROW_DECL((DBException));
00042 
00043         virtual
00044         ~DBConfig();
00045 
00046         virtual void
00047         init_configuration();
00048 
00049         virtual void
00050         init_env();
00051 
00052         virtual DBEnv*
00053         get_env() 
00054         IT_THROW_DECL((DBException));
00055 
00056         virtual IT_Bus::Bus_ptr
00057         get_bus();
00058 
00059         // Configuration related functions
00060 
00061         virtual const char*
00062         get_env_home();
00063 
00064         virtual const char*
00065         get_env_name(); 
00066 
00067         virtual IT_Config::ConfigList*
00068         get_replica_list();     
00069 
00070         virtual IT_Bool
00071         is_replicated();
00072 
00073         virtual IT_Bool
00074         is_master();
00075 
00076         virtual unsigned int
00077         get_pre_sync_wait_period();
00078 
00079         virtual unsigned int
00080         get_sync_retry_attempts();
00081 
00082         virtual IT_Long
00083         get_priority();
00084 
00085         virtual IT_Long
00086         get_port();
00087 
00088         virtual const char*
00089         get_replica_name();     
00090 
00091         virtual unsigned int
00092         get_db_open_retry_attempts();
00093 
00094         virtual unsigned int
00095         get_inter_db_open_sleep_period();
00096 
00097         virtual unsigned int
00098         get_ping_retry_interval();
00099 
00100         virtual unsigned int
00101         get_max_ping_retries();
00102 
00103         virtual unsigned int
00104         get_ping_lifetime();
00105 
00106         virtual unsigned int
00107         get_roundtrip_timeout();
00108 
00109         virtual unsigned int
00110         get_election_timeout();
00111 
00112         virtual unsigned int
00113         get_cnxn_creation_timeout();
00114 
00115         virtual const char*
00116         get_errfile_name();
00117 
00118         virtual IT_Bool
00119         get_verbose_logging();
00120 
00121         virtual IT_Bool
00122         get_download_files();
00123 
00124         virtual unsigned long
00125         get_checkpoint_period();
00126 
00127         virtual unsigned long
00128         get_max_buffered_msgs();
00129 
00130         virtual unsigned long
00131         get_max_msg_buffer_size();
00132 
00133         virtual IT_Bool
00134         get_allow_minority_master();
00135 
00136         virtual IT_Bool
00137         get_use_shutdown_hook();
00138 
00139         virtual IT_Bool
00140         get_auto_demotion();
00141 
00142         virtual const char*
00143         get_orb_scope();
00144 
00145         void
00146         mark_as_write_operations(
00147             const IT_Vector<IT_Bus::String>&    operations,         
00148             const IT_Bus::QName&                service,
00149             const IT_Bus::String&               port,
00150             const IT_Bus::String&               wsdl_url
00151         ) IT_THROW_DECL((DBException));
00152 
00153       private:
00154 
00155         IT_Bus::Bus_var             m_bus;
00156         DBEnv*                      m_db_env;
00157         CORBA::String_var           m_db_home;
00158         CORBA::String_var           m_db_env_name;      
00159         CORBA::String_var           m_replica_name;
00160         CORBA::String_var           m_orb_scope;
00161         IT_Config::ConfigList_var   m_replicas_from_config;
00162         IT_Long                     m_priority;
00163         IT_Long                     m_port;
00164         IT_Long                     m_db_open_retry_attempts;
00165         IT_Long                     m_inter_db_open_sleep_period;
00166         IT_Long                     m_pre_sync_wait_period;
00167         IT_Long                     m_sync_retry_attempts;
00168         IT_Long                     m_max_ping_retries;
00169         IT_Long                     m_ping_lifetime;
00170         IT_Long                     m_ping_retry_interval;
00171         IT_Long                     m_roundtrip_timeout;
00172         IT_Long                     m_election_timeout;
00173         IT_Long                     m_cnxn_creation_timeout;
00174         CORBA::String_var           m_errfile_name;
00175         IT_Bool                     m_verbose_logging;
00176         IT_Bool                     m_allow_minority_master;
00177         IT_Bool                     m_use_shutdown_hook;
00178         IT_Bool                     m_auto_demotion;
00179         IT_Bool                     m_download_files;
00180         IT_Long                     m_checkpoint_period;
00181         IT_Long                     m_max_buffered_msgs;
00182         IT_Long                     m_max_msg_buffer_size;      
00183 
00184         // private and unimplemented to prevent copying
00185         DBConfig(const DBConfig&);
00186         void operator=(const DBConfig&);
00187 
00188         IT_DECLARE_BUS_LOGGER_MEM
00189     };
00190 }
00191 
00192 #endif  

Generated on Thu Sep 7 11:39:32 2006 for Artix by  doxygen 1.4.7