You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by da...@apache.org on 2008/08/30 17:47:21 UTC
svn commit: r690524 - in /webservices/sandesha/trunk/c:
include/sandesha2_constants.h src/msgprocessors/app_msg_processor.c
src/util/msg_creator.c
Author: damitha
Date: Sat Aug 30 08:47:21 2008
New Revision: 690524
URL: http://svn.apache.org/viewvc?rev=690524&view=rev
Log:
Adding LastMsgNumber into terminate sequence message originated from server side
Modified:
webservices/sandesha/trunk/c/include/sandesha2_constants.h
webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
webservices/sandesha/trunk/c/src/util/msg_creator.c
Modified: webservices/sandesha/trunk/c/include/sandesha2_constants.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_constants.h?rev=690524&r1=690523&r2=690524&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_constants.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_constants.h Sat Aug 30 08:47:21 2008
@@ -255,6 +255,8 @@
#define SANDESHA2_SEQ_PROP_OUT_CREATE_SEQ_SENT "OutCreateSeqSent"
#define SANDESHA2_SEQ_PROP_NEXT_MESSAGE_NUMBER "NextMsgNo"
+
+ #define SANDESHA2_SEQ_PROP_LAST_OUT_MESSAGE_NUMBER "LastOutMsgNo"
#define SANDESHA2_SEQ_PROP_INCOMING_SEQ_LIST "IncomingSequenceList"
Modified: webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c?rev=690524&r1=690523&r2=690524&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Sat Aug 30 08:47:21 2008
@@ -194,6 +194,13 @@
long msg_num,
sandesha2_seq_property_mgr_t *seq_prop_mgr);
+static axis2_status_t AXIS2_CALL
+sandesha2_app_msg_processor_set_last_out_msg_no(
+ const axutil_env_t *env,
+ axis2_char_t *internal_seq_id,
+ long msg_num,
+ sandesha2_seq_property_mgr_t *seq_prop_mgr);
+
static axis2_status_t AXIS2_CALL
sandesha2_app_msg_processor_free (
sandesha2_msg_processor_t *element,
@@ -2774,7 +2781,9 @@
AXIS2_PARAM_CHECK(env->error, storage_mgr, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, sender_mgr, AXIS2_FAILURE);
-
+
+ sandesha2_app_msg_processor_set_last_out_msg_no(env, internal_sequence_id, msg_num, seq_prop_mgr);
+
app_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx, env);
conf_ctx = axis2_msg_ctx_get_conf_ctx(app_msg_ctx, env);
to_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, internal_sequence_id,
@@ -3875,4 +3884,61 @@
return AXIS2_SUCCESS;
}
+static axis2_status_t AXIS2_CALL
+sandesha2_app_msg_processor_set_last_out_msg_no(
+ const axutil_env_t *env,
+ axis2_char_t *internal_seq_id,
+ long msg_num,
+ sandesha2_seq_property_mgr_t *seq_prop_mgr)
+{
+ sandesha2_seq_property_bean_t *last_out_msg_no_bean = NULL;
+ axis2_bool_t update = AXIS2_TRUE;
+ axis2_char_t str_long[32];
+
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2] Entry:sandesha2_app_msg_processor_set_last_out_msg_no");
+ AXIS2_PARAM_CHECK(env->error, internal_seq_id, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, AXIS2_FAILURE);
+
+ if(msg_num <= 0)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Invalid Message Number");
+ AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_INVALID_MSG_NUM, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+
+ last_out_msg_no_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
+ internal_seq_id, SANDESHA2_SEQ_PROP_LAST_OUT_MESSAGE_NUMBER);
+
+ if(!last_out_msg_no_bean)
+ {
+ update = AXIS2_FALSE;
+ last_out_msg_no_bean = sandesha2_seq_property_bean_create(env);
+ sandesha2_seq_property_bean_set_seq_id(last_out_msg_no_bean, env, internal_seq_id);
+
+ sandesha2_seq_property_bean_set_name(last_out_msg_no_bean, env,
+ SANDESHA2_SEQ_PROP_LAST_OUT_MESSAGE_NUMBER);
+ }
+
+ sprintf(str_long, "%ld", msg_num);
+ sandesha2_seq_property_bean_set_value(last_out_msg_no_bean, env, str_long);
+ if(update)
+ {
+ sandesha2_seq_property_mgr_update(seq_prop_mgr, env, last_out_msg_no_bean);
+ }
+ else
+ {
+ sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, last_out_msg_no_bean);
+ }
+ if(last_out_msg_no_bean)
+ {
+ sandesha2_seq_property_bean_free(last_out_msg_no_bean, env);
+ }
+
+ AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
+ "[sandesha2] Exit:sandesha2_app_msg_processor_set_last_out_msg_no");
+
+ return AXIS2_SUCCESS;
+}
+
Modified: webservices/sandesha/trunk/c/src/util/msg_creator.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/msg_creator.c?rev=690524&r1=690523&r2=690524&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_creator.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_creator.c Sat Aug 30 08:47:21 2008
@@ -575,6 +575,8 @@
sandesha2_terminate_seq_t *terminate_seq = NULL;
int soap_version = -1;
sandesha2_identifier_t *identifier = NULL;
+ sandesha2_last_msg_number_t *last_msg_number = NULL;
+ sandesha2_seq_property_bean_t *last_out_msg_no_bean = NULL;
ref_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(ref_rm_msg, env);
/*axis2_msg_ctx_set_keep_alive(ref_msg_ctx, env, AXIS2_TRUE);*/
@@ -636,6 +638,34 @@
sandesha2_identifier_set_identifier(identifier, env, seq_id);
sandesha2_terminate_seq_set_identifier(terminate_seq, env, identifier);
sandesha2_msg_ctx_set_terminate_seq(terminate_rm_msg, env, terminate_seq);
+
+ if(is_seq_res_reqd)
+ {
+ last_out_msg_no_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
+ internal_seq_id, SANDESHA2_SEQ_PROP_LAST_OUT_MESSAGE_NUMBER);
+ }
+
+ if(last_out_msg_no_bean)
+ {
+ axis2_char_t *msg_no_str = NULL;
+ long last_msg_num = -1;
+
+ msg_no_str = sandesha2_seq_property_bean_get_value(last_out_msg_no_bean, env);
+ if(msg_no_str)
+ {
+ last_msg_num = atol(msg_no_str);
+ }
+
+ last_msg_number = sandesha2_last_msg_number_create(env, rm_ns_value);
+ if(last_msg_number)
+ {
+ sandesha2_last_msg_number_set_last_msg_number(last_msg_number, env, last_msg_num);
+ sandesha2_terminate_seq_set_last_msg_number(terminate_seq, env, last_msg_number);
+ }
+
+ sandesha2_seq_property_bean_free(last_out_msg_no_bean, env);
+ }
+
sandesha2_msg_creator_finalize_creation(env, ref_msg_ctx, terminate_seq_msg_ctx);
axis2_msg_ctx_set_property(terminate_seq_msg_ctx, env, AXIS2_TRANSPORT_IN, NULL);
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org