ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gatf...@apache.org
Subject svn commit: r546072 - in /webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2: ./ msgprocessors/ msgreceivers/ storage/beans/ util/
Date Mon, 11 Jun 2007 10:16:30 GMT
Author: gatfora
Date: Mon Jun 11 03:16:23 2007
New Revision: 546072

URL: http://svn.apache.org/viewvc?view=rev&rev=546072
Log:
Create RMS/RMDBean constructors which copy properties from supplied RMS/RMDBean.  Remove the
numberOfMessagesAcknowledged from the RMS as this can be calculated.  Tidy up imports in some
classes

Modified:
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/MessageValidator.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/LastMessageProcessor.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/MakeConnectionProcessor.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgreceivers/RMMessageReceiver.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMDBean.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMSBean.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMSequenceBean.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/FaultManager.java

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/MessageValidator.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/MessageValidator.java?view=diff&rev=546072&r1=546071&r2=546072
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/MessageValidator.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/MessageValidator.java
Mon Jun 11 03:16:23 2007
@@ -19,7 +19,6 @@
 
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.WSDL2Constants;
 import org.apache.sandesha2.client.SandeshaClientConstants;
 import org.apache.sandesha2.i18n.SandeshaMessageHelper;
@@ -104,7 +103,6 @@
 			//validating messages from the client.
 			
 			//if sync InOut and NoOffer and RM 1.0 an exception should be thrown
-			String rmNamespace = rmMsgContext.getRMNamespaceValue();
 			String mep = msgContext.getAxisOperation().getMessageExchangePattern();
 			String offer = (String) msgContext.getProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID);
 			

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java?view=diff&rev=546072&r1=546071&r2=546072
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/SandeshaModule.java
Mon Jun 11 03:16:23 2007
@@ -291,7 +291,7 @@
 		if(log.isDebugEnabled()) log.debug("Exit: SandeshaModule::shutdown");
 	}
 
-    public void applyPolicy(Policy policy, AxisDescription axisDescription) throws AxisFault
{
+    public void applyPolicy(Policy policy, AxisDescription axisDescription) {
         // TODO 
         
     }

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java?view=diff&rev=546072&r1=546071&r2=546072
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java
Mon Jun 11 03:16:23 2007
@@ -244,8 +244,6 @@
 		// to break us)
 		if (numberOfNewMessagesAcked>0) {
 			rmsBean.setClientCompletedMessages(completedMessages);
-			long noOfMsgsAcked = rmsBean.getNumberOfMessagesAcked() + numberOfNewMessagesAcked;
-			rmsBean.setNumberOfMessagesAcked(noOfMsgsAcked);
 		}
 		
 		// Update the RMSBean

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/LastMessageProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/LastMessageProcessor.java?view=diff&rev=546072&r1=546071&r2=546072
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/LastMessageProcessor.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/LastMessageProcessor.java
Mon Jun 11 03:16:23 2007
@@ -50,8 +50,7 @@
 		return true;
 	}
 
