ws-savan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r552741 - in /webservices/savan/trunk/c: include/ samples/client/subscriber/ src/ src/client/ src/data/ src/handlers/ src/util/
Date Tue, 03 Jul 2007 08:45:58 GMT
Author: damitha
Date: Tue Jul  3 01:45:57 2007
New Revision: 552741

URL: http://svn.apache.org/viewvc?view=rev&rev=552741
Log:
Adding subscription manager

Modified:
    webservices/savan/trunk/c/include/savan_constants.h
    webservices/savan/trunk/c/samples/client/subscriber/subscriber.c
    webservices/savan/trunk/c/src/Makefile.am
    webservices/savan/trunk/c/src/client/savan_client.c
    webservices/savan/trunk/c/src/client/savan_publishing_client.c
    webservices/savan/trunk/c/src/data/module.xml
    webservices/savan/trunk/c/src/handlers/savan_in_handler.c
    webservices/savan/trunk/c/src/util/savan_util.c

Modified: webservices/savan/trunk/c/include/savan_constants.h
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/include/savan_constants.h?view=diff&rev=552741&r1=552740&r2=552741
==============================================================================
--- webservices/savan/trunk/c/include/savan_constants.h (original)
+++ webservices/savan/trunk/c/include/savan_constants.h Tue Jul  3 01:45:57 2007
@@ -42,6 +42,15 @@
     SAVAN_MSG_TYPE_GET_STATUS_RESPONSE
 } savan_message_types_t;
 
+typedef struct savan_subs_mgr_info
+{
+    axis2_char_t *url;
+    axis2_char_t *name;
+    axutil_hash_t *list;
+    axis2_svc_t *svc;
+    axutil_env_t *env;
+}savan_subs_mgr_info_t;
+
 /* Eventing actions */
 #define SAVAN_ACTIONS_SUB "http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"
 #define SAVAN_ACTIONS_SUB_RESPONSE  "http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse"

Modified: webservices/savan/trunk/c/samples/client/subscriber/subscriber.c
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/samples/client/subscriber/subscriber.c?view=diff&rev=552741&r1=552740&r2=552741
==============================================================================
--- webservices/savan/trunk/c/samples/client/subscriber/subscriber.c (original)
+++ webservices/savan/trunk/c/samples/client/subscriber/subscriber.c Tue Jul  3 01:45:57 2007
@@ -219,6 +219,8 @@
             " %d :: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error));
         printf("\nPublisher init failed\n");
     }
+    if(svc_client)
+        axis2_svc_client_free(svc_client, env);
 }
 
 

Modified: webservices/savan/trunk/c/src/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/Makefile.am?view=diff&rev=552741&r1=552740&r2=552741
==============================================================================
--- webservices/savan/trunk/c/src/Makefile.am (original)
+++ webservices/savan/trunk/c/src/Makefile.am Tue Jul  3 01:45:57 2007
@@ -1,2 +1,2 @@
-SUBDIRS = handlers msgreceivers util subscribers client core
+SUBDIRS = handlers msgreceivers util subscribers client core subs_mgr
 EXTRA_DIST=data

Modified: webservices/savan/trunk/c/src/client/savan_client.c
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/client/savan_client.c?view=diff&rev=552741&r1=552740&r2=552741
==============================================================================
--- webservices/savan/trunk/c/src/client/savan_client.c (original)
+++ webservices/savan/trunk/c/src/client/savan_client.c Tue Jul  3 01:45:57 2007
@@ -202,6 +202,7 @@
     axiom_element_t *renew_elem = NULL;
     axiom_element_t *expires_elem = NULL;
     axis2_char_t *expires = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
 
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[savan][client] "
         "renew...");
@@ -230,16 +231,17 @@
     
     /* reset the old action */
     axis2_options_set_action(wsa_options, env, old_action);
-    
+   
     if (!reply)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[savan] Failed to send renew "
             "request. Error: %d Reason: %s", env->error->error_number,
             AXIS2_ERROR_GET_MESSAGE(env->error));
-        return AXIS2_FAILURE;
+        status = AXIS2_FAILURE;
     }
     else
-        return AXIS2_SUCCESS;
+        status = AXIS2_SUCCESS;
+    return status;
 }
 
 /******************************************************************************/
@@ -256,6 +258,7 @@
     axiom_node_t *reply = NULL;
     axiom_node_t *unsub_node = NULL;
     axiom_element_t *unsub_elem = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
     
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[savan][client] "
         "unsubscribe...");
@@ -282,10 +285,11 @@
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[savan] Failed to send unsubscribe "
             "request. Error: %d Reason: %s", env->error->error_number,
             AXIS2_ERROR_GET_MESSAGE(env->error));
-        return AXIS2_FAILURE;
+        status = AXIS2_FAILURE;
     }
     else
-        return AXIS2_SUCCESS;
+        status = AXIS2_SUCCESS;
+    return status;
 }
 
 /******************************************************************************/

