airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject svn commit: r1142475 [6/7] - in /incubator/airavata/ws-messaging/trunk/workflow-tracking: ./ .settings/ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/airavata/ src/main/java/org/apache/airavata/comm...
Date Sun, 03 Jul 2011 18:33:03 GMT
Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/resources/log4j.properties?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/resources/log4j.properties (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/resources/log4j.properties Sun Jul  3 18:32:59 2011
@@ -0,0 +1,82 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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
+#
+#   http://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.
+#
+#
+
+#------------------------------------------------------------------------------
+#
+#  The following properties set the logging levels and log appender.  The
+#  log4j.rootCategory variable defines the default log level and one or more
+#  appenders.  For the console, use 'S'.  For the daily rolling file, use 'R'.
+#  For an HTML formatted log, use 'H'.
+#
+#  To override the default (rootCategory) log level, define a property of the
+#  form (see below for available values):
+#
+#        log4j.logger. =
+#
+#    Available logger names:
+#      TODO
+#
+#    Possible Log Levels:
+#      FATAL, ERROR, WARN, INFO, DEBUG
+#
+#------------------------------------------------------------------------------
+log4j.rootCategory=FATAL,S
+
+
+log4j.logger.com.dappit.Dapper.parser=ERROR
+log4j.logger.org.w3c.tidy=FATAL
+
+#------------------------------------------------------------------------------
+#
+#  The following properties configure the console (stdout) appender.
+#  See http://logging.apache.org/log4j/docs/api/index.html for details.
+#
+#------------------------------------------------------------------------------
+log4j.appender.S = org.apache.log4j.ConsoleAppender
+log4j.appender.S.layout = org.apache.log4j.PatternLayout
+log4j.appender.S.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n
+log4j.appender.S.Threshold=ERROR
+
+#------------------------------------------------------------------------------
+#
+#  The following properties configure the Daily Rolling File appender.
+#  See http://logging.apache.org/log4j/docs/api/index.html for details.
+#
+#------------------------------------------------------------------------------
+log4j.appender.R = org.apache.log4j.DailyRollingFileAppender
+log4j.appender.R.File = logs/workflow.log
+log4j.appender.R.Append = true
+log4j.appender.R.DatePattern = '.'yyy-MM-dd
+log4j.appender.R.layout = org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n
+
+#------------------------------------------------------------------------------
+#
+#  The following properties configure the Rolling File appender in HTML.
+#  See http://logging.apache.org/log4j/docs/api/index.html for details.
+#
+#------------------------------------------------------------------------------
+log4j.appender.H = org.apache.log4j.RollingFileAppender
+log4j.appender.H.File = logs/workflow.html
+log4j.appender.H.MaxFileSize = 100KB
+log4j.appender.H.Append = false
+log4j.appender.H.layout = org.apache.log4j.HTMLLayout
+log4j.appender.S.Threshold=FATAL

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/resources/workflow_tracking.properties
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/resources/workflow_tracking.properties?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/resources/workflow_tracking.properties (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/resources/workflow_tracking.properties Sun Jul  3 18:32:59 2011
@@ -0,0 +1,22 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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
+#
+#   http://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.
+#
+#
+
+axis2.repository=/Apps/axis2-1.5/repository

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsd/calder_notification_types.xsd
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsd/calder_notification_types.xsd?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsd/calder_notification_types.xsd (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsd/calder_notification_types.xsd Sun Jul  3 18:32:59 2011
@@ -0,0 +1,95 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<schema
+    targetNamespace="http://www.calderproject.org/calder_notification_types"
+	xmlns:cnt="http://www.calderproject.org/calder_notification_types"
+    xmlns:wft="http://lead.extreme.indiana.edu/namespaces/2006/06/workflow_tracking"
+    xmlns="http://www.w3.org/2001/XMLSchema"
+    attributeFormDefault="qualified"
+    elementFormDefault="qualified">
+
+    <!-- ========================================================================================== -->
+    <!-- Authors:                                                                                   -->
+    <!--   Yogesh L. Simmhan*                                                                       -->
+    <!--   Alek Slominski                                                                           -->
+    <!--   Marcus Christie                                                                          -->
+    <!--   Scott Jensen                                                                             -->    
+    <!--                                                                                            -->    
+    <!--   Version: 2.1                                                                             -->    
+    <!--   Date: 2006-08-15                                                                         -->    
+    <!--                                                                                            -->    
+    <!--   Copyright (c) 2006 Extreme! Lab, Indiana University. All rights reserved.                -->    
+    <!--   This software is open source. See http://extreme.indiana.edu/license.txt for license.    -->
+    <!-- ========================================================================================== -->
+    
+	<complexType name="CalderNotificationType">
+	    <complexContent>
+		<extension base="wft:BaseNotificationType">
+		    <sequence>
+			<element name="radarName" type="string" />
+		    </sequence>
+		</extension>
+	    </complexContent>
+	</complexType>
+
+	<complexType name="CalderClusterNotificationType">
+	    <complexContent>
+		<extension base="wft:BaseNotificationType">
+		    <sequence>
+		      <element name="ctrlon" type="float">
+      <annotation><documentation xml:lang="en">
+        Center Longitude (-180 ... 180)
+      </documentation></annotation>
+    </element>
+
+    <element name="ctrlat" type="float">
+      <annotation><documentation xml:lang="en">
+        Center Latitude (-90 ... +90)
+      </documentation></annotation>
+    </element>
+
+    <element name="westbc" type="float">
+      <annotation><documentation xml:lang="en">
+        Longitude of left side of bounding box (-180..180).  This is also 
+the "westbc"
+        element in the LEAD Metadata Schema.
+      </documentation></annotation>
+    </element>
+
+    <element name="eastbc" type="float">
+      <annotation><documentation xml:lang="en">
+        Longitude of right side of bounding box (-180..180).  This is also 
+the "eastbc"
+        element in the LEAD Metadata Schema.
+      </documentation></annotation>
+    </element>
+
+    <element name="southbc" type="float">
+      <annotation><documentation xml:lang="en">
+        Latitude of bottom side of bounding box (-90..90).  This is also 
+the "southbc"
+        element in the LEAD Metadata Schema.
+      </documentation></annotation>
+    </element>
+
+    <element name="northbc" type="float">
+      <annotation><documentation xml:lang="en">
+        Latitude of top side of bounding box (-90..90).  This is also the 
+"northbc"
+        element in the LEAD Metadata Schema.
+      </documentation></annotation>
+    </element>
+		    
+			</sequence>
+		</extension>
+	    </complexContent>
+	</complexType>
+
+
+    <element name="queryStarted" type="cnt:CalderNotificationType" />
+    <element name="queryFailedToStart" type="cnt:CalderNotificationType" />
+    <element name="queryActive" type="cnt:CalderNotificationType" />
+    <element name="queryExpired" type="cnt:CalderNotificationType" />
+    <element name="triggerFound" type="cnt:CalderNotificationType" />
+    <element name="queryPublishResult" type="cnt:CalderClusterNotificationType" />
+    <element name="queryNoDetection" type="cnt:CalderNotificationType" />
+</schema>

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsd/notification_types.xsd
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsd/notification_types.xsd?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsd/notification_types.xsd (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsd/notification_types.xsd Sun Jul  3 18:32:59 2011
@@ -0,0 +1,591 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<schema
+    targetNamespace="http://lead.extreme.indiana.edu/namespaces/2006/06/workflow_tracking"
+    xmlns:wft="http://lead.extreme.indiana.edu/namespaces/2006/06/workflow_tracking"
+    xmlns="http://www.w3.org/2001/XMLSchema"
+    attributeFormDefault="qualified"
+    elementFormDefault="qualified">
+
+    <!-- ========================================================================================== -->
+    <!-- Authors:                                                                                   -->
+    <!--   Yogesh L. Simmhan*                                                                       -->
+    <!--   Alek Slominski                                                                           -->
+    <!--   Marcus Christie                                                                          -->
+    <!--   Scott Jensen                                                                             -->
+    <!--                                                                                            -->
+    <!--   Version: 2.1                                                                             -->
+    <!--   Date: 2006-08-15                                                                         -->
+    <!--                                                                                            -->
+    <!--   Copyright (c) 2006 Extreme! Lab, Indiana University. All rights reserved.                -->
+    <!--   This software is open source. See http://extreme.indiana.edu/license.txt for license.    -->
+    <!-- ========================================================================================== -->
+
+
+    <!-- ========================================================================================== -->
+
+    <annotation>
+	<documentation>
+	    *) Workflows and services can be abstract (template) or concrete (instance).
+	       Unless otherwise noted, we always refer to the concrete instance of the workflow/service below
+	    *) All workflows are also services.
+	    *) Services may be part of zero or more workflows
+	    *) When Services execute in the context of a workflow,
+	       an invocation of the service is associated with the workflowID of the workflow whose context
+	       in which it is being invoked (also called parent workflow), 
+	       the timestep of this invocation in the parent workflow,
+	       and the node ID that uniquely identifies this service within the parent workflow instance.
+	    *) Workflows can also be invoked in the context of another parent workflow.
+	    *) Workflow ID always refers to the "parent workflow ID". When refering to the invocation of a workflow,
+	       its instance ID is called the Service ID.
+	    *) Workflows that are not invoked from another workflow do not have a context of execution 
+	       (parent workflow is not present => Workflow ID is NULL)
+	    *) Schema design notes
+	       - This schema uses the "Venetian Blind" schema design pattern
+	       - It uses Upper Camel Case for schema types and lower camel case for
+	         element and attribute names
+	</documentation>
+    </annotation>
+
+    <simpleType name="ServiceIDType">
+	<annotation>
+	    <documentation>
+		ID to uniquely identify the service instance.
+		This is usually formed from the targetnamespace and porttype name of the service's WSDL.
+		This ID may refer to the instance ID for a service or for a workflow.
+	    </documentation>
+	</annotation>
+	<restriction base="anyURI"/>
+    </simpleType>
+    
+    <simpleType name="WorkflowNodeIDType">
+	<annotation>
+	    <documentation>
+		String that identifies uniquely a node in workflow graph. 
+		The node ID is unique in the scope of a workflow ID.
+	    </documentation>
+	</annotation>
+	<restriction base="string"/>
+    </simpleType>
+    
+    <simpleType name="WorkflowTimestepType">
+	<annotation>
+	    <documentation>
+		The timestep within workflow execution at which this invocation is made. 
+		This is a logical time that monotonically increments for each invocation in a workflow.
+	    </documentation>
+	</annotation>
+	<restriction base="int"/>
+    </simpleType>
+    
+    <simpleType name="DataProductIDType">
+	<annotation>
+	    <documentation>
+		Unique logical ID for a data product in the form of a UUID.
+		Physical URL for the data products can be resolved using this ID.
+	    </documentation>
+	</annotation>
+	<restriction base="anyURI"/>
+    </simpleType>
+    
+    <!-- ========================================================================================== -->
+
+    <complexType name="BaseIDType">
+	<attribute name="workflowID" type="wft:ServiceIDType" use="optional">
+	    <annotation>
+		<documentation>
+		    The workflow context within which this service is executing.
+		    If this service is itself a workflow and not executing as part of another workflow
+		    (i.e. this is the root of the invocation trace) then the workflow ID is absent.
+		    Otherwise, this is the service ID of the workflow instance.
+		</documentation>
+	    </annotation>
+	</attribute>
+	
+	<attribute name="serviceID" type="wft:ServiceIDType" use="required">
+	    <annotation>
+		<documentation>
+		    ID to uniquely identify a service instance. The service instance can
+		    be part of zero or more workflow.
+		    This is formed from the targetnamespace of the service's CWSDL.
+		</documentation>
+	    </annotation>
+	</attribute>
+	
+	<attribute name="workflowNodeID" type="wft:WorkflowNodeIDType" use="optional">
+	    <annotation>
+		<documentation>
+		    Distinct ID of a node within a Workflow graph. unique within the workflowID,
+		    not necessarily the order of execution.
+		</documentation>
+	    </annotation>
+	</attribute>
+	
+	<attribute name="workflowTimestep" type="wft:WorkflowTimestepType" use="optional">
+	    <annotation>
+		<documentation>
+		    The timestep within workflow execution at which this invocation is made.
+		    32bit integer. Timestep is a numerically ordered monotonically increasing sequence
+		    within wf execution that allows relative ordering of invocations.
+		    It is unique within the workflowID for each invocation in the workflow.
+		</documentation>
+	    </annotation>
+	</attribute>
+    </complexType>
+    
+    <!-- base type for all notifications -->
+    <complexType name="BaseNotificationType">
+	<annotation>
+	    <documentation>This is the base type for all notification activities that are produced</documentation>
+	</annotation>
+	<sequence>
+	    
+	    <element name="notificationSource" type="wft:BaseIDType">
+		<annotation>
+		    <documentation>
+			This identifies the entity/invocation context from which this notifcation is being sent.
+		    </documentation>
+		</annotation>
+	    </element>
+
+	    <element name="timestamp" type="dateTime" />
+
+	    <element name="description" type="string" minOccurs="0">
+		<annotation>
+		    <documentation>Optional human friendly description of this notification.</documentation>
+		</annotation>
+	    </element>
+
+	    <element name="annotation" type="anyType" minOccurs="0">
+		<annotation>
+		    <documentation>Optional additional metadata for this notification. See common.AnnotationConsts file.</documentation>
+		</annotation>
+	    </element>
+
+	</sequence>
+
+	<attribute name="infoModelVersion" 
+		   form="unqualified" 
+		   type="NMTOKEN" 
+		   use="required"> 
+	    <!-- we set form as unqualified to allow WS-Messenger YFilter to match it -->
+	    <!-- NMToken := (Letter | Digit  | '.' | '-' | '_' | ':')+ -->
+	    <annotation>
+		<documentation>
+		    String identifying notification schema version (used for verifying compatible schema and filtering).
+		</documentation>
+	    </annotation>
+	</attribute>
+
+    </complexType>
+
+
+    <complexType name="MessageType">
+	<sequence>
+	    <element name="header" type="anyType" minOccurs="0" /> <!-- e.g. soap:header -->
+	    <element name="body" type="anyType" minOccurs="0" /> <!-- e.g. soap:body --> <!-- fixme: change to message -->
+	</sequence>
+    </complexType>
+
+    <complexType name="FaultMessageType">
+	<complexContent>
+	    <extension base="wft:MessageType" />
+	</complexContent>
+    </complexType>
+
+    <complexType name="InvocationMessageType">
+	<complexContent>
+	    <extension base="wft:MessageType" />
+	</complexContent>
+    </complexType>
+
+
+    <complexType name="FailureMessageType">
+	<sequence>
+	    <element name="trace" type="anyType" minOccurs="0" maxOccurs="unbounded" />
+	</sequence>
+    </complexType>
+
+
+    <!-- ========================================================================================== -->
+    <!--                           workflow provenance types                                        -->
+    <!-- ========================================================================================== -->
+
+    <!-- sent when the service is first created and is ready to accept invocations -->
+    <element name="serviceInitialized" type="wft:BaseNotificationType" />
+
+    <!-- sent when the service is terminated and will not accept any further invocations -->
+    <element name="serviceTerminated" type="wft:BaseNotificationType" />
+
+    <!-- sent when the workflow is first created and is ready to accept invocations -->
+    <!--element name="workflowInitialized" type="wft:BaseNotificationType"-->
+    <element name="workflowInitialized">
+	<complexType>
+	    <complexContent>
+		<extension base="wft:BaseNotificationType">
+		    <sequence>
+			<element name="initialPriority" type="string" minOccurs="0" />
+			<element name="workflowTemplateId" type="wft:ServiceIDType" minOccurs="0" />
+			<element name="workflowCreatorDn" type="string" minOccurs="0" />
+		    </sequence>
+		</extension>
+	    </complexContent>
+	</complexType>
+    </element>
+
+    <!-- sent when the workflow is terminated and will not accept any further invocations -->
+    <element name="workflowTerminated" type="wft:BaseNotificationType" />
+
+    <!-- sent when the workflow execution is paused: invocations will be accepted but no new messages will be sent by the workflow -->
+    <element name="workflowPaused" type="wft:BaseNotificationType" />
+
+    <!-- sent when the workflow execution is resumed -->
+    <element name="workflowResumed" type="wft:BaseNotificationType" />
+
+    <!-- workflow priority tracking -->
+    <element name="workflowPriorityChanged">
+	<complexType>
+	    <complexContent>
+		<extension base="wft:BaseNotificationType">
+		    <sequence>
+			<element name="newPriority" type="string" />
+			<element name="oldPriority" type="string" />
+		    </sequence>
+		</extension>
+	    </complexContent>
+	</complexType>
+    </element>
+
+    <!-- ========================================================================================== -->
+
+    <complexType name="InvocationRequestType" abstract="true">
+        <complexContent>
+	    <extension base="wft:BaseNotificationType">
+		<sequence>
+		    <element name="request" type="wft:InvocationMessageType" minOccurs="0" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <complexType name="RequestInitiatorType">
+        <complexContent>
+	    <extension base="wft:InvocationRequestType">
+		<sequence>
+		    <!-- used by wf (client) to set service info, when invoking service -->
+		    <element name="receiver" type="wft:BaseIDType" minOccurs="0" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <complexType name="RequestReceiverType">
+        <complexContent>
+	    <extension base="wft:InvocationRequestType">
+		<sequence>
+		    <!-- used by service to set workflow(client) info, when invoked by workflow (client) -->
+		    <element name="initiator" type="wft:BaseIDType" minOccurs="0" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+
+    <!-- ========================================================================================== -->
+
+    <complexType name="AcknowledgementType" abstract="true">
+	<complexContent>
+	    <extension base="wft:BaseNotificationType" >
+		<sequence>
+		    <element name="receiver" type="wft:BaseIDType" minOccurs="0" /> <!-- target of the action that succeeded -->
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <complexType name="AcknowledgeSuccessType">
+	<complexContent>
+	    <extension base="wft:AcknowledgementType" />
+	</complexContent>
+    </complexType>
+
+    <complexType name="AcknowledgeFailureType">
+        <complexContent>
+	    <extension base="wft:AcknowledgementType">
+		<sequence>
+		    <element name="failure" type="wft:FailureMessageType" minOccurs="0" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <!-- ========================================================================================== -->
+
+    <!-- sent by workflow when a service is invoked by it. -->
+    <element name="invokingService" type="wft:RequestInitiatorType" />
+
+
+    <!-- sent by workflow when it is invoked. -->
+    <element name="workflowInvoked" type="wft:RequestReceiverType" />
+
+    <!-- sent by service when it is invoked. -->
+    <element name="serviceInvoked" type="wft:RequestReceiverType" />
+
+
+    <!-- sent by workflow when it invoked a service successfully. -->
+    <element name="invokingServiceSucceeded" type="wft:AcknowledgeSuccessType" />
+
+    <!-- sent by workflow when it failed to invoke a service successfully. -->
+    <element name="invokingServiceFailed" type="wft:AcknowledgeFailureType" />
+
+
+    <!-- ========================================================================================== -->
+
+    <complexType name="InvocationResultType" abstract="true">
+        <complexContent>
+	    <extension base="wft:BaseNotificationType">
+		<sequence>
+		    <element name="result" type="wft:InvocationMessageType" minOccurs="0" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <complexType name="InvocationFaultType" abstract="true">
+        <complexContent>
+	    <extension base="wft:BaseNotificationType">
+		<sequence>
+		    <element name="fault" type="wft:FaultMessageType" minOccurs="0" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <complexType name="ResultReceiverType">
+        <complexContent>
+	    <extension base="wft:InvocationResultType">
+		<sequence>
+		    <!-- used by wf (client) to set service info, when receiving result from service -->
+		    <element name="responder" type="wft:BaseIDType" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <complexType name="FaultReceiverType">
+        <complexContent>
+	    <extension base="wft:InvocationFaultType">
+		<sequence>
+		    <!-- used by wf (client) to set service info, when receiving result from service -->
+		    <element name="responder" type="wft:BaseIDType" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <complexType name="ResultResponderType">
+        <complexContent>
+	    <extension base="wft:InvocationResultType">
+		<sequence>
+		    <!-- used by service to set workflow(client) info, when returning result to workflow (client) -->
+		    <element name="receiver" type="wft:BaseIDType" minOccurs="0" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <complexType name="FaultResponderType">
+        <complexContent>
+	    <extension base="wft:InvocationFaultType">
+		<sequence>
+		    <!-- used by service to set workflow(client) info, when returning result to workflow (client) -->
+		    <element name="receiver" type="wft:BaseIDType" minOccurs="0" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <!-- ========================================================================================== -->
+
+    <!-- sent by service when it returns the result for an invocation. -->
+    <element name="sendingResult" type="wft:ResultResponderType" /> <!-- add workflowSendingResult -->
+
+    <!-- sent by service when it returns a fault for an invocation. -->
+    <element name="sendingFault" type="wft:FaultResponderType" /> <!-- add workflowSendingFault -->
+
+
+    <!-- sent by workflow when it receives the result for an invocation. -->
+    <element name="receivedResult" type="wft:ResultReceiverType" /> <!-- add workflowReceivedResult -->
+
+    <!-- sent by workflow when it receives a fault for an invocation. -->
+    <element name="receivedFault" type="wft:FaultReceiverType" /> <!-- add workflowFaultResult -->
+
+
+    <!-- sent by service when it has successfully sent the result for an invocation. -->
+    <element name="sendingResponseSucceeded" type="wft:AcknowledgeSuccessType" />
+
+    <!-- sent by service when it has successfully sent a fault for an invocation. -->
+    <element name="sendingResponseFailed" type="wft:AcknowledgeFailureType" />
+
+    <!-- ========================================================================================== -->
+
+
+    <!-- ========================================================================================== -->
+    <!--                            data provenance types                                           -->
+    <!-- ========================================================================================== -->
+
+    <!-- general complex data types -->
+    <complexType name="DataProductType">
+	<sequence>
+	    <element name="id" type="wft:DataProductIDType" />
+	    <element name="location" type="anyURI" minOccurs="0" maxOccurs="unbounded" />
+	    <element name="sizeInBytes" type="long" minOccurs="0" />
+	    <element name="timestamp" type="dateTime" minOccurs="0" /> <!-- context sensitive. time at which data product was produced or consumed. -->
+	    <element name="description" type="string" minOccurs="0">
+		<annotation>
+		    <documentation>Optional human friendly description of this data product.</documentation>
+		</annotation>
+	    </element>
+	    <element name="annotation" type="anyType" minOccurs="0">
+		<annotation>
+		    <documentation>Optional additional metadata for this data product.</documentation>
+		</annotation>
+	    </element>
+	</sequence>
+    </complexType>
+
+    <complexType name="DataProductNotificationType">
+	<complexContent>
+	    <extension base="wft:BaseNotificationType">
+		<sequence>
+		    <element name="dataProduct" type="wft:DataProductType" minOccurs="0" maxOccurs="unbounded" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <!-- sent when a file is used by the jython app. -->
+    <element name="dataConsumed" type="wft:DataProductNotificationType" />
+
+    <!-- sent when a file is generated by the jython app. -->
+    <element name="dataProduced" type="wft:DataProductNotificationType" />
+
+
+    <!-- ========================================================================================== -->
+    <!--                                   performance audit types                                  -->
+    <!-- ========================================================================================== -->
+
+
+    <!--  sent when the application launches a GRAM job, to facilitate -->
+    <!--  auditing and accounting of TeraGrid jobs -->
+    <!-- SJ The type name needed Type added at the end -->
+    <complexType name="ApplicationAuditType">
+	<complexContent>
+	    <extension base="wft:BaseNotificationType">
+		<sequence>
+		    <element name="name" type="string" />
+		    <element name="jobHandle" type="anyURI"/>
+		    <element name="host" type="string" />
+		    <element name="queueName" type="string" minOccurs="0"/>
+		    <element name="jobId" type="string" minOccurs="0"/>
+		    <element name="distinguishedName" type="string" />
+		    <element name="projectId" type="string" minOccurs="0"/>
+		    <element name="rsl" type="string"/>
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <element name="applicationAudit" type="wft:ApplicationAuditType" />
+
+
+    <!-- sent at the end of a computational block in the jython app -->
+    <!-- with the time in milliseconds taken for that computational block -->
+    <element name="computationDuration">
+	<complexType>
+	    <complexContent>
+		<extension base="wft:BaseNotificationType">
+		    <sequence>
+			<element name="durationInMillis" type="long" />
+		    </sequence>
+		</extension>
+	    </complexContent>
+	</complexType>
+    </element>
+
+    <!-- sent at the end of sending a file to remote location (thro' gridftp?) by the jython app -->
+    <!-- with the time in milliseconds taken to send that file -->
+    <!-- TODO: later add support for time for multiple files in a single notification? -->
+    <complexType name="DataTransferDurationType">
+	<complexContent>
+	    <extension base="wft:BaseNotificationType">
+		<sequence>
+		    <element name="id" type="wft:DataProductIDType" />
+		    <element name="source" type="anyURI" />
+		    <element name="target" type="anyURI" />
+		    <element name="sizeInBytes" type="long" minOccurs="0" default="-1" />
+		    <element name="durationInMillis" type="long" default="-1" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <element name="dataSendDuration" type="wft:DataTransferDurationType" />
+    <element name="dataReceiveDuration" type="wft:DataTransferDurationType" />
+
+    <!-- ========================================================================================== -->
+    <!--                               generic log message types                                    -->
+    <!-- ========================================================================================== -->
+
+
+    <!-- sent when an interesting file is created by the jython app that can be viewed thro' a URL -->
+    <!-- used to display as a link on the portal -->
+    <element name="publishURL">
+	<complexType>
+	    <complexContent>
+		<extension base="wft:BaseNotificationType">
+		    <sequence>
+			<element name="title" type="string" minOccurs="0" />
+			<element name="location" type="anyURI" />
+		    </sequence>
+		</extension>
+	    </complexContent>
+	</complexType>
+    </element>
+
+    <!-- generic log message at different levels of importance that can be produced by the jython app -->
+    <element name="logInfo" type="wft:BaseNotificationType" />
+    <element name="logException" type="wft:BaseNotificationType" />
+    <element name="logWarning" type="wft:BaseNotificationType" />
+    <element name="logDebug" type="wft:BaseNotificationType" />
+
+
+    <!-- ========================================================================================== -->
+    <!--                              resource broker message types                                 -->
+    <!-- ========================================================================================== -->
+
+    <complexType name="ResourceMappingType">
+	<complexContent>
+	    <extension base="wft:BaseNotificationType">
+		<sequence>
+		    <element name="mappedResource" type="string" />
+		    <element name="retryStatusCount" type="int" default="0" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <complexType name="JobStatusType">
+	<complexContent>
+	    <extension base="wft:BaseNotificationType">
+		<sequence>
+		    <element name="jobStatus" type="string" />
+		    <element name="retryCount" type="int" default="0" />
+		</sequence>
+	    </extension>
+	</complexContent>
+    </complexType>
+
+    <element name="resourceMapping" type="wft:ResourceMappingType" />
+    <element name="jobStatus" type="wft:JobStatusType" />
+
+</schema>

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsdconfig/calder_notification_types.xsdconfig
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsdconfig/calder_notification_types.xsdconfig?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsdconfig/calder_notification_types.xsdconfig (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsdconfig/calder_notification_types.xsdconfig Sun Jul  3 18:32:59 2011
@@ -0,0 +1,13 @@
+<!-- An xsdconfig file must begin with a "config" element in the
+        http://www.bea.com/2002/09/xbean/config namespace. Also, be sure
+        to declare any namespaces used to qualify types in your schema (here,
+        the namespace corresponding to the pol prefix. -->
+<xb:config  xmlns:xb="http://www.bea.com/2002/09/xbean/config">
+
+    <!-- Use the "namespace" element to map a namespace to the Java package
+        name that should be generated. -->
+    <xb:namespace uri="http://www.calderproject.org/calder_notification_types">
+        <xb:package>edu.indiana.extreme.lead.calder.types</xb:package>
+    </xb:namespace>
+    
+</xb:config>

Propchange: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsdconfig/calder_notification_types.xsdconfig
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsdconfig/notification_types_ng.xsdconfig
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsdconfig/notification_types_ng.xsdconfig?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsdconfig/notification_types_ng.xsdconfig (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsdconfig/notification_types_ng.xsdconfig Sun Jul  3 18:32:59 2011
@@ -0,0 +1,13 @@
+<!-- An xsdconfig file must begin with a "config" element in the
+        http://www.bea.com/2002/09/xbean/config namespace. Also, be sure
+        to declare any namespaces used to qualify types in your schema (here,
+        the namespace corresponding to the pol prefix. -->
+<xb:config  xmlns:xb="http://www.bea.com/2002/09/xbean/config">
+
+    <!-- Use the "namespace" element to map a namespace to the Java package
+        name that should be generated. -->
+    <xb:namespace uri="http://lead.extreme.indiana.edu/namespaces/2006/06/workflow_tracking">
+        <xb:package>org.apache.airavata.workflow.tracking.types</xb:package>
+    </xb:namespace>
+    
+</xb:config>

Propchange: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/main/xsdconfig/notification_types_ng.xsdconfig
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/LeadCallbackHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/LeadCallbackHandlerTest.java?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/LeadCallbackHandlerTest.java (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/LeadCallbackHandlerTest.java Sun Jul  3 18:32:59 2011
@@ -0,0 +1,171 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ *   http://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.
+ *
+ */
+
+package org.apache.airavata.workflow.tracking.tests;
+
+import java.io.StringReader;
+import java.net.URL;
+import java.util.Properties;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import org.apache.airavata.commons.WorkFlowUtils;
+import org.apache.airavata.workflow.tracking.client.Callback;
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+import org.apache.airavata.workflow.tracking.client.NotificationType;
+import org.apache.airavata.workflow.tracking.client.Subscription;
+import org.apache.airavata.workflow.tracking.tests.util.CommonUtils;
+import org.apache.airavata.workflow.tracking.tests.util.TestConfigKeys;
+import org.apache.axiom.om.OMElement;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.impl.tool.XSTCTester.TestCase;
+
+public class LeadCallbackHandlerTest extends TestCase {
+
+    Properties configs = new Properties();
+    String BROKER_URL;
+    String MESSAGEBOX_URL;
+    int consumerPort;
+    String AXIS_REPO;
+
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+
+    }
+
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        URL configURL = ClassLoader.getSystemResource(TestConfigKeys.CONFIG_FILE_NAME);
+        configs.load(configURL.openStream());
+        BROKER_URL = configs.getProperty(TestConfigKeys.BROKER_EVENTING_SERVICE_EPR);
+        MESSAGEBOX_URL = configs.getProperty(TestConfigKeys.MSGBOX_SERVICE_EPR);
+        consumerPort = Integer.parseInt(configs.getProperty(TestConfigKeys.CONSUMER_PORT));
+        AXIS_REPO = configs.getProperty(TestConfigKeys.AXIS2_REPO);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    boolean wait = false;
+    int repetition = 3;
+    private Subscription subscription;
+
+    class TestMsgCallback implements Callback {
+
+        public TestMsgCallback(int reps) {
+            repititions = reps;
+        }
+
+        BlockingQueue<Boolean> msgQueue = new LinkedBlockingQueue<Boolean>();
+        int count = 0;
+        int repititions;
+
+        public void deliverMessage(String topic, NotificationType notificationType, XmlObject messageObj) {
+
+            count++;
+            System.out.println("Subscription  received " + count + "th notification of type:");
+            if (repititions <= count) {
+                msgQueue.add(new Boolean(true));
+            }
+
+        }
+
+        public BlockingQueue<Boolean> getQueue() {
+            return msgQueue;
+        }
+
+    }
+
+    @Test
+    public void testRoundTrip() throws Exception {
+        wait = true;
+
+        TestMsgCallback c1 = new TestMsgCallback(repetition);
+        TestMsgCallback c2 = new TestMsgCallback(repetition);
+
+        subscription = LeadNotificationManager.createSubscription(BROKER_URL, "topic", c1, consumerPort);
+        Thread.sleep(100);
+        Subscription subscription2 = LeadNotificationManager.createSubscription(BROKER_URL, "topic", c2,
+                consumerPort + 1);
+
+        WseMsgBrokerClient client = new WseMsgBrokerClient();
+        client.init(BROKER_URL);
+        client.setTimeoutInMilliSeconds(20000L);
+
+        OMElement msg = WorkFlowUtils.reader2OMElement(new StringReader(CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION));
+
+        for (int i = 0; i < repetition; i++) {
+            client.publish("topic", msg);
+            Thread.sleep(100);
+        }
+
+        Boolean b1 = c1.getQueue().take();
+        Boolean b2 = c2.getQueue().take();
+
+        System.out.println(b1);
+        System.out.println(b2);
+
+        subscription.destroy();
+        subscription2.destroy();
+
+    }
+
+    @Test
+    public void testRoundTripWithDifferentTopics() throws Exception {
+        wait = true;
+
+        TestMsgCallback c1 = new TestMsgCallback(repetition);
+        TestMsgCallback c2 = new TestMsgCallback(repetition);
+
+        subscription = LeadNotificationManager.createSubscription(BROKER_URL, "topic10", c1, consumerPort);
+        Subscription subscription2 = LeadNotificationManager.createSubscription(BROKER_URL, "topic20", c2,
+                consumerPort + 1);
+
+        WseMsgBrokerClient client = new WseMsgBrokerClient();
+        client.init(BROKER_URL);
+
+        OMElement msg = WorkFlowUtils.reader2OMElement(new StringReader(CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION));
+
+        for (int i = 0; i < repetition; i++) {
+            client.publish("topic10", msg);
+            Thread.sleep(100);
+        }
+
+        for (int i = 0; i < repetition; i++) {
+            client.publish("topic20", msg);
+            Thread.sleep(100);
+        }
+
+        Boolean b1 = c1.getQueue().take();
+        Boolean b2 = c2.getQueue().take();
+
+        System.out.println(b1);
+        System.out.println(b2);
+
+        subscription2.destroy();
+        subscription.destroy();
+    }
+}

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/LeadNotificationManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/LeadNotificationManagerTest.java?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/LeadNotificationManagerTest.java (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/LeadNotificationManagerTest.java Sun Jul  3 18:32:59 2011
@@ -0,0 +1,45 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ *   http://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.
+ *
+ */
+
+package org.apache.airavata.workflow.tracking.tests;
+
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+
+public class LeadNotificationManagerTest {
+
+    @Before
+    public void setUp() throws Exception {
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    @Test
+    public final void testGetBrokerPublishEPR() {
+
+        String endpointRefAsStr = LeadNotificationManager.getBrokerPublishEPR("http://brokerurl", "testtopic");
+
+        System.out.println(endpointRefAsStr);
+
+    }
+
+}

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/MultipleSubscriptionTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/MultipleSubscriptionTest.java?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/MultipleSubscriptionTest.java (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/MultipleSubscriptionTest.java Sun Jul  3 18:32:59 2011
@@ -0,0 +1,100 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ *   http://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.
+ *
+ */
+
+package org.apache.airavata.workflow.tracking.tests;
+
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.airavata.workflow.tracking.tests.util.CommonUtils;
+import org.apache.airavata.workflow.tracking.tests.util.SubscriberThread;
+import org.apache.airavata.workflow.tracking.tests.util.TestConfigKeys;
+import org.apache.xmlbeans.impl.tool.XSTCTester.TestCase;
+
+public class MultipleSubscriptionTest extends TestCase implements ThreadMessagePassingCallback {
+
+    static Properties configs = new Properties();
+    String BROKER_URL;
+    String MESSAGEBOX_URL;
+    int consumerPort;
+    public static final int NOTIFICATIONS_PUBLISHED = 4;
+    public static final int NUMBER_OF_SUBSCRIBERS = 4;
+    private int succesfulclients = 0;
+    String AXIS_REPO;
+
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+
+    }
+
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        URL configURL = ClassLoader.getSystemResource(TestConfigKeys.CONFIG_FILE_NAME);
+        configs.load(configURL.openStream());
+        BROKER_URL = configs.getProperty(TestConfigKeys.BROKER_EVENTING_SERVICE_EPR);
+        MESSAGEBOX_URL = configs.getProperty(TestConfigKeys.MSGBOX_SERVICE_EPR);
+        consumerPort = Integer.parseInt(configs.getProperty(TestConfigKeys.CONSUMER_PORT));
+        AXIS_REPO = configs.getProperty(TestConfigKeys.AXIS2_REPO);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    public void testMultipleSubscribers() throws Exception {
+
+        SubscriberThread[] subscribers = new SubscriberThread[NUMBER_OF_SUBSCRIBERS];
+        for (int i = 0; i < NUMBER_OF_SUBSCRIBERS; ++i) {
+            subscribers[i] = new SubscriberThread(this, BROKER_URL, "topic" + i, consumerPort + i);
+            subscribers[i].start();
+
+        }
+
+        Thread.sleep(5000);
+
+        WseMsgBrokerClient client = new WseMsgBrokerClient();
+        client.init(BROKER_URL);
+
+        for (int j = 0; j < NUMBER_OF_SUBSCRIBERS; j++) {
+            for (int i = 0; i < NOTIFICATIONS_PUBLISHED; i++) {
+
+                client.publish("topic" + j, CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION);
+
+                Thread.sleep(100);
+            }
+        }
+
+        while (succesfulclients < NUMBER_OF_SUBSCRIBERS) {
+            Thread.sleep(1000);
+        }
+
+    }
+
+    public void done() {
+        System.out.println("Done Multiple subscription test");
+        succesfulclients++;
+    }
+
+}

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/RenewSubscriptionTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/RenewSubscriptionTest.java?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/RenewSubscriptionTest.java (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/RenewSubscriptionTest.java Sun Jul  3 18:32:59 2011
@@ -0,0 +1,152 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ *   http://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.
+ *
+ */
+
+package org.apache.airavata.workflow.tracking.tests;
+
+import java.net.URL;
+import java.rmi.RemoteException;
+import java.util.Properties;
+
+import org.apache.airavata.workflow.tracking.client.Callback;
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+import org.apache.airavata.workflow.tracking.client.NotificationType;
+import org.apache.airavata.workflow.tracking.client.Subscription;
+import org.apache.airavata.workflow.tracking.tests.util.TestConfigKeys;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.AxisFault;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.impl.tool.XSTCTester.TestCase;
+
+public class RenewSubscriptionTest extends TestCase implements Callback {
+
+    static Properties configs = new Properties();
+    String BROKER_URL;
+    String MESSAGEBOX_URL;
+    int consumerPort;
+    public static final String TOPIC = "testTopic";
+    private static final String MESSAGE_BOX_ID = "929799u028887273u9899400999999";
+    public static int count = 0;
+    public int messages = 10;
+    public static Object mutex = new Object();
+    Subscription sub;
+    String AXIS_REPO;
+
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+
+    }
+
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        URL configURL = ClassLoader.getSystemResource(TestConfigKeys.CONFIG_FILE_NAME);
+        configs.load(configURL.openStream());
+        BROKER_URL = configs.getProperty(TestConfigKeys.BROKER_EVENTING_SERVICE_EPR);
+        MESSAGEBOX_URL = configs.getProperty(TestConfigKeys.MSGBOX_SERVICE_EPR);
+        consumerPort = Integer.parseInt(configs.getProperty(TestConfigKeys.CONSUMER_PORT));
+        // AXIS_REPO=configs.getProperty(TestConfigKeys.AXIS2_REPO);
+
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    @Test
+    public void testRenewSubscriptionTest() throws Exception {
+
+        String brokerPublishEPR = null;
+
+        sub = LeadNotificationManager
+                .createMessageBoxSubscription(MESSAGEBOX_URL, BROKER_URL, TOPIC, null, this, false);
+
+        brokerPublishEPR = sub.getBrokerURL();
+        System.out.println(brokerPublishEPR);
+
+        WseMsgBrokerClient client = new WseMsgBrokerClient();
+        client.init(brokerPublishEPR);
+
+        OMElement msg = OMAbstractFactory.getOMFactory().createOMElement("testMessage", null);
+        msg.setText("some message");
+        client.publish(TOPIC, msg);
+
+        Thread.sleep(10000);
+        for (int i = 0; i < messages; ++i) {
+            try {
+                Thread.sleep(1000);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+            try {
+                sub = LeadNotificationManager.renewMessageboxSubscription(BROKER_URL, sub.getMessageBoxEPR(),
+                        sub.getSubscriptionID(), TOPIC, null, false);
+            } catch (AxisFault e) {
+                e.printStackTrace();
+            }
+        }
+
+        Thread.sleep(10000);
+
+        for (int i = 0; i < messages; ++i) {
+            client.publish(TOPIC, msg);
+
+            Thread.sleep(100);
+
+        }
+
+        while (true) {
+
+            Thread.sleep(1000);
+
+        }
+    }
+
+    public void deliverMessage(String topic, NotificationType notificationType, XmlObject messageObj) {
+        System.out.println(messageObj.toString());
+        System.out.println("A message received by handler correctly");
+        synchronized (mutex) {
+            count++;
+        }
+        if (count == messages + 1) {
+            try {
+                sub.destroy();
+            } catch (RemoteException e1) {
+                e1.printStackTrace();
+            }
+            System.out.println("Destroyed");
+            WseMsgBrokerClient client = new WseMsgBrokerClient();
+            client.init(BROKER_URL);
+            try {
+                client.publish(TOPIC, "some message");
+            } catch (MsgBrokerClientException e) {
+                e.printStackTrace();
+            }
+        }
+
+        System.out.println(count + " <=" + (messages + 1));
+
+    }
+
+}

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/ThreadMessagePassingCallback.java
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/ThreadMessagePassingCallback.java?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/ThreadMessagePassingCallback.java (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/ThreadMessagePassingCallback.java Sun Jul  3 18:32:59 2011
@@ -0,0 +1,27 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ *   http://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.
+ *
+ */
+
+package org.apache.airavata.workflow.tracking.tests;
+
+public interface ThreadMessagePassingCallback {
+
+    public void done();
+}

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/impl/publish/Test.java
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/impl/publish/Test.java?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/impl/publish/Test.java (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/impl/publish/Test.java Sun Jul  3 18:32:59 2011
@@ -0,0 +1,38 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ *   http://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.
+ *
+ */
+
+package org.apache.airavata.workflow.tracking.tests.impl.publish;
+
+import org.apache.xmlbeans.XmlCursor;
+
+public class Test {
+    public static void main(String[] args) {
+        WorkflowInitializedDocument activity = WorkflowInitializedDocument.Factory.newInstance();
+        BaseNotificationType activityType = activity.addNewWorkflowInitialized();
+
+        XmlCursor c = activity.newCursor();
+        c.toNextToken();
+
+        System.out.println(c.getObject().getClass());
+
+        System.out.println(((BaseNotificationType) c.getObject()).getDescription());
+    }
+}

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/impl/publish/TestWSMPublisher.java
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/impl/publish/TestWSMPublisher.java?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/impl/publish/TestWSMPublisher.java (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/impl/publish/TestWSMPublisher.java Sun Jul  3 18:32:59 2011
@@ -0,0 +1,118 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ *   http://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.
+ *
+ */
+
+package org.apache.airavata.workflow.tracking.tests.impl.publish;
+
+import java.io.IOException;
+
+import org.apache.airavata.workflow.tracking.impl.publish.WSMPublisher;
+import org.apache.axis2.addressing.EndpointReference;
+
+public class TestWSMPublisher {
+
+    @Before
+    public void setUp() throws Exception {
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    @Test
+    public final void testWSMPublisherConstructor1() {
+
+        EndpointReference brokerEpr = new EndpointReference("http://invalid/broker/address");
+        WSMPublisher publisher = new WSMPublisher(10, false, brokerEpr);
+
+    }
+
+    @Test
+    public final void testWSMPublisherConstructor2() {
+
+        try {
+            WSMPublisher publisher = new WSMPublisher(10, false, "http://invalid/broker/address", "TestTopic1");
+
+        } catch (IOException e) {
+            fail("Test failed");
+        }
+
+    }
+
+    @Test
+    public final void testWSMPublisherConstructor3() {
+        try {
+
+            EndpointReference epr = new EndpointReference("http://invalid/broker/address");
+
+            WSMPublisher publisher = new WSMPublisher(10, false, epr.getAddress());
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail();
+        }
+    }
+
+    @Test
+    public final void testWSMPublisherConstructor4() {
+        try {
+
+            EndpointReference epr = new EndpointReference("http://invalid/broker/address");
+
+            // According to addressing format.
+            String eprFormat = "<BrokerEPR><wsa:Address xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">%s</wsa:Address></BrokerEPR>";
+
+            String str = String.format(eprFormat, "http://invalid/broker/address");
+
+            WSMPublisher publisher = new WSMPublisher(10, false, str, true);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail();
+        }
+    }
+
+    @Test
+    public final void testWSMPublisherConstructor5() {
+        // try {
+        //
+        // EndpointReference epr = new EndpointReference(
+        // "http://invalid/broker/address");
+        //
+        // AnnotationProps annotationProps = AnnotationProps.newProps(
+        // AnnotationConsts.ExperimentID, "TestexperId1");
+        // annotationProps.set(AnnotationConsts.ServiceLocation,
+        // "testServiceAddress");
+        //
+        // ConstructorProps props = ConstructorProps.newProps();
+        // props.set(ConstructorConsts.BROKER_EPR, epr.getAddress());
+        // props.set(ConstructorConsts.ENABLE_ASYNC_PUBLISH, "false");
+        // props.set(ConstructorConsts.ENABLE_BATCH_PROVENANCE, "false");
+        // props.set(ConstructorConsts.ANNOTATIONS, annotationProps);
+        //
+        // Notifier notifier = NotifierFactory.createGenericNotifier();
+        //
+        // } catch (Exception e) {
+        // e.printStackTrace();
+        // fail();
+        // }
+    }
+
+}

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/MessagePullerTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/MessagePullerTest.java?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/MessagePullerTest.java (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/MessagePullerTest.java Sun Jul  3 18:32:59 2011
@@ -0,0 +1,132 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ *   http://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.
+ *
+ */
+
+package org.apache.airavata.workflow.tracking.tests.messagebox;
+
+import java.io.StringReader;
+import java.net.URL;
+import java.util.Properties;
+import java.util.UUID;
+
+import org.apache.airavata.commons.WorkFlowUtils;
+import org.apache.airavata.workflow.tracking.client.Callback;
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+import org.apache.airavata.workflow.tracking.client.NotificationType;
+import org.apache.airavata.workflow.tracking.client.Subscription;
+import org.apache.airavata.workflow.tracking.tests.util.CommonUtils;
+import org.apache.airavata.workflow.tracking.tests.util.TestConfigKeys;
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.log4j.Logger;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.impl.tool.XSTCTester.TestCase;
+
+public class MessagePullerTest extends TestCase {
+
+    static Properties configs = new Properties();
+    String BROKER_URL;
+    String MESSAGEBOX_URL;
+    int consumerPort;
+    public static final String TEST_TOPIC = "3a9c7b20-0475-11db-ba88-b61b57d3be03";
+    private static final String MESSAGE_BOX_ID = UUID.randomUUID().toString();
+    public static int count = 0;
+    public int messages = 10;
+    public static Object mutex = new Object();
+    private org.apache.log4j.Logger logger = Logger.getLogger(MessagePullerTest.class);
+    Subscription sub;
+    String AXIS_REPO;
+
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+
+    }
+
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        URL configURL = ClassLoader.getSystemResource(TestConfigKeys.CONFIG_FILE_NAME);
+        configs.load(configURL.openStream());
+        BROKER_URL = configs.getProperty(TestConfigKeys.BROKER_EVENTING_SERVICE_EPR);
+        MESSAGEBOX_URL = configs.getProperty(TestConfigKeys.MSGBOX_SERVICE_EPR);
+        consumerPort = Integer.parseInt(configs.getProperty(TestConfigKeys.CONSUMER_PORT));
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    private boolean wait = true;
+
+    public void testMessagePulling() throws Exception {
+        Subscription subscription = null;
+
+        Callback testCallback1 = new Callback() {
+            public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {
+                System.out.println("Notification Received, notification of type:" + type);
+                assertEquals(type, NotificationType.WorkflowInitialized);
+                wait = false;
+            }
+        };
+
+        subscription = LeadNotificationManager.createMessageBoxSubscription(MESSAGEBOX_URL, BROKER_URL, TEST_TOPIC,
+                null, testCallback1);
+
+        System.out.println(subscription.getMessageBoxEPR());
+        System.out.println(subscription.getSubscriptionID());
+
+        WseMsgBrokerClient client = new WseMsgBrokerClient();
+        client.init(BROKER_URL);
+
+        OMElement msg = WorkFlowUtils.reader2OMElement(new StringReader(CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION));
+
+        client.publish(TEST_TOPIC, msg);
+
+        EndpointReference MSG_BOX_EPR = subscription.getMessageBoxEPR();
+        System.out.println(MSG_BOX_EPR);
+        String subscriptionID = subscription.getSubscriptionID();
+        Callback testCallback2 = new Callback() {
+
+            public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {
+
+                System.out.println("Notification Received, notification of type:" + type);
+                assertEquals(type, NotificationType.WorkflowInitialized);
+                wait = false;
+
+            }
+        };
+        subscription = LeadNotificationManager.startListeningToSavedSubscription(BROKER_URL, MSG_BOX_EPR,
+                subscriptionID, TEST_TOPIC, null, testCallback2, true);
+
+        System.out.println(subscription.getMessageBoxEPR());
+
+        while (wait) {
+
+            Thread.sleep(1000);
+
+        }
+
+        System.out.println("MessagePuller test completed");
+        subscription.destroy();
+    }
+}

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/MultipleSubscriptionForMessageBoxTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/MultipleSubscriptionForMessageBoxTest.java?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/MultipleSubscriptionForMessageBoxTest.java (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/MultipleSubscriptionForMessageBoxTest.java Sun Jul  3 18:32:59 2011
@@ -0,0 +1,111 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ *   http://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.
+ *
+ */
+
+package org.apache.airavata.workflow.tracking.tests.messagebox;
+
+import java.io.StringReader;
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.airavata.commons.WorkFlowUtils;
+import org.apache.airavata.workflow.tracking.tests.ThreadMessagePassingCallback;
+import org.apache.airavata.workflow.tracking.tests.util.CommonUtils;
+import org.apache.airavata.workflow.tracking.tests.util.TestConfigKeys;
+import org.apache.axiom.om.OMElement;
+import org.apache.log4j.Logger;
+import org.apache.xmlbeans.impl.tool.XSTCTester.TestCase;
+
+public class MultipleSubscriptionForMessageBoxTest extends TestCase implements ThreadMessagePassingCallback {
+
+    static Properties configs = new Properties();
+    String BROKER_URL;
+    String MESSAGEBOX_URL;
+    int consumerPort;
+    public static final String TEST_TOPIC = "3a9c7b20-0475-11db-ba88-b61b57d3be03";
+    public static final int NOTIFICATIONS_PUBLISHED = 10;
+    public static final int NUMBER_OF_SUBSCRIBERS = 1;
+    private org.apache.log4j.Logger logger = Logger.getLogger(MultipleSubscriptionForMessageBoxTest.class);
+
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+
+    }
+
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        URL configURL = ClassLoader.getSystemResource(TestConfigKeys.CONFIG_FILE_NAME);
+        configs.load(configURL.openStream());
+        BROKER_URL = configs.getProperty(TestConfigKeys.BROKER_EVENTING_SERVICE_EPR);
+        MESSAGEBOX_URL = configs.getProperty(TestConfigKeys.MSGBOX_SERVICE_EPR);
+        consumerPort = Integer.parseInt(configs.getProperty(TestConfigKeys.CONSUMER_PORT));
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    private int succesfulclients = 0;
+
+    @Test
+    public void testMultipleSubscribers() throws Exception {
+
+        SubscriberThread[] subscribers = new SubscriberThread[NUMBER_OF_SUBSCRIBERS];
+        for (int i = 0; i < NUMBER_OF_SUBSCRIBERS; ++i) {
+            subscribers[i] = new SubscriberThread(MESSAGEBOX_URL, BROKER_URL, TEST_TOPIC, this, "MytestId331234"
+                    + Integer.toString(i));
+            subscribers[i].start();
+
+        }
+
+        Thread.sleep(100);
+
+        WseMsgBrokerClient client = new WseMsgBrokerClient();
+        client.init(BROKER_URL);
+
+        OMElement msg = WorkFlowUtils.reader2OMElement(new StringReader(CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION));
+
+        for (int j = 0; j < NUMBER_OF_SUBSCRIBERS; j++) {
+            for (int i = 0; i < NOTIFICATIONS_PUBLISHED; i++) {
+
+                client.publish(TEST_TOPIC, msg);
+
+                Thread.sleep(100);
+            }
+        }
+
+        while (succesfulclients < NUMBER_OF_SUBSCRIBERS - 1) {
+            Thread.sleep(1000);
+        }
+        Thread.sleep(5000);
+        System.out.println("All successful");
+        System.exit(0);
+
+    }
+
+    public void done() {
+        succesfulclients++;
+    }
+
+}

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/RenewSubscriptionTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/RenewSubscriptionTest.java?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/RenewSubscriptionTest.java (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/RenewSubscriptionTest.java Sun Jul  3 18:32:59 2011
@@ -0,0 +1,107 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ *   http://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.
+ *
+ */
+
+package org.apache.airavata.workflow.tracking.tests.messagebox;
+
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.airavata.workflow.tracking.client.Callback;
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+import org.apache.airavata.workflow.tracking.client.NotificationType;
+import org.apache.airavata.workflow.tracking.client.Subscription;
+import org.apache.airavata.workflow.tracking.tests.util.TestConfigKeys;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.impl.tool.XSTCTester.TestCase;
+
+public class RenewSubscriptionTest extends TestCase implements Callback {
+
+    static Properties configs = new Properties();
+    String BROKER_URL;
+    String MESSAGEBOX_URL;
+    int consumerPort;
+    public static final String TEST_TOPIC = "3a9c7b20-0475-11db-ba88-b61b57d3be03";
+    public static int count = 0;
+    public int messages = 10;
+    public static Object mutex = new Object();
+    Subscription sub;
+    private static String TOPIC = "RENEW_TOPIC" + Math.random();
+    private static int counter = 0;
+
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+
+    }
+
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        URL configURL = ClassLoader.getSystemResource(TestConfigKeys.CONFIG_FILE_NAME);
+        configs.load(configURL.openStream());
+        BROKER_URL = configs.getProperty(TestConfigKeys.BROKER_EVENTING_SERVICE_EPR);
+        MESSAGEBOX_URL = configs.getProperty(TestConfigKeys.MSGBOX_SERVICE_EPR);
+        consumerPort = Integer.parseInt(configs.getProperty(TestConfigKeys.CONSUMER_PORT));
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    @Test
+    public void testRenewSubscription() throws Exception {
+        Subscription sub = LeadNotificationManager.createMessageBoxSubscription(MESSAGEBOX_URL, BROKER_URL, TOPIC,
+                null, this, false);
+
+        WseMsgBrokerClient client = new WseMsgBrokerClient();
+        client.init(BROKER_URL);
+
+        OMElement msg = OMAbstractFactory.getOMFactory().createOMElement("test", null);
+        msg.setText("mustwork");
+        client.publish(TOPIC, msg);
+        // sub.destroy();
+
+        msg.setText("destroyed");
+        client.publish(TOPIC, msg);
+        Subscription sub2 = LeadNotificationManager.renewMessageboxSubscription(BROKER_URL, sub.getMessageBoxEPR(),
+                sub.getSubscriptionID(), TOPIC, null, false);
+
+        msg.setText("mustworkagain");
+        client.publish(TOPIC, msg);
+
+        System.out.println(sub2.getSubscriptionID());
+        while (counter < 2) {
+            Thread.sleep(1000);
+        }
+        Thread.sleep(10000);
+    }
+
+    public void deliverMessage(String topic, NotificationType notificationType, XmlObject messageObj) {
+        System.out.println("Callbacked");
+        System.out.println(messageObj.toString());
+        counter++;
+    }
+
+}

Added: incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/SubscriberThread.java
URL: http://svn.apache.org/viewvc/incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/SubscriberThread.java?rev=1142475&view=auto
==============================================================================
--- incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/SubscriberThread.java (added)
+++ incubator/airavata/ws-messaging/trunk/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/SubscriberThread.java Sun Jul  3 18:32:59 2011
@@ -0,0 +1,95 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ *   http://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.
+ *
+ */
+
+package org.apache.airavata.workflow.tracking.tests.messagebox;
+
+import java.rmi.RemoteException;
+
+import org.apache.airavata.workflow.tracking.client.Callback;
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+import org.apache.airavata.workflow.tracking.client.NotificationType;
+import org.apache.airavata.workflow.tracking.client.Subscription;
+import org.apache.airavata.workflow.tracking.tests.ThreadMessagePassingCallback;
+import org.apache.log4j.Logger;
+import org.apache.xmlbeans.XmlObject;
+
+public class SubscriberThread extends Thread {
+
+    private ThreadMessagePassingCallback callback;
+
+    private int subCount = 0;
+    private Subscription subscription;
+    private String brokerURL;
+    private String topic;
+    private String messageboxUrl;
+    private String msgBoxId;
+    private org.apache.log4j.Logger logger = Logger.getLogger(SubscriberThread.class);
+
+    public SubscriberThread(String messageboxUrl, String brokerURL, String topic,
+            ThreadMessagePassingCallback callback, String msgBoxId) {
+        super();
+        this.msgBoxId = msgBoxId;
+        this.callback = callback;
+        this.brokerURL = brokerURL;
+        this.topic = topic;
+        this.messageboxUrl = messageboxUrl;
+    }
+
+    @Override
+    public void run() {
+        try {
+            subscription = LeadNotificationManager.createMessageBoxSubscription(messageboxUrl, brokerURL, topic, null,
+                    new Callback() {
+
+                        public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {
+
+                            subCount++;
+                            System.out.println("Subscription received " + subCount + "th notification of type:" + type);
+                            assert (type == NotificationType.WorkflowInitialized);
+                            System.out.println("subcount=" + subCount + " =="
+                                    + MultipleSubscriptionForMessageBoxTest.NOTIFICATIONS_PUBLISHED);
+                            if (subCount == MultipleSubscriptionForMessageBoxTest.NOTIFICATIONS_PUBLISHED) {
+                                System.out.println("subscription destroyed");
+                                try {
+                                    subscription.destroy();
+                                } catch (RemoteException e) {
+                                    // TODO Auto-generated catch block
+                                    e.printStackTrace();
+                                }
+                                callback.done();
+                            }
+                        }
+                    }, true);
+        } catch (Exception e) {
+            logger.error("exception in suscriber thread :" + e);
+            e.printStackTrace();
+        }
+        while (true) {
+            try {
+                Thread.sleep(10000);
+            } catch (InterruptedException e) {
+                logger.error("exception in suscriber thread sleep: " + e);
+                e.printStackTrace();
+            }
+        }
+    }
+
+}



Mime
View raw message