-	public boolean processOutMessage(RMMsgContext rmMsgCtx) throws AxisFault {
-		// TODO Auto-generated method stub
+	public boolean processOutMessage(RMMsgContext rmMsgCtx) {
 		return false;
 	}
 

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/MakeConnectionProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/MakeConnectionProcessor.java?view=diff&rev=546072&r1=546071&r2=546072
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/MakeConnectionProcessor.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/MakeConnectionProcessor.java
Mon Jun 11 03:16:23 2007
@@ -11,7 +11,6 @@
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.OutOnlyAxisOperation;
 import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.transport.RequestResponseTransport;
 import org.apache.commons.logging.Log;
@@ -26,7 +25,6 @@
 import org.apache.sandesha2.storage.beanmanagers.SenderBeanMgr;
 import org.apache.sandesha2.storage.beans.RMSBean;
 import org.apache.sandesha2.storage.beans.SenderBean;
-import org.apache.sandesha2.util.MessageRetransmissionAdjuster;
 import org.apache.sandesha2.util.MsgInitializer;
 import org.apache.sandesha2.util.SandeshaUtil;
 import org.apache.sandesha2.util.SpecSpecificConstants;

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgreceivers/RMMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgreceivers/RMMessageReceiver.java?view=diff&rev=546072&r1=546071&r2=546072
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgreceivers/RMMessageReceiver.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgreceivers/RMMessageReceiver.java
Mon Jun 11 03:16:23 2007
@@ -28,14 +28,12 @@
 import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.i18n.SandeshaMessageHelper;
 import org.apache.sandesha2.i18n.SandeshaMessageKeys;
-import org.apache.sandesha2.msgprocessors.LastMessageProcessor;
 import org.apache.sandesha2.msgprocessors.MsgProcessor;
 import org.apache.sandesha2.msgprocessors.MsgProcessorFactory;
 import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.storage.Transaction;
 import org.apache.sandesha2.util.MsgInitializer;
 import org.apache.sandesha2.util.SandeshaUtil;
-import org.apache.sandesha2.wsrm.Sequence;
 
 /**
 *Currently this is a dummy Msg Receiver.

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMDBean.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMDBean.java?view=diff&rev=546072&r1=546071&r2=546072
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMDBean.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMDBean.java
Mon Jun 11 03:16:23 2007
@@ -72,9 +72,7 @@
 	private long nextMsgNoToProcess;
 		
 	private long highestInMessageNumber = 0;
-	
-	private String serviceName = null;
-	
+		
 	/**
 	 * Flags that are used to check if the primitive types on this bean
 	 * have been set. If a primitive type has not been set then it will
@@ -87,6 +85,23 @@
 	public RMDBean() {
 	}
 
+	/**
+	 * Constructor that copies all RMDBean values from the RMDBean supplied
+	 * @param beanToCopy
+	 */
+	public RMDBean(RMDBean beanToCopy) {
+		super(beanToCopy);
+		highestInMessageId = beanToCopy.getHighestInMessageId();
+		highestInMessageNumber = beanToCopy.getHighestInMessageNumber();
+		lastInMessageId = beanToCopy.getLastInMessageId();
+		nextMsgNoToProcess = beanToCopy.getNextMsgNoToProcess();
+		outboundInternalSequence = beanToCopy.getOutboundInternalSequence();
+		outOfOrderRanges = beanToCopy.getOutOfOrderRanges();
+		referenceMessageKey = beanToCopy.getReferenceMessageKey();
+		serverCompletedMessages = new RangeString(beanToCopy.getServerCompletedMessages().toString());
+		toAddress = beanToCopy.getToAddress();
+	}
+
 	public RMDBean(String sequenceID, long nextNsgNo) {
 		super(sequenceID);
 		this.setNextMsgNoToProcess(nextNsgNo);
@@ -226,14 +241,4 @@
 
 		return equal;
 	}
-
-	public String getServiceName() {
-		return serviceName;
-	}
-
-	public void setServiceName(String serviceName) {
-		this.serviceName = serviceName;
-	}
-
-
 }

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMSBean.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMSBean.java?view=diff&rev=546072&r1=546071&r2=546072
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMSBean.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMSBean.java
Mon Jun 11 03:16:23 2007
@@ -17,6 +17,7 @@
 
 package org.apache.sandesha2.storage.beans;
 
+import org.apache.sandesha2.util.Range;
 import org.apache.sandesha2.util.RangeString;
 
 /**
@@ -119,11 +120,6 @@
 	private boolean sequenceClosedClient = false;
 
 	/**
-	 * The number of messages that were acked
-	 */
-	private long numberOfMessagesAcked = 0;
-
-	/**
 	 * The number of reply messages that we expect
 	 */
 	private long expectedReplies = 0;
@@ -134,8 +130,19 @@
 	 * .NET interop requires all messages to be sent with the same SOAP version.
 	 */
 	private int soapVersion;