Modified: webservices/savan/trunk/c/src/client/savan_publishing_client.c
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/client/savan_publishing_client.c?view=diff&rev=552741&r1=552740&r2=552741
==============================================================================
--- webservices/savan/trunk/c/src/client/savan_publishing_client.c (original)
+++ webservices/savan/trunk/c/src/client/savan_publishing_client.c Tue Jul  3 01:45:57 2007
@@ -123,6 +123,8 @@
     /* Send publishing message */
     axis2_svc_client_send_robust_with_op_qname(svc_client, env, op_qname, 
         payload); 
+    if(svc_client)
+        axis2_svc_client_free(svc_client, env);
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[savan] "
         "End:savan_publishing_client_publish");
     

Modified: webservices/savan/trunk/c/src/data/module.xml
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/data/module.xml?view=diff&rev=552741&r1=552740&r2=552741
==============================================================================
--- webservices/savan/trunk/c/src/data/module.xml (original)
+++ webservices/savan/trunk/c/src/data/module.xml Tue Jul  3 01:45:57 2007
@@ -3,7 +3,7 @@
     <parameter name="SubscriptionMgrURL" locked="xsd:false">http://localhost:9090/axis2/services/subscription</parameter-->
     <inflow>
         <handler name="SavanInHandler" class="mod_savan">
-            <order phase="PostDispatch"/>
+            <order phase="SavanPhase"/>
         </handler>
     </inflow>
 

Modified: webservices/savan/trunk/c/src/handlers/savan_in_handler.c
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/handlers/savan_in_handler.c?view=diff&rev=552741&r1=552740&r2=552741
==============================================================================
--- webservices/savan/trunk/c/src/handlers/savan_in_handler.c (original)
+++ webservices/savan/trunk/c/src/handlers/savan_in_handler.c Tue Jul  3 01:45:57 2007
@@ -86,7 +86,7 @@
     if (svc)
         svc_name = axis2_svc_get_name(svc, env);
     
-    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[%s][savan][in handler] invoke...",
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[%s][savan][in handler] invoke",
         svc_name);
     
     /* create a subscription processor */

Modified: webservices/savan/trunk/c/src/util/savan_util.c
URL: http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/util/savan_util.c?view=diff&rev=552741&r1=552740&r2=552741
==============================================================================
--- webservices/savan/trunk/c/src/util/savan_util.c (original)
+++ webservices/savan/trunk/c/src/util/savan_util.c Tue Jul  3 01:45:57 2007
@@ -412,6 +412,7 @@
 
     /* Setup options */
     options = axis2_options_create(env);
+    axis2_options_set_xml_parser_reset(options, env, AXIS2_FALSE);
     axis2_options_set_to(options, env, endpoint_ref);
     axis2_options_set_action(options, env,
         "http://ws.apache.org/axis2/c/subscription/add_subscriber");
@@ -436,7 +437,7 @@
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Stub invoke FAILED: Error code:"
             " %d :: %s", env->error->error_number,
             AXIS2_ERROR_GET_MESSAGE(env->error));
-        return -1;
+        return AXIS2_FAILURE;
     }
     axis2_options_set_soap_version(options, env, AXIOM_SOAP11);
     /* Set service client options */
@@ -446,6 +447,8 @@
     payload = build_add_subscriber_om_payload(env, subscriber);
     /* Send request */
     axis2_svc_client_send_robust(svc_client, env, payload);
+    if(svc_client)
+        axis2_svc_client_free(svc_client, env);
 
     return AXIS2_SUCCESS;
 }
@@ -471,6 +474,7 @@
 
     /* Setup options */
     options = axis2_options_create(env);
+    axis2_options_set_xml_parser_reset(options, env, AXIS2_FALSE);
     axis2_options_set_to(options, env, endpoint_ref);
     axis2_options_set_action(options, env,
         "http://ws.apache.org/axis2/c/subscription/remove_subscriber");
@@ -495,7 +499,7 @@
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Stub invoke FAILED: Error code:"
             " %d :: %s", env->error->error_number,
             AXIS2_ERROR_GET_MESSAGE(env->error));
-        return -1;
+        return AXIS2_FAILURE;
     }
     axis2_options_set_soap_version(options, env, AXIOM_SOAP11);
     /* Set service client options */
@@ -505,6 +509,8 @@
     payload = build_remove_subscriber_om_payload(env, subscriber);
     /* Send request */
     axis2_svc_client_send_robust(svc_client, env, payload);
+    if(svc_client)
+        axis2_svc_client_free(svc_client, env);
 
     return AXIS2_SUCCESS;
 }
@@ -526,6 +532,7 @@
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
         "[savan] Start:savan_util_get_subscriber_list_from_remote_subs_mgr");
     options = axis2_options_create(env);
+    axis2_options_set_xml_parser_reset(options, env, AXIS2_FALSE);
     axis2_options_set_action(options, env,
         "http://ws.apache.org/axis2/c/subscription/get_subscriber_list");
 
@@ -561,6 +568,8 @@
             " %d :: %s", env->error->error_number,
             AXIS2_ERROR_GET_MESSAGE(env->error));
     }
+    if(svc_client)
+        axis2_svc_client_free(svc_client, env);
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
         "[savan] End:savan_util_get_subscriber_list_from_remote_subs_mgr");
     return subscriber_list;



Mime
View raw message