savan_db_mgr.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004,2005 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef SAVAN_DB_MGR_H
00018 #define SAVAN_DB_MGR_H
00019 
00025 #include <platforms/axutil_platform_auto_sense.h>
00026 #include <axutil_allocator.h>
00027 #include <axutil_env.h>
00028 #include <axutil_error.h>
00029 #include <axutil_string.h>
00030 #include <axutil_utils.h>
00031 #include <axutil_array_list.h>
00032 #include <axis2_conf_ctx.h>
00033 #include <savan_subscriber.h>
00034 #include <sqlite3.h>
00035 
00036 #ifdef __cplusplus
00037 extern "C"
00038 {
00039 #endif
00040 
00041 typedef AXIS2_DECLARE_DATA struct savan_db_mgr_args
00042 {
00043     const axutil_env_t *env;
00044     void *data;
00045 } savan_db_mgr_args_t;
00046 
00051 typedef struct savan_db_mgr
00052 {
00053     axis2_conf_ctx_t *conf_ctx;
00054 }savan_db_mgr_t;
00055 
00056 AXIS2_EXTERN savan_db_mgr_t * AXIS2_CALL
00057 savan_db_mgr_create(
00058     const axutil_env_t *env,
00059     axis2_conf_ctx_t *conf_ctx);
00060 
00061 AXIS2_EXTERN void AXIS2_CALL
00062 savan_db_mgr_free(
00063     savan_db_mgr_t *db_mgr,
00064     const axutil_env_t *env);
00065 
00066 AXIS2_EXTERN int 
00067 savan_db_mgr_topic_find_callback(
00068     void *not_used, 
00069     int argc, 
00070     char **argv, 
00071     char **col_name);
00072 
00073 AXIS2_EXTERN int 
00074 savan_db_mgr_subs_find_callback(
00075     void *not_used, 
00076     int argc, 
00077     char **argv, 
00078     char **col_name);
00079 
00080 AXIS2_EXTERN int 
00081 savan_db_mgr_subs_retrieve_callback(
00082     void *not_used, 
00083     int argc, 
00084     char **argv, 
00085     char **col_name);
00086 
00087 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00088 savan_db_mgr_insert_subscriber(
00089     savan_db_mgr_t *db_mgr,
00090     const axutil_env_t *env,
00091     savan_subscriber_t *subscriber);
00092 
00093 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00094 savan_db_mgr_update_subscriber(
00095     savan_db_mgr_t *db_mgr,
00096     const axutil_env_t *env,
00097     savan_subscriber_t *subscriber);
00098 
00099 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00100 savan_db_mgr_insert_topic(
00101     savan_db_mgr_t *db_mgr,
00102     const axutil_env_t *env,
00103     axis2_char_t *topic_name,
00104     axis2_char_t *topic_url);
00105 
00106 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00107 savan_db_mgr_remove(
00108     savan_db_mgr_t *db_mgr,
00109     const axutil_env_t *env,
00110     axis2_char_t *sql_stmt_remove);
00111 
00112 AXIS2_EXTERN savan_subscriber_t *AXIS2_CALL
00113 savan_db_mgr_retrieve(
00114     savan_db_mgr_t *db_mgr,
00115     const axutil_env_t *env,
00116     int (*retrieve_func)(void *, int, char **, char **),
00117     axis2_char_t *sql_stmt_retrieve);
00118 
00119 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00120 savan_db_mgr_update(
00121     savan_db_mgr_t *db_mgr,
00122     const axutil_env_t *env,
00123     axis2_char_t *sql_stmt_update);
00124 
00125 AXIS2_EXTERN axutil_array_list_t * AXIS2_CALL
00126 savan_db_mgr_retrieve_all(
00127     savan_db_mgr_t *db_mgr,
00128     const axutil_env_t *env,
00129     int (*find_func)(void *, int, char **, char **),
00130     axis2_char_t *sql_stmt_find);
00131 
00132 AXIS2_EXTERN void * AXIS2_CALL
00133 savan_db_mgr_get_dbconn(
00134     savan_db_mgr_t *db_mgr, 
00135     const axutil_env_t *env);
00136 
00137 AXIS2_EXTERN axis2_char_t *AXIS2_CALL
00138 savan_db_mgr_create_insert_sql(
00139     const axutil_env_t *env,
00140     savan_subscriber_t *subscriber,
00141     axis2_conf_ctx_t *conf_ctx);
00142 
00143 axis2_char_t *AXIS2_CALL
00144 savan_db_mgr_create_update_sql(
00145     const axutil_env_t *env,
00146     savan_subscriber_t *subscriber,
00147     axis2_conf_ctx_t *conf_ctx);
00148 
00150 #ifdef __cplusplus
00151 }
00152 #endif
00153 #endif /* SAVAN_DB_MGR_H */

Generated on Sun Oct 7 11:06:39 2007 for Savan/C by  doxygen 1.5.1