-	
-	
+
+	/**
+	 * In WSRM Anon URI scenario, we may not want to terminate a perticular sequence until the
CreateSequence has been received
+	 * for the response side, other wise PollingManager will pause the polling process in termination
and we will never be able
+	 * to get the CS.
+	 */
+	private boolean terminationPauserForCS = false;
+  	/**
+	 * If this is set, the current sequence is not expected to auto terminate when all the acks
are received.
+	 * I.e. the user explicitly have to call for termination (using SandeshaClient).  
+	 */
+	private boolean avoidAutoTermination = false;
+
 	/**
 	 * Flags that are used to check if the primitive types on this bean
 	 * have been set. If a primitive type has not been set then it will
@@ -154,24 +161,38 @@
 	private static final int EXPECTED_REPLIES          = 0x00000020;
 	private static final int SOAP_VERSION_FLAG         = 0x00000200;
 	
-  /**
-   * In WSRM Anon URI scenario, we may not want to terminate a perticular sequence until
the CreateSequence has been received
-   * for the response side, other wise PollingManager will pause the polling process in termination
and we will never be able
-   * to get the CS.
-   */
-  private boolean terminationPauserForCS = false;
-  
-	/**
-	 * If this is set, the current sequence is not expected to auto terminate when all the acks
are received.
-	 * I.e. the user explicitly have to call for termination (using SandeshaClient).  
-	 */
-	private boolean avoidAutoTermination = false;
-
-	private String serviceName = null;
-	
 	public RMSBean() {
 	}
 
+	/**
+	 * Constructor that copies all RMSBean values from the RMSBean supplied
+	 * @param beanToCopy
+	 */	
+	public RMSBean(RMSBean beanToCopy) {
+		super(beanToCopy);
+		 anonymousUUID = beanToCopy.getAnonymousUUID();
+		 clientCompletedMessages = new RangeString(beanToCopy.getClientCompletedMessages().toString());
+		 createSeqMsgID = beanToCopy.getCreateSeqMsgID();
+		 createSequenceMsgStoreKey = beanToCopy.getCreateSequenceMsgStoreKey();
+		 expectedReplies = beanToCopy.getExpectedReplies();
+		 highestOutMessageNumber = beanToCopy.getHighestOutMessageNumber();
+		 highestOutRelatesTo = beanToCopy.getHighestOutRelatesTo();
+		 internalSequenceID = beanToCopy.getInternalSequenceID();
+		 lastOutMessage = beanToCopy.getLastOutMessage();
+		 lastSendError = beanToCopy.getLastSendError();
+		 lastSendErrorTimestamp = beanToCopy.getLastSendErrorTimestamp();
+		 nextMessageNumber = beanToCopy.getNextMessageNumber();
+		 offeredEndPoint = beanToCopy.getOfferedEndPoint();
+		 offeredSequence = beanToCopy.getOfferedSequence();
+		 referenceMessageStoreKey = beanToCopy.getReferenceMessageStoreKey();
+		 sequenceClosedClient = beanToCopy.isSequenceClosedClient();
+		 soapVersion = beanToCopy.getSoapVersion();
+		 terminateAdded = beanToCopy.isTerminateAdded();
+		 terminationPauserForCS = beanToCopy.isTerminationPauserForCS();
+		 timedOut = beanToCopy.isTimedOut();
+		 transportTo = beanToCopy.getTransportTo();
+		 avoidAutoTermination = beanToCopy.isAvoidAutoTermination();		
+	}
 
 	public String getCreateSeqMsgID() {
 		return createSeqMsgID;
@@ -293,13 +314,18 @@
   }
 	
 	public long getNumberOfMessagesAcked() {
+		long numberOfMessagesAcked = 0;
+		if (clientCompletedMessages != null) {
+			// Process this value based on the ClientCompletedMessages
+			Range ranges[] = clientCompletedMessages.getRanges();
+	
+			for (int rangeIndex=0; rangeIndex < ranges.length; rangeIndex++) {
+				Range range = ranges[rangeIndex];
+				numberOfMessagesAcked = range.upperValue - range.lowerValue + 1;
+			}
+		}
   	return numberOfMessagesAcked;
   }
