ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r180279 - in /webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService: CreateQueue.java DeleteQueue.java Enqueue.java ListMyQueues.java OMElementCreator.java Read.java util/RunnableCreateQueue.java
Date Mon, 06 Jun 2005 09:37:24 GMT
Author: ajith
Date: Mon Jun  6 02:37:23 2005
New Revision: 180279

URL: http://svn.apache.org/viewcvs?rev=180279&view=rev
Log:
making a change to make the amazon que more efficient

Added:
    webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/OMElementCreator.java
Removed:
    webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/CreateQueue.java
    webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/DeleteQueue.java
    webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/Enqueue.java
    webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/ListMyQueues.java
    webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/Read.java
Modified:
    webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java

Added: webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/OMElementCreator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/OMElementCreator.java?rev=180279&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/OMElementCreator.java
(added)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/OMElementCreator.java
Mon Jun  6 02:37:23 2005
@@ -0,0 +1,123 @@
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      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 sample.amazon.amazonSimpleQueueService;
+
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMAbstractFactory;
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.soap.SOAPFactory;
+
+/**
+ * This will create the OMElement needed to be used in invokeNonBlocking() method
+ * OMElements are created for CreateQueueu, ListMyQueues, Read, and Enqueue operations
+ *
+ * @author Saminda Abeyruwan <saminda@opensource.lk>
+ */
+public class OMElementCreator {
+    public static OMElement creatQueueElement(String createQueueElement, String key) {
+        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
+        OMNamespace opN = factory.createOMNamespace(
+                "http://webservices.amazon.com/AWSSimpleQueueService/2005-01-01", "nsQ");
+        OMElement createQueue = factory.createOMElement("CreateQueue", opN);
+        OMElement subID = factory.createOMElement("SubscriptionId", opN);
+        OMElement request = factory.createOMElement("Request", opN);
+        OMElement queueName = factory.createOMElement("QueueName", opN);
+        OMElement readLockTimeOutSeconds = factory.createOMElement("ReadLockTimeoutSeconds",
opN);
+        request.addChild(queueName);
+        request.addChild(readLockTimeOutSeconds);
+        subID.addChild(factory.createText(key));
+        queueName.addChild(factory.createText(createQueueElement));
+        readLockTimeOutSeconds.addChild(factory.createText("10"));
+        createQueue.addChild(subID);
+        createQueue.addChild(request);
+        return createQueue;
+    }
+    public static OMElement deleteQueueElement(String deleteQueueName, String key) {
+        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
+        OMNamespace opN = factory.createOMNamespace(
+                "http://webservices.amazon.com/AWSSimpleQueueService/2005-01-01", "nsQ");
+        OMElement enque = factory.createOMElement("DeleteQueue", opN);
+        OMElement subID = factory.createOMElement("SubscriptionId", opN);
+        OMElement request = factory.createOMElement("Request", opN);
+        OMElement queueName = factory.createOMElement("QueueName", opN);
+        //OMElement queueID = factory.createOMElement("QueueId",opN);
+        request.addChild(queueName);
+        //request.addChild(queueID);
+        subID.addChild(factory.createText(key));
+        queueName.addChild(factory.createText(deleteQueueName));
+        //queueID.addChild(factory.createText(queueIden));
+        enque.addChild(subID);
+        enque.addChild(request);
+        return enque;
+    }
+    public static OMElement enqueueElement(String queueEntyBody, String queueIden, String
key) {
+        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
+        OMNamespace opN = factory.createOMNamespace(
+                "http://webservices.amazon.com/AWSSimpleQueueService/2005-01-01", "nsQ");
+        OMElement enque = factory.createOMElement("Enqueue", opN);
+        OMElement subID = factory.createOMElement("SubscriptionId", opN);
+        OMElement request = factory.createOMElement("Request", opN);
+        //OMElement queueName = factory.createOMElement("QueueName",opN);
+        OMElement queueID = factory.createOMElement("QueueId", opN);
+        OMElement queueEntryBodies = factory.createOMElement("QueueEntryBodies", opN);
+        OMElement queueEntryBody1 = factory.createOMElement("QueueEntryBody", opN);
+        queueEntryBodies.addChild(queueEntryBody1);
+        //request.addChild(queueName);
+        request.addChild(queueID);
+        request.addChild(queueEntryBodies);
+        subID.addChild(factory.createText(key));
+        //queueName.addChild(factory.createText("Test Queue LSF "));
+        queueID.addChild(factory.createText(queueIden));
+        queueEntryBody1.addChild(factory.createText(queueEntyBody));
+        enque.addChild(subID);
+        enque.addChild(request);
+        return enque;
+    }
+    public static OMElement queueListElement(String key) {
+        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
+        OMNamespace opN = factory.createOMNamespace(
+                "http://webservices.amazon.com/AWSSimpleQueueService/2005-01-01",
+                "nsQ");
+        OMElement listMyQueues = factory.createOMElement("ListMyQueues", opN);
+        OMElement subID = factory.createOMElement("SubscriptionId", opN);
+        OMElement request = factory.createOMElement("Request", opN);
+        subID.addChild(factory.createText(key));
+        listMyQueues.addChild(subID);
+        listMyQueues.addChild(request);
+        return listMyQueues;
+    }
+    public static OMElement read(String requiredQueueName,String key) {
+        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
+        OMNamespace opN = factory.createOMNamespace(
+                "http://webservices.amazon.com/AWSSimpleQueueService/2005-01-01", "nsQ");
+        OMElement read = factory.createOMElement("Read", opN);
+        OMElement subID = factory.createOMElement("SubscriptionId", opN);
+        OMElement request = factory.createOMElement("Request", opN);
+        OMElement queueName = factory.createOMElement("QueueName", opN);
+        //OMElement queueID = factory.createOMElement("QueueId",opN);
+        OMElement readCount = factory.createOMElement("ReadCount", opN);
+        request.addChild(queueName);
+        //request.addChild(queueID);
+        request.addChild(readCount);
+        subID.addChild(factory.createText(key));
+        queueName.addChild(factory.createText(requiredQueueName));
+        //queueID.addChild(factory.createText(queueIden));
+        readCount.addChild(factory.createText("25"));
+        read.addChild(subID);
+        read.addChild(request);
+        return read;
+    }
+}

Modified: webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java?rev=180279&r1=180278&r2=180279&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java
(original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java
Mon Jun  6 02:37:23 2005
@@ -22,7 +22,7 @@
 import org.apache.axis.clientapi.Callback;
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.om.OMElement;
-import sample.amazon.amazonSimpleQueueService.Enqueue;
+
 import sample.amazon.amazonSimpleQueueService.OMElementCreator;
 
 import javax.swing.*;
@@ -55,7 +55,7 @@
                             this.enqueue, this.result));
         }
         if (this.enqueue.isEditable()) {
-            OMElement enqueueElement = Enqueue.enqueueElement(this.enqueue.getText(),
+            OMElement enqueueElement = OMElementCreator.enqueueElement(this.enqueue.getText(),
                     this.queueCode.getText(),getKey());
             this.axis2EngineRuns("Enqueue", enqueueElement, new SimpleQueueEnqueueCallbackHandler(
                     this.createQueue, this.queueCode, this.enqueue, this.result));



Mime
View raw message