airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From patanac...@apache.org
Subject svn commit: r1170934 - in /incubator/airavata/trunk/modules/ws-messenger/messagebroker: ./ src/main/java/org/apache/airavata/wsmg/broker/ src/main/java/org/apache/airavata/wsmg/broker/context/ src/main/java/org/apache/airavata/wsmg/broker/subscription/...
Date Thu, 15 Sep 2011 02:47:54 GMT
Author: patanachai
Date: Thu Sep 15 02:47:52 2011
New Revision: 1170934

URL: http://svn.apache.org/viewvc?rev=1170934&view=rev
Log:
Change classes to use ws-messenger-commons

Added:
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/BrokerUtil.java
      - copied, changed from r1170929, incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsmgUtil.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/apache/
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/BrokerUtilTest.java
      - copied, changed from r1170929, incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/wsmg/util/TestWsmgUtil.java
Modified:
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/pom.xml
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/NotificationProcessor.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContextFactory.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionState.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProcessingContextBuilder.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProtocolSupport.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNTProtocolSupport.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationProcessingContextBuilder.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/CommonMsgBrokerClient.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/ConsumerMsgReceiver.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/ConsumerNotificationHandler.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/ConsumerServer.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/ConsumerServerHandler.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/ConsumerService.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/MessageBrokerClient.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/MsgBrokerClientException.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/NotificationHandler.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/NotificationProducerStub.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/SubscriptionInfo.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/SubscriptionStub.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/WidgetStub.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/WseCreateSubscription.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/WseMsgBrokerClient.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/WsntCreatePublishReg.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/WsntMsgBrokerClient.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/WsrfResourceStub.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/client/msgbox/
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/CommonRoutines.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/NotificationProducer.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/WsmgCommonConstants.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/WsmgNameSpaceConstants.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/WsmgVersion.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/ConnectionPool.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/JdbcStorage.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/gui/
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/CurrentDate.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/DcDate.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsmgUtil.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/wsmg/gui/
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/wsmg/util/TestDcDate.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/wsmg/util/TestWsmgUtil.java

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/pom.xml?rev=1170934&r1=1170933&r2=1170934&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/pom.xml (original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/pom.xml Thu Sep 15 02:47:52
2011
@@ -1,5 +1,5 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <parent>
         <artifactId>airavata-ws-messenger</artifactId>
@@ -32,7 +32,7 @@
                 <version>1.5</version>
                 <configuration>
                     <servicesXmlFile>src/main/resources/services.xml</servicesXmlFile>
-                    <!--wsdlFile>src/main/resources/services.wsdl</wsdlFile-->
+                    <!--wsdlFile>src/main/resources/services.wsdl</wsdlFile -->
 
                     <fileSets>
                         <fileSet>
@@ -67,10 +67,13 @@
     </build>
 
     <dependencies>
+
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
+            <groupId>airavata</groupId>
+            <artifactId>airavata-messenger-commons</artifactId>
+            <version>${airavata.version}</version>
         </dependency>
+        
         <dependency>
             <groupId>edu.berkeley</groupId>
             <artifactId>yfilter</artifactId>
@@ -100,14 +103,29 @@
             <artifactId>axis2-transport-local</artifactId>
         </dependency>
         <dependency>
-            <groupId>airavata</groupId>
-            <artifactId>airavata-messagebox</artifactId>
-            <version>${airavata.version}</version>
-        </dependency>
-        <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
         </dependency>
+
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+
+        <!-- Test -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>airavata</groupId>
+            <artifactId>airavata-messenger-client</artifactId>
+            <version>${airavata.version}</version>
+            <scope>test</scope>
+        </dependency>
+
     </dependencies>
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/NotificationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/NotificationProcessor.java?rev=1170934&r1=1170933&r2=1170934&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/NotificationProcessor.java
(original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/NotificationProcessor.java
Thu Sep 15 02:47:52 2011
@@ -37,7 +37,7 @@ import org.apache.airavata.wsmg.config.W
 import org.apache.airavata.wsmg.matching.AbstractMessageMatcher;
 import org.apache.airavata.wsmg.messenger.OutGoingQueue;
 import org.apache.airavata.wsmg.util.RunTimeStatistics;
-import org.apache.airavata.wsmg.util.WsmgUtil;
+import org.apache.airavata.wsmg.util.BrokerUtil;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
@@ -154,7 +154,7 @@ public class NotificationProcessor {
             }
         } else {
 
-            topicLocalString = WsmgUtil.getTopicLocalString(topicEl.getText());
+            topicLocalString = BrokerUtil.getTopicLocalString(topicEl.getText());
             try {
                 topicElString = topicEl.toStringWithConsume();
             } catch (XMLStreamException e) {
@@ -228,7 +228,7 @@ public class NotificationProcessor {
                     .getNamespaceURI(), "Topic"));
             if (topicEl != null) {
 
-                topicLocalString = WsmgUtil.getTopicLocalString(topicEl.getText()); // get
what ever inside this element
+                topicLocalString = BrokerUtil.getTopicLocalString(topicEl.getText()); //
get what ever inside this element
 
                 try {
                     topicElString = topicEl.toStringWithConsume();

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContextFactory.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContextFactory.java?rev=1170934&r1=1170933&r2=1170934&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContextFactory.java
(original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContextFactory.java
Thu Sep 15 02:47:52 2011
@@ -24,7 +24,7 @@ package org.apache.airavata.wsmg.broker.
 import java.util.Iterator;
 
 import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.util.WsmgUtil;
+import org.apache.airavata.wsmg.util.BrokerUtil;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.soap.SOAPHeader;
 import org.apache.axis2.context.MessageContext;
@@ -140,7 +140,7 @@ public class ProcessingContextFactory im
         ProcessingContext context = createProcessingContext(msgContext.getEnvelope());
         context.setMessageConext(msgContext);
 
-        String topicFromUrl = WsmgUtil.getTopicFromRequestPath(msgContext.getTo().getAddress());
+        String topicFromUrl = BrokerUtil.getTopicFromRequestPath(msgContext.getTo().getAddress());
         context.setContextParameter(ContextParameters.TOPIC_FROM_URL, topicFromUrl);
 
         return context;

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionState.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionState.java?rev=1170934&r1=1170933&r2=1170934&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionState.java
(original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionState.java
Thu Sep 15 02:47:52 2011
@@ -35,7 +35,7 @@ import org.apache.airavata.wsmg.commons.
 import org.apache.airavata.wsmg.commons.util.OMElementComparator;
 import org.apache.airavata.wsmg.messenger.OutGoingQueue;
 import org.apache.airavata.wsmg.transports.jms.MessageMatcherConnection;
-import org.apache.airavata.wsmg.util.WsmgUtil;
+import org.apache.airavata.wsmg.util.BrokerUtil;
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.log4j.Logger;
@@ -267,8 +267,8 @@ public class SubscriptionState {
         if (o instanceof SubscriptionState) {
             SubscriptionState subscription = (SubscriptionState) o;
 
-            ret = WsmgUtil.sameStringValue(subscription.getLocalTopic(), this.getLocalTopic())
-                    && WsmgUtil.sameStringValue(subscription.getXpathString(), this.getXpathString())
+            ret = BrokerUtil.sameStringValue(subscription.getLocalTopic(), this.getLocalTopic())
+                    && BrokerUtil.sameStringValue(subscription.getXpathString(),
this.getXpathString())
                     && (subscription.getConsumerIPAddressStr().compareTo(this.getConsumerIPAddressStr()))
== 0
                     && equalReferenceParameters(subscription);
 

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProcessingContextBuilder.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProcessingContextBuilder.java?rev=1170934&r1=1170933&r2=1170934&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProcessingContextBuilder.java
(original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProcessingContextBuilder.java
Thu Sep 15 02:47:52 2011
@@ -31,7 +31,7 @@ import org.apache.airavata.wsmg.broker.c
 import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
 import org.apache.airavata.wsmg.commons.WsmgNameSpaceConstants;
 import org.apache.airavata.wsmg.util.WsEventingOperations;
-import org.apache.airavata.wsmg.util.WsmgUtil;
+import org.apache.airavata.wsmg.util.BrokerUtil;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.soap.SOAPBody;
 import org.apache.axiom.soap.SOAPEnvelope;
@@ -100,7 +100,7 @@ public class WSEProcessingContextBuilder
         processingContext.setMessageConext(msgContext);
         processingContext.setEnvelope(msgContext.getEnvelope());
         extractInfoFromHeader(processingContext, msgContext.getEnvelope().getHeader());
-        String topicFromUrl = WsmgUtil.getTopicFromRequestPath(msgContext.getTo().getAddress());
+        String topicFromUrl = BrokerUtil.getTopicFromRequestPath(msgContext.getTo().getAddress());
 
         processingContext.setContextParameter(ContextParameters.TOPIC_FROM_URL, topicFromUrl);
 

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProtocolSupport.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProtocolSupport.java?rev=1170934&r1=1170933&r2=1170934&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProtocolSupport.java
(original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProtocolSupport.java
Thu Sep 15 02:47:52 2011
@@ -29,12 +29,11 @@ import javax.xml.namespace.QName;
 import org.apache.airavata.wsmg.broker.context.ContextParameters;
 import org.apache.airavata.wsmg.broker.context.ProcessingContext;
 import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
-import org.apache.airavata.wsmg.client.MsgBrokerClientException;
 import org.apache.airavata.wsmg.commons.CommonRoutines;
 import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
 import org.apache.airavata.wsmg.commons.WsmgNameSpaceConstants;
 import org.apache.airavata.wsmg.messenger.OutGoingQueue;
-import org.apache.airavata.wsmg.util.WsmgUtil;
+import org.apache.airavata.wsmg.util.BrokerUtil;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
@@ -91,7 +90,7 @@ public class WSEProtocolSupport {
             String filterDialectAttrib = filterEl.getAttributeValue(new QName(null, "Dialect"));
 
             if (filterDialectAttrib.compareTo(WsmgCommonConstants.TOPIC_EXPRESSION_SIMPLE_DIALECT)
== 0) {
-                topicLocalString = WsmgUtil.getTopicLocalString(filterEl.getText()); // get
what ever inside this
+                topicLocalString = BrokerUtil.getTopicLocalString(filterEl.getText()); //
get what ever inside this
                                                                                      // element
 
                 if (topicLocalString == null) {
@@ -120,7 +119,7 @@ public class WSEProtocolSupport {
                 OMElement topicEl = filterEl.getFirstChildWithName(new QName(WsmgNameSpaceConstants.WSNT_NS
                         .getNamespaceURI(), "TopicExpression"));
                 if (topicEl != null) {
-                    topicLocalString = WsmgUtil.getTopicLocalString(topicEl.getText());
+                    topicLocalString = BrokerUtil.getTopicLocalString(topicEl.getText());
                 }
                 OMElement xpathEl = filterEl.getFirstChildWithName(new QName(WsmgNameSpaceConstants.WSNT_NS
                         .getNamespaceURI(), "MessageContent"));
@@ -202,121 +201,4 @@ public class WSEProtocolSupport {
         Date expiration = cal.getTime(); // Retrieve the resulting date
         return expiration;
     }
-
-    public static class Client {
-
-        public static EndpointReference createEndpointReference(String brokerURL, String
topic) {
-            if (brokerURL == null) {
-                throw new IllegalArgumentException("Broker URL is null.");
-            }
-            if (topic == null) {
-                throw new IllegalArgumentException("Topic is null.");
-            }
-
-            String sinkLocation = brokerURL.endsWith("/") ? brokerURL + "topic/" + topic
: brokerURL + "/topic/"
-                    + topic;
-
-            EndpointReference eventSinkReference = new EndpointReference(sinkLocation);
-            return eventSinkReference;
-        }
-
-        private static OMElement createFilter(String topicExpression, String xpathExpression)
{
-
-            boolean hasTopicExpression = (topicExpression != null && topicExpression.length()
!= 0);
-            boolean hasXPathExpression = (xpathExpression != null && xpathExpression.length()
!= 0);
-
-            OMFactory factory = OMAbstractFactory.getOMFactory();
-            OMElement filterEl = null;
-
-            if (hasTopicExpression && hasXPathExpression) {
-                filterEl = factory.createOMElement("Filter", WsmgNameSpaceConstants.WSE_NS);
-
-                filterEl.addAttribute("Dialect", WsmgCommonConstants.TOPIC_AND_XPATH_DIALECT,
null);
-                OMElement topicExpressionEl = factory
-                        .createOMElement("TopicExpression", WsmgNameSpaceConstants.WSNT_NS);
-                topicExpressionEl.addAttribute("Dialect", WsmgCommonConstants.TOPIC_EXPRESSION_SIMPLE_DIALECT,
null);
-                topicExpressionEl.declareNamespace(WsmgNameSpaceConstants.WIDGET_NS);
-                topicExpressionEl.setText(WsmgNameSpaceConstants.WIDGET_NS.getPrefix() +
":" + topicExpression);
-                filterEl.addChild(topicExpressionEl);
-                OMElement xpathEl = factory.createOMElement("MessageContent", WsmgNameSpaceConstants.WSNT_NS);
-                xpathEl.addAttribute("Dialect", WsmgCommonConstants.XPATH_DIALECT, null);
-                xpathEl.setText(xpathExpression);
-                filterEl.addChild(xpathEl);
-            } else if (hasTopicExpression) {
-                filterEl = factory.createOMElement("Filter", WsmgNameSpaceConstants.WSE_NS);
-
-                filterEl.addAttribute("Dialect", WsmgCommonConstants.TOPIC_EXPRESSION_SIMPLE_DIALECT,
null);
-                filterEl.declareNamespace(WsmgNameSpaceConstants.WIDGET_NS);
-                filterEl.setText(WsmgNameSpaceConstants.WIDGET_NS.getPrefix() + ":" + topicExpression);
-            } else if (hasXPathExpression) {
-                filterEl = factory.createOMElement("Filter", WsmgNameSpaceConstants.WSE_NS);
-
-                filterEl.addAttribute("Dialect", WsmgCommonConstants.XPATH_DIALECT, null);
-                filterEl.setText(xpathExpression);
-            }
-
-            return filterEl;
-        }
-
-        public static OMElement createSubscription(EndpointReference eventSink, String topicExpression,
-                String xpathExpression, long expireTime) throws AxisFault {
-
-            OMFactory factory = OMAbstractFactory.getOMFactory();
-            OMElement subscribeMsg = factory.createOMElement("Subscribe", WsmgNameSpaceConstants.WSE_NS);
-
-            OMElement delivery = factory.createOMElement("Delivery", WsmgNameSpaceConstants.WSE_NS);
-
-            OMElement expires = factory.createOMElement("Expires", WsmgNameSpaceConstants.WSE_NS);
-            expires.setText(Long.toString(expireTime));
-            subscribeMsg.addChild(expires);
-
-            OMElement notifyTo = EndpointReferenceHelper.toOM(factory, eventSink, new QName(
-                    WsmgNameSpaceConstants.WSE_NS.getNamespaceURI(), "NotifyTo"), WsmgNameSpaceConstants.WSA_NS
-                    .getNamespaceURI());
-
-            delivery.addChild(notifyTo);
-            subscribeMsg.addChild(delivery);
-
-            OMElement filterEl = createFilter(topicExpression, xpathExpression);
-
-            if (filterEl != null) {
-                subscribeMsg.addChild(filterEl);
-            }
-
-            subscribeMsg.declareNamespace(WsmgNameSpaceConstants.WSA_NS);
-
-            return subscribeMsg;
-        }
-
-        public static String decodeSubscribeResponse(OMElement responseSubscriptionsManagerElement)
-                throws MsgBrokerClientException {
-            String subscriptionId = null;
-            OMElement referencePropertiesEl = responseSubscriptionsManagerElement.getFirstChildWithName(new
QName(
-                    WsmgNameSpaceConstants.WSA_NS.getNamespaceURI(), "ReferenceProperties"));
-
-            if (referencePropertiesEl == null) {
-                referencePropertiesEl = responseSubscriptionsManagerElement.getFirstChildWithName(new
QName(
-                        WsmgNameSpaceConstants.WSA_NS.getNamespaceURI(), "ReferenceParameters"));
-            }
-
-            OMElement identifierEl = referencePropertiesEl.getFirstChildWithName(new QName(
-                    WsmgNameSpaceConstants.WSE_NS.getNamespaceURI(), WsmgCommonConstants.SUBSCRIPTION_ID));
-
-            if (identifierEl == null) {
-                throw new MsgBrokerClientException("invalid response message, subscription
id was not sent by broker");
-            }
-
-            subscriptionId = identifierEl.getText();
-            return subscriptionId;
-        }
-
-        public static OMElement createUnsubscribeMsg() {
-            OMFactory factory = OMAbstractFactory.getOMFactory();
-            OMElement message = factory.createOMElement("Unsubscribe", WsmgNameSpaceConstants.WSE_NS);
-
-            return message;
-        }
-
-    }
-
 }

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNTProtocolSupport.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNTProtocolSupport.java?rev=1170934&r1=1170933&r2=1170934&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNTProtocolSupport.java
(original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNTProtocolSupport.java
Thu Sep 15 02:47:52 2011
@@ -31,7 +31,7 @@ import org.apache.airavata.wsmg.broker.s
 import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
 import org.apache.airavata.wsmg.commons.WsmgNameSpaceConstants;
 import org.apache.airavata.wsmg.messenger.OutGoingQueue;
-import org.apache.airavata.wsmg.util.WsmgUtil;
+import org.apache.airavata.wsmg.util.BrokerUtil;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
@@ -85,13 +85,13 @@ public class WSNTProtocolSupport {
         OMElement topicExpressionEl = ctx.getContextParameter(ContextParameters.TOPIC_EXPRESSION_ELEMENT);
 
         if (topicExpressionEl != null) {
-            topicLocalString = WsmgUtil.getTopicLocalString(topicExpressionEl.getText());
+            topicLocalString = BrokerUtil.getTopicLocalString(topicExpressionEl.getText());
         }
 
         OMElement xpathEl = ctx.getContextParameter(ContextParameters.XPATH_ELEMENT);
 
         if (xpathEl != null) {
-            xpathString = WsmgUtil.getXPathString(xpathEl);
+            xpathString = BrokerUtil.getXPathString(xpathEl);
         }
         if (xpathString == null && topicLocalString == null) {
             throw new AxisFault("Both topic string and XPath String are null!");

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationProcessingContextBuilder.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationProcessingContextBuilder.java?rev=1170934&r1=1170933&r2=1170934&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationProcessingContextBuilder.java
(original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationProcessingContextBuilder.java
Thu Sep 15 02:47:52 2011
@@ -31,7 +31,7 @@ import org.apache.airavata.wsmg.broker.c
 import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
 import org.apache.airavata.wsmg.commons.WsmgNameSpaceConstants;
 import org.apache.airavata.wsmg.util.WsNotificationOperations;
-import org.apache.airavata.wsmg.util.WsmgUtil;
+import org.apache.airavata.wsmg.util.BrokerUtil;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.soap.SOAPBody;
 import org.apache.axiom.soap.SOAPEnvelope;
@@ -156,7 +156,7 @@ public class WSNotificationProcessingCon
         context.setEnvelope(soapEnvelope);
         extractInfoFromHeader(context, soapHeader);
         context.setMessageConext(msgContext);
-        String topicFromUrl = WsmgUtil.getTopicFromRequestPath(msgContext.getTo().getAddress());
+        String topicFromUrl = BrokerUtil.getTopicFromRequestPath(msgContext.getTo().getAddress());
         context.setContextParameter(ContextParameters.TOPIC_FROM_URL, topicFromUrl);
 
         return context;

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/JdbcStorage.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/JdbcStorage.java?rev=1170934&r1=1170933&r2=1170934&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/JdbcStorage.java
(original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/JdbcStorage.java
Thu Sep 15 02:47:52 2011
@@ -21,15 +21,13 @@
 
 package org.apache.airavata.wsmg.commons.storage;
 
-import org.apache.airavata.wsmg.msgbox.Storage.dbpool.DatabaseCreator;
-
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 import java.sql.Statement;
-import org.apache.airavata.wsmg.msgbox.Storage.dbpool.ConnectionPool;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java?rev=1170934&r1=1170933&r2=1170934&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java
(original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java
Thu Sep 15 02:47:52 2011
@@ -48,7 +48,6 @@ import org.apache.airavata.wsmg.commons.
 import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
 import org.apache.airavata.wsmg.config.ConfigurationManager;
 import org.apache.airavata.wsmg.config.WSMGParameter;
-import org.apache.airavata.wsmg.msgbox.Storage.dbpool.DatabaseCreator;
 import org.apache.airavata.wsmg.util.Counter;
 import org.apache.airavata.wsmg.util.TimerThread;
 import org.apache.axiom.om.OMElement;

Copied: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/BrokerUtil.java
(from r1170929, incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsmgUtil.java)
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/BrokerUtil.java?p2=incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/BrokerUtil.java&p1=incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsmgUtil.java&r1=1170929&r2=1170934&rev=1170934&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsmgUtil.java
(original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/BrokerUtil.java
Thu Sep 15 02:47:52 2011
@@ -21,9 +21,6 @@
 
 package org.apache.airavata.wsmg.util;
 
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
 import javax.xml.namespace.QName;
 
 import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
@@ -31,56 +28,7 @@ import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.AxisFault;
 
-public class WsmgUtil {
-    private static final String BODY = "Body";
-
-    private static final String ACTION = "Action";
-
-    private static final String MESSAGE_ID = "MessageID";
-
-    private static final String XMLNS_WIDGET = "xmlns:widget";
-
-    private static final String DIALECT = "Dialect";
-
-    private static final String TOPIC = "Topic";
-
-    private static final String TO = "To";
-
-    private static final String HEADER = "Header";
-
-    private static final String ENVELOPE = "Envelope";
-
-    private static final String WSNT = "wsnt";
-
-    private static final String XSI = "xsi";
-
-    private static final String WA48 = "wa48";
-
-    private static final String S = "S";
-
-    private static final String HTTP_WIDGETS_COM = "http://widgets.com";
-
-    private static final String HTTP_WWW_IBM_COM_XMLNS_STDWIP_WEB_SERVICES_WS_TOPICS_TOPIC_EXPRESSION_SIMPLE
= "http://www.ibm.com/xmlns/stdwip/web-services/WS-Topics/TopicExpression/simple";
-
-    private static final String HTTP_WWW_IBM_COM_XMLNS_STDWIP_WEB_SERVICES_WS_BASE_NOTIFICATION
= "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification";
-
-    private static final String HTTP_WWW_W3_ORG_2001_XMLSCHEMA_INSTANCE = "http://www.w3.org/2001/XMLSchema-instance";
-
-    private static final String HTTP_SCHEMAS_XMLSOAP_ORG_WS_2004_08_ADDRESSING = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
-
-    private static final String HTTP_SCHEMAS_XMLSOAP_ORG_SOAP_ENVELOPE = "http://schemas.xmlsoap.org/soap/envelope/";
-
-    public static String formatURLString(String url) {
-
-        if (url == null) {
-            throw new IllegalArgumentException("url can't be null");
-        }
-
-        if (url.indexOf("//") < 0) {
-            url = "http://" + url; // use default http
-        }
-        return url;
-    }
+public class BrokerUtil {  
 
     public static boolean sameStringValue(String stringA, String stringB) {
         if (stringA == null) {
@@ -100,19 +48,6 @@ public class WsmgUtil {
 
     }
 
-    public static String getHostIP() {
-        InetAddress localAddress = null;
-        try {
-            localAddress = InetAddress.getLocalHost();
-        } catch (UnknownHostException ex) {
-            System.out.println("Error - unable to resolve localhost");
-        }
-        // Use IP address since DNS entry cannot update the laptop's entry
-        // promptly
-        String hostIP = localAddress.getHostAddress();
-        return hostIP;
-    }
-
     public static String getTopicLocalString(String filterText) {
 
         if (filterText == null)

Copied: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/BrokerUtilTest.java
(from r1170929, incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/wsmg/util/TestWsmgUtil.java)
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/BrokerUtilTest.java?p2=incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/BrokerUtilTest.java&p1=incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/wsmg/util/TestWsmgUtil.java&r1=1170929&r2=1170934&rev=1170934&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/wsmg/util/TestWsmgUtil.java
(original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/BrokerUtilTest.java
Thu Sep 15 02:47:52 2011
@@ -19,7 +19,7 @@
  *
  */
 
-package wsmg.util;
+package org.apache.airavata.wsmg.util;
 
 import javax.xml.namespace.QName;
 
@@ -27,7 +27,7 @@ import junit.framework.TestCase;
 
 import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
 import org.apache.airavata.wsmg.commons.WsmgNameSpaceConstants;
-import org.apache.airavata.wsmg.util.WsmgUtil;
+import org.apache.airavata.wsmg.util.BrokerUtil;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
@@ -37,7 +37,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-public class TestWsmgUtil extends TestCase {
+public class BrokerUtilTest extends TestCase {
 
     /**
      * @throws java.lang.Exception
@@ -52,65 +52,37 @@ public class TestWsmgUtil extends TestCa
     @After
     public void tearDown() throws Exception {
     }
-
-    /**
-     * Test method for {@link org.apache.airavata.wsmg.util.WsmgUtil#formatURLString(java.lang.String)}.
-     */
-    @Test
-    public void testFormatURLString() {
-
-        String url = "http://www.test.com/unit_test";
-
-        assertSame(url, WsmgUtil.formatURLString(url));
-
-        url = "scp://test/test";
-
-        assertSame(url, WsmgUtil.formatURLString(url));
-
-        url = "test/test";
-
-        assertTrue(WsmgUtil.formatURLString(url).startsWith("http://"));
-
-    }
-
+    
     /**
      * Test method for
-     * {@link org.apache.airavata.wsmg.util.WsmgUtil#sameStringValue(java.lang.String, java.lang.String)}
.
+     * {@link org.apache.airavata.wsmg.util.BrokerUtil#sameStringValue(java.lang.String,
java.lang.String)} .
      */
     @Test
     public void testSameStringValue() {
 
-        assertTrue(WsmgUtil.sameStringValue(null, null));
-        assertTrue(WsmgUtil.sameStringValue("test", "test"));
+        assertTrue(BrokerUtil.sameStringValue(null, null));
+        assertTrue(BrokerUtil.sameStringValue("test", "test"));
 
-        assertFalse(WsmgUtil.sameStringValue("one", "two"));
-        assertFalse(WsmgUtil.sameStringValue(null, "test"));
-        assertFalse(WsmgUtil.sameStringValue("test", null));
-
-    }
+        assertFalse(BrokerUtil.sameStringValue("one", "two"));
+        assertFalse(BrokerUtil.sameStringValue(null, "test"));
+        assertFalse(BrokerUtil.sameStringValue("test", null));
 
-    /**
-     * Test method for {@link org.apache.airavata.wsmg.util.WsmgUtil#getHostIP()}.
-     */
-    @Test
-    public void testGetHostIP() {
-        assertNotNull(WsmgUtil.getHostIP());
-    }
+    }  
 
     /**
-     * Test method for {@link org.apache.airavata.wsmg.util.WsmgUtil#getTopicLocalString(java.lang.String)}.
+     * Test method for {@link org.apache.airavata.wsmg.util.BrokerUtil#getTopicLocalString(java.lang.String)}.
      */
     @Test
     public void testGetTopicLocalString() {
 
-        assertEquals("localstring", (WsmgUtil.getTopicLocalString("prefix:localstring")));
+        assertEquals("localstring", (BrokerUtil.getTopicLocalString("prefix:localstring")));
 
-        assertEquals("localstring", WsmgUtil.getTopicLocalString("localstring"));
+        assertEquals("localstring", BrokerUtil.getTopicLocalString("localstring"));
 
     }
 
     /**
-     * Test method for {@link org.apache.airavata.wsmg.util.WsmgUtil#getXPathString(org.apache.axiom.om.OMElement)}.
+     * Test method for {@link org.apache.airavata.wsmg.util.BrokerUtil#getXPathString(org.apache.axiom.om.OMElement)}.
      */
     @Test
     public void testGetXPathString() {
@@ -119,7 +91,7 @@ public class TestWsmgUtil extends TestCa
 
         try {
 
-            WsmgUtil.getXPathString(null);
+            BrokerUtil.getXPathString(null);
             fail("method should validate invalid arguments");
         } catch (IllegalArgumentException e) {
 
@@ -133,7 +105,7 @@ public class TestWsmgUtil extends TestCa
 
             OMElement xpathEl = factory.createOMElement(invalidQName);
 
-            WsmgUtil.getXPathString(xpathEl);
+            BrokerUtil.getXPathString(xpathEl);
 
             fail("method should validate arguments");
 
@@ -153,7 +125,7 @@ public class TestWsmgUtil extends TestCa
 
             xpathEl.setText(xpathExpression);
 
-            WsmgUtil.getXPathString(xpathEl);
+            BrokerUtil.getXPathString(xpathEl);
 
             fail("method should reject unknown dialect");
         } catch (AxisFault e) {
@@ -171,7 +143,7 @@ public class TestWsmgUtil extends TestCa
             xpathEl.addAttribute("Dialect", dialect, WsmgNameSpaceConstants.WSE_NS);
 
             xpathEl.setText(xpathExpression);
-            assertEquals(xpathExpression, WsmgUtil.getXPathString(xpathEl));
+            assertEquals(xpathExpression, BrokerUtil.getXPathString(xpathEl));
 
         } catch (AxisFault e) {
             fail("unable to extract xpath query: " + e.toString());
@@ -180,18 +152,18 @@ public class TestWsmgUtil extends TestCa
     }
 
     /**
-     * Test method for {@link org.apache.airavata.wsmg.util.WsmgUtil#getTopicFromRequestPath(java.lang.String)}.
+     * Test method for {@link org.apache.airavata.wsmg.util.BrokerUtil#getTopicFromRequestPath(java.lang.String)}.
      */
     @Test
     public void testGetTopicFromRequestPath() {
 
-        assertNull(WsmgUtil.getTopicFromRequestPath(null));
-        assertNull(WsmgUtil.getTopicFromRequestPath(""));
-        assertNull(WsmgUtil.getTopicFromRequestPath("/"));
-        assertNull(WsmgUtil.getTopicFromRequestPath("/subscribe/url/"));
-        assertNull(WsmgUtil.getTopicFromRequestPath("/subscribe/url/topic/"));
+        assertNull(BrokerUtil.getTopicFromRequestPath(null));
+        assertNull(BrokerUtil.getTopicFromRequestPath(""));
+        assertNull(BrokerUtil.getTopicFromRequestPath("/"));
+        assertNull(BrokerUtil.getTopicFromRequestPath("/subscribe/url/"));
+        assertNull(BrokerUtil.getTopicFromRequestPath("/subscribe/url/topic/"));
 
-        assertEquals(WsmgUtil.getTopicFromRequestPath("/requestpath/topic/xyz"), "xyz");
+        assertEquals(BrokerUtil.getTopicFromRequestPath("/requestpath/topic/xyz"), "xyz");
 
     }
 }



Mime
View raw message