-
-	public void setNumberOfMessagesAcked(long numberOfMessagesAcked) {
-  	this.numberOfMessagesAcked = numberOfMessagesAcked;
-  	this.rmsFlags |= ACKED_MESSAGES_FLAG;
-  }
 	
 	public String getTransportTo() {
   	return transportTo;
@@ -384,7 +410,6 @@
 		result.append("\nTerminatePauser  : "); result.append(terminationPauserForCS);
 		result.append("\nTimedOut         : "); result.append(timedOut);
 		result.append("\nClosedClient     : "); result.append(sequenceClosedClient);
-		result.append("\nNumAckedMsgs     : "); result.append(numberOfMessagesAcked);
 		result.append("\nExpectedReplies  : "); result.append(expectedReplies);
 		result.append("\nTransportTo      : "); result.append(transportTo);
 		result.append("\nOfferedEndPoint  : "); result.append(offeredEndPoint);
@@ -475,14 +500,6 @@
 			match = false;
 
 		return match;
-	}
-
-	public String getServiceName() {
-		return serviceName;
-	}
-
-	public void setServiceName(String serviceName) {
-		this.serviceName = serviceName;
 	}
 
 }

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMSequenceBean.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMSequenceBean.java?view=diff&rev=546072&r1=546071&r2=546072
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMSequenceBean.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/beans/RMSequenceBean.java
Mon Jun 11 03:16:23 2007
@@ -64,6 +64,8 @@
 	 */
 	private boolean pollingMode=false;
 	
+	private String serviceName = null;
+
 	/**
 	 * Flags that are used to check if the primitive types on this bean
 	 * have been set. If a primitive type has not been set then it will
@@ -78,6 +80,24 @@
 	public RMSequenceBean() {
 
 	}
+	
+	/**
+	 * Constructor that copies all RMSBean values from the RMSBean supplied
+	 * @param beanToCopy
+	 */
+	public RMSequenceBean(RMSequenceBean beanToCopy) {
+		acksToEPR = beanToCopy.getAcksToEPR();
+		closed = beanToCopy.isClosed();
+		lastActivatedTime = beanToCopy.getLastActivatedTime();
+		pollingMode = beanToCopy.isPollingMode();
+		replyToEPR = beanToCopy.getReplyToEPR();
+		rMVersion = beanToCopy.getRMVersion();
+		securityTokenData = beanToCopy.getSecurityTokenData();		
+		sequenceID = beanToCopy.getSequenceID();
+		terminated = beanToCopy.isTerminated();
+		toEPR = beanToCopy.getToEPR(); 		
+		serviceName = beanToCopy.getServiceName();
+	}
 
 	public RMSequenceBean(String sequenceID) {
 		this.setSequenceID(sequenceID);
@@ -174,6 +194,14 @@
 		this.securityTokenData = securityTokenData;
 	}
 
+	public String getServiceName() {
+		return serviceName;
+	}
+
+	public void setServiceName(String serviceName) {
+		this.serviceName = serviceName;
+	}
+
 	public String toString() {
 		StringBuffer result = new StringBuffer();
 		result.append("\nSequence Id  : "); result.append(sequenceID);
@@ -185,6 +213,7 @@
 		result.append("\nTerminated       : "); result.append(terminated);		
 		result.append("\nLastActivatedTime: "); result.append(lastActivatedTime);	
 		result.append("\nRMVersion        : "); result.append(rMVersion);	
+		result.append("\nServiceName        : "); result.append(serviceName);	
 		result.append("\nHas SecurityToken: "); result.append(securityTokenData != null &&
securityTokenData.length() > 0);
 		return result.toString();
 	}

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/FaultManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/FaultManager.java?view=diff&rev=546072&r1=546071&r2=546072
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/FaultManager.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/FaultManager.java
Mon Jun 11 03:16:23 2007
@@ -42,7 +42,6 @@
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.WSDL2Constants;
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.axis2.engine.MessageReceiver;
 import org.apache.axis2.engine.Handler.InvocationResponse;
@@ -69,7 +68,6 @@
 import org.apache.sandesha2.storage.beans.RMSequenceBean;
 import org.apache.sandesha2.storage.beans.SenderBean;
 import org.apache.sandesha2.wsrm.AcknowledgementRange;
-import org.apache.sandesha2.wsrm.FaultCode;
 import org.apache.sandesha2.wsrm.SequenceAcknowledgement;
 import org.apache.sandesha2.wsrm.SequenceFault;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org


Mime
View raw message