[wsf-c-dev] svn commit r372 - wsf/c/build/xmpp/include
svn at wso2.com
svn at wso2.com
Mon Jan 8 22:34:00 PST 2007
Author: sanjaya
Date: Mon Jan 8 22:33:51 2007
New Revision: 372
Added:
wsf/c/build/xmpp/include/axis2_xmpp_server.h
wsf/c/build/xmpp/include/axis2_xmpp_svr_thread.h
wsf/c/build/xmpp/include/axis2_xmpp_transport.h
wsf/c/build/xmpp/include/axis2_xmpp_transport_sender.h
wsf/c/build/xmpp/include/axis2_xmpp_transport_utils.h
wsf/c/build/xmpp/include/axis2_xmpp_worker.h
Log:
Added new headers
Added: wsf/c/build/xmpp/include/axis2_xmpp_server.h
==============================================================================
--- (empty file)
+++ wsf/c/build/xmpp/include/axis2_xmpp_server.h Mon Jan 8 22:33:51 2007
@@ -0,0 +1,65 @@
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* xmpp://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef AXIS2_XMPP_SERVER_H
+#define AXIS2_XMPP_SERVER_H
+
+/**
+ * @defgroup axis2_xmpp_server xmpp server
+ * @ingroup axis2_core_trans_xmpp
+ * @{
+ */
+
+/**
+ * @file axis2_xmpp_server.h
+ * @brief axis2 XMPP Server implementation
+ */
+
+#include <axis2_const.h>
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axis2_conf_ctx.h>
+#include <axis2_transport_receiver.h>
+
+#include <axis2_xmpp_worker.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ int axis2_xmpp_socket_read_timeout = 0;
+
+ AXIS2_EXTERN axis2_transport_receiver_t *AXIS2_CALL
+ axis2_xmpp_server_create (
+ const axis2_env_t *env,
+ const axis2_char_t *repo,
+ const int port,
+ int use_sasl,
+ int use_tls,
+ int subscribe);
+
+ axis2_status_t AXIS2_CALL
+ axis2_xmpp_server_stop(
+ axis2_transport_receiver_t *server,
+ const axis2_env_t *env);
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AXIS2_XMPP_SERVER_H */
Added: wsf/c/build/xmpp/include/axis2_xmpp_svr_thread.h
==============================================================================
--- (empty file)
+++ wsf/c/build/xmpp/include/axis2_xmpp_svr_thread.h Mon Jan 8 22:33:51 2007
@@ -0,0 +1,175 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * xmpp://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_XMPP_SVR_THREAD_H
+#define AXIS2_XMPP_SVR_THREAD_H
+
+/**
+ * @defgroup axis2_xmpp_svr_thread xmpp server thread
+ * @ingroup axis2_core_trans_xmpp
+ * @{
+ */
+
+/**
+ * @file axis2_xmpp_svr_thread.h
+ * @brief axis2 XMPP server listning thread implementation
+ */
+
+#include <axis2_const.h>
+#include <axis2_defines.h>
+#include <axis2_env.h>
+
+#include <axis2_xmpp_worker.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ /** Type name for struct axist_xmpp_svr_thread_ops */
+ typedef struct axis2_xmpp_svr_thread_ops axis2_xmpp_svr_thread_ops_t;
+ /** Type name for struct axist_xmpp_svr_thread */
+ typedef struct axis2_xmpp_svr_thread axis2_xmpp_svr_thread_t;
+
+ extern int axis2_xmpp_socket_read_timeout;
+
+ /**
+ * XMPP Server Thread ops struct
+ * Encapsulator struct for ops of axis2_xmpp_svr_thread
+ */
+ struct axis2_xmpp_svr_thread_ops
+ {
+ /**
+ * @param svr_thread pointer to server thread
+ * @param env pointer to environment struct
+ */
+ axis2_status_t (AXIS2_CALL *
+ run)(
+ axis2_xmpp_svr_thread_t *svr_thread,
+ const axis2_env_t *env);
+
+ /**
+ * @param svr_thread pointer to server thread
+ * @param env pointer to environment struct
+ */
+ axis2_status_t (AXIS2_CALL *
+ destroy)(
+ axis2_xmpp_svr_thread_t *svr_thread,
+ const axis2_env_t *env);
+
+ /**
+ * @param svr_thread pointer to server thread
+ * @param env pointer to environment struct
+ */
+ int (AXIS2_CALL *
+ get_local_port)(
+ const axis2_xmpp_svr_thread_t *svr_thread,
+ const axis2_env_t *env);
+
+ /**
+ * @param svr_thread pointer to server thread
+ * @param env pointer to environment struct
+ */
+ axis2_bool_t (AXIS2_CALL *
+ is_running)(
+ axis2_xmpp_svr_thread_t *svr_thread,
+ const axis2_env_t *env);
+
+ /**
+ * @param svr_thread pointer to server thread
+ * @param env pointer to environment struct
+ * @param worker pointer to worker
+ */
+ axis2_status_t (AXIS2_CALL *
+ set_worker)(
+ axis2_xmpp_svr_thread_t *svr_thread,
+ const axis2_env_t *env,
+ axis2_xmpp_worker_t *worker);
+
+ /**
+ * @param svr_thread pointer to server thread
+ * @param env pointer to environment struct
+ */
+ axis2_status_t (AXIS2_CALL *
+ free)(
+ axis2_xmpp_svr_thread_t *svr_thread,
+ const axis2_env_t *env);
+ };
+
+ /**
+ * axis2 xmpp server thread
+ */
+ struct axis2_xmpp_svr_thread
+ {
+ /** operations of axis2 xmpp server thread */
+ axis2_xmpp_svr_thread_ops_t *ops;
+ };
+
+ /**
+ * @param env pointer to environment struct
+ * @param port
+ */
+ AXIS2_EXTERN axis2_xmpp_svr_thread_t *AXIS2_CALL
+ axis2_xmpp_svr_thread_create (
+ const axis2_env_t *env,
+ int port,
+ axis2_conf_ctx_t *conf_ctx,
+ int use_sasl,
+ int use_tls,
+ int subscribe);
+
+/************************** Start of function macros **************************/
+
+/** Run.
+ @sa axis2_xmpp_svr_thread_ops#run */
+#define AXIS2_XMPP_SVR_THREAD_RUN(svr_thread, env) \
+ ((svr_thread)->ops->run(svr_thread, env))
+
+/** Destroy.
+ @sa axis2_xmpp_svr_thread_ops#destroy */
+#define AXIS2_XMPP_SVR_THREAD_DESTROY(svr_thread, env) \
+ ((svr_thread)->ops->destroy(svr_thread, env))
+
+/** Gets the local port.
+ @sa axis2_xmpp_svr_thread_ops#get_local_port */
+#define AXIS2_XMPP_SVR_THREAD_GET_LOCAL_PORT(svr_thread, env) \
+ ((svr_thread)->ops->get_local_port(svr_thread,\
+ env))
+
+/** Is running.
+ @sa axis2_xmpp_svr_thread_ops#is_running */
+#define AXIS2_XMPP_SVR_THREAD_IS_RUNNING(svr_thread, env) \
+ ((svr_thread)->ops->is_running(svr_thread, env))
+
+/** Set worker.
+ @sa axis2_xmpp_svr_thread_ops#set_worker */
+#define AXIS2_XMPP_SVR_THREAD_SET_WORKER(svr_thread, env, worker) \
+ ((svr_thread)->ops->set_worker(svr_thread, env,\
+ worker))
+
+/** Frees the xmpp_svr_thread.
+ @sa axis2_xmpp_svr_thread_ops#free */
+#define AXIS2_XMPP_SVR_THREAD_FREE(svr_thread, env) \
+ ((svr_thread)->ops->free(svr_thread, env))
+
+/************************** End of function macros ****************************/
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AXIS2_XMPP_SVR_THREAD_H */
Added: wsf/c/build/xmpp/include/axis2_xmpp_transport.h
==============================================================================
--- (empty file)
+++ wsf/c/build/xmpp/include/axis2_xmpp_transport.h Mon Jan 8 22:33:51 2007
@@ -0,0 +1,108 @@
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain count copy of the License at
+*
+* xmpp://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef AXIS2_XMPP_TRANSPORT_H
+#define AXIS2_XMPP_TRANSPORT_H
+
+#include <axis2_const.h>
+#include <axis2_error.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @defgroup axis2_core_trans_xmpp xmpp transport
+ * @ingroup axis2_transport
+ * Description.
+ * @{
+ */
+
+/**
+ * @defgroup axis2_core_transport_xmpp core xmpp transport
+ * @ingroup axis2_core_trans_xmpp
+ * @{
+ */
+
+/**
+ * @brief XMPP protocol and message context constants.
+ *
+ */
+#define AXIS2_XMPP_PARSER "XMPP_PARSER"
+
+/**
+ * DEFAULT_SO_TIMEOUT
+ */
+#define AXIS2_XMPP_DEFAULT_SO_TIMEOUT 30000
+
+/**
+ * DEFAULT_CONNECTION_TIMEOUT
+ */
+#define AXIS2_XMPP_DEFAULT_CONNECTION_TIMEOUT 60000
+
+/**
+ * Field TRANSPORT_XMPP
+ */
+#define AXIS2_TRANSPORT_XMPP "xmpp"
+
+/**
+ * JID of the client
+ */
+#define AXIS2_XMPP_CLIENT_JID "XMPP_CLIENT_JID"
+
+/**
+ * Key for the XMPP properties hash table
+ */
+#define AXIS2_XMPP_PROPERTIES "XMPP_PROPERTIES"
+
+/**
+ * Parameter which maps a service to a JID
+ */
+#define AXIS2_XMPP_PARAM_ID "xmpp_id"
+
+
+/**
+ * Password for the given JID
+ */
+#define AXIS2_XMPP_PARAM_PASSWORD "xmpp_password"
+
+/**
+ * A JID to which the service should subscribe
+ */
+#define AXIS2_XMPP_PARAM_SUBSCRIBE_TO "xmpp_subscribe_to"
+
+/**
+ *
+ * The type of the XMPP entity to subscribe
+ */
+#define AXIS2_XMPP_PARAM_SUBSCRIBE_TYPE "xmpp_subscribe_type"
+
+
+/* Error codes */
+#define AXIS2_XMPP_ERROR_START (AXIS2_ERROR_LAST + 3000)
+#define AXIS2_XMPP_PARSER_CREATE_FAILED (AXIS2_XMPP_ERROR_START + 0)
+#define AXIS2_XMPP_SERVER_CONNECT_FAILED (AXIS2_XMPP_ERROR_START + 1)
+
+/* Subscribe entity types */
+#define AXIS2_XMPP_SUB_TYPE_USER "user"
+#define AXIS2_XMPP_SUB_TYPE_ROOM "room"
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AXIS2_XMPP_TRANSPORT_H */
Added: wsf/c/build/xmpp/include/axis2_xmpp_transport_sender.h
==============================================================================
--- (empty file)
+++ wsf/c/build/xmpp/include/axis2_xmpp_transport_sender.h Mon Jan 8 22:33:51 2007
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * xmpp://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_XMPP_TRANSPORT_SENDER_H
+#define AXIS2_XMPP_TRANSPORT_SENDER_H
+
+/**
+ * @defgroup axis2_xmpp_transport_sender xmpp transport sender
+ * @ingroup axis2_core_trans_xmpp
+ * @{
+ */
+
+/**
+ * @file axis2_xmpp_transport_sender.h
+ * @brief axis2 XMPP Transport Sender (Handler) implementation
+ */
+
+#include <axis2_const.h>
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axis2_msg_ctx.h>
+#include <axis2_conf_ctx.h>
+#include <axis2_transport_out_desc.h>
+#include <axis2_transport_sender.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ /**
+ * @param env pointer to environment struct
+ */
+ AXIS2_EXTERN axis2_transport_sender_t *AXIS2_CALL
+ axis2_xmpp_transport_sender_create(
+ const axis2_env_t *env);
+
+
+ /** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AXIS2_XMPP_TRANSPORT_SENDER_H */
Added: wsf/c/build/xmpp/include/axis2_xmpp_transport_utils.h
==============================================================================
--- (empty file)
+++ wsf/c/build/xmpp/include/axis2_xmpp_transport_utils.h Mon Jan 8 22:33:51 2007
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * xmpp://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_XMPP_TRANSPORT_UTILS_H
+#define AXIS2_XMPP_TRANSPORT_UTILS_H
+
+/**
+ * @ingroup axis2_core_transport_xmpp
+ * @{
+ */
+
+
+/**
+ * @file axis2_xmpp_transport_utils.h
+ * @brief axis2 XMPP Transport Utility class
+ */
+
+#include <axis2_const.h>
+#include <axis2_stream.h>
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axis2_hash.h>
+#include <axis2_msg_ctx.h>
+#include <axis2_conf_ctx.h>
+#include <axiom.h>
+#include <axiom_soap.h>
+
+#include <axis2_xmpp_worker.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+ /**
+ * @param env pointer to environment struct
+ * @param data struct holding XMPP session data
+ * @param soap_msg serialized soap message
+ * @param from JID of requesting client
+ */
+
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_xmpp_transport_utils_process_message(
+ const axis2_env_t *env,
+ axis2_xmpp_session_data_t *session,
+ axis2_char_t *soap_msg,
+ axis2_char_t *from,
+ axis2_char_t *request_uri);
+
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_xmpp_transport_utils_process_presence(
+ const axis2_env_t *env,
+ axis2_xmpp_session_data_t *session,
+ axis2_char_t *presence_str,
+ axis2_char_t *request_uri);
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AXIS2_XMPP_TRANSPORT_UTILS_H */
Added: wsf/c/build/xmpp/include/axis2_xmpp_worker.h
==============================================================================
--- (empty file)
+++ wsf/c/build/xmpp/include/axis2_xmpp_worker.h Mon Jan 8 22:33:51 2007
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * xmpp://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_XMPP_WORKER_H
+#define AXIS2_XMPP_WORKER_H
+
+/**
+ * @defgroup axis2_xmpp_worker xmpp worker
+ * @ingroup axis2_core_trans_xmpp
+ * @{
+ */
+
+/**
+ * @file axis2_xmpp_worker.h
+ * @brief axis2 XMPP Worker
+ */
+
+#include <iksemel.h>
+
+#include <axis2_const.h>
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axis2_conf_ctx.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ typedef struct axis2_xmpp_session_data
+ {
+ char* id_str; /* JID in string form */
+ axis2_char_t *server; /* XMPP server name */
+ axis2_char_t *user; /* User ID */
+ axis2_char_t *password;
+
+ char* subscribe_to; /* JID to subscribe to receive presence */
+ char* subscribe_type; /* Type of the JID to subscribe (user|room) */
+ char* subscribe_op; /* Operation to recv presence notifications */
+
+ char* session_id; /* Session ID returned by server */
+ iksparser *parser; /* iksemel parser instance */
+ iksfilter *filter; /* iksemel filter */
+ iksid *jid; /* JID in iks form */
+
+ int authorized; /* Whether session authorized or not */
+ int features; /* Stream features */
+ int use_sasl; /* Whether to SASL or not */
+ int use_tls; /* Whether to use TLS or not */
+ int subscribe; /* Whether to subscribe for events or not */
+
+ axis2_env_t *env;
+ axis2_conf_ctx_t* conf_ctx;
+ axis2_svc_t *svc;
+
+ }axis2_xmpp_session_data_t;
+
+ /** Type name for struct axis2_xmpp_worker_ops */
+ typedef struct axis2_xmpp_worker_ops axis2_xmpp_worker_ops_t;
+ /** Type name for struct axis2_xmpp_worker */
+ typedef struct axis2_xmpp_worker axis2_xmpp_worker_t;
+
+ /**
+ * XMPP Worker ops struct
+ * Encapsulator struct for ops of axis2_xmpp_worker
+ */
+ struct axis2_xmpp_worker_ops
+ {
+ /**
+ * @param xmpp_worker pointer to xmpp worker
+ * @param env pointer to environment struct
+ */
+ axis2_status_t (AXIS2_CALL *
+ run)(
+ axis2_xmpp_worker_t *worker,
+ const axis2_env_t *env);
+
+ /**
+ * @param xmpp_worker pointer to xmpp worker
+ * @param env pointer to environment struct
+ * @param port
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ axis2_status_t (AXIS2_CALL *
+ set_svr_port)(
+ axis2_xmpp_worker_t *xmpp_worker,
+ const axis2_env_t *env,
+ int port);
+
+ /**
+ * @param xmpp_worker pointer to xmpp worker
+ * @param env pointer to environment strut
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ axis2_status_t (AXIS2_CALL *
+ free)(
+ axis2_xmpp_worker_t *xmpp_worker,
+ const axis2_env_t *env);
+ };
+
+ /**
+ * axis2 xmpp worker
+ */
+ struct axis2_xmpp_worker
+ {
+ /** operations of axis2 xmpp worker */
+ axis2_xmpp_worker_ops_t *ops;
+ };
+
+
+ /**
+ * @param env pointer to environment struct
+ * @param data pointer to XMPP data struct
+ */
+ AXIS2_EXTERN axis2_xmpp_worker_t * AXIS2_CALL
+ axis2_xmpp_worker_create (
+ const axis2_env_t *env,
+ axis2_xmpp_session_data_t *data);
+
+ /**
+ * @param data pointer to xmpp session data struct
+ */
+ AXIS2_EXTERN void AXIS2_CALL
+ axis2_xmpp_session_data_init (
+ axis2_xmpp_session_data_t *data);
+
+/* Start of function macros ***************************************************/
+
+/** Start the worker. Will connect to the XMPP server and will
+ go in to the receive loop
+ @sa axis2_xmpp_worker_ops#run */
+#define AXIS2_XMPP_WORKER_RUN(xmpp_worker, env) \
+ ((xmpp_worker)->ops->run(xmpp_worker, env))
+
+/** Sets the server port.
+ @sa axis2_xmpp_worker_ops#set_svr_port */
+#define AXIS2_XMPP_WORKER_SET_SVR_PORT(xmpp_worker, env, port) \
+ ((xmpp_worker)->ops->set_svr_port(xmpp_worker, env, port))
+
+/** Frees the xmpp worker.
+ @sa axis2_xmpp_worker_ops#free */
+#define AXIS2_XMPP_WORKER_FREE(xmpp_worker, env) \
+ ((xmpp_worker)->ops->free(xmpp_worker, env))
+
+/* End of function macros *****************************************************/
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AXIS2_XMPP_WORKER_H */
More information about the Wsf-c-dev
mailing list