You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by ch...@apache.org on 2005/08/26 06:59:51 UTC

svn commit: r240162 - in /webservices/sandesha/trunk/src/org/apache/sandesha2: ./ handlers/ msgprocessors/

Author: chamikara
Date: Thu Aug 25 21:59:19 2005
New Revision: 240162

URL: http://svn.apache.org/viewcvs?rev=240162&view=rev
Log:
Added some classes of server side (some of them may be needed in the client side as well).

MsgValidator - verifies that the msg is valid.
MsgInitializer - Creates RMMsgContext out of MsgCtx
MsgProcessors - Does various parts of RM Processing.
Others are self-explanatory.

Added:
    webservices/sandesha/trunk/src/org/apache/sandesha2/MsgInitializer.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/MsgValidator.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/RMHeaders.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgContext.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgCreator.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/SandeshaModule.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/
    webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/ServerInHandler.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/ServerOutHandler.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/
    webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/MsgProcessor.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/MsgProcessorException.java
Modified:
    webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java?rev=240162&r1=240161&r2=240162&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java Thu Aug 25 21:59:19 2005
@@ -14,12 +14,14 @@
  *  limitations under the License.
  *
  */
+
 package org.apache.sandesha2;
 
 /**
  * @author Saminda
  *
  */
+
 public interface Constants {
 
 	public interface WSRM{
@@ -57,5 +59,20 @@
       String IN_MESSAGE="inMessage";
       String OUT_MESSAGE="outMessage";
       String FAULT_MESSAGE="faultMessage";
+      
+      int MESSAGE_TYPE_UNKNOWN = 0;
+      int MESSAGE_TYPE_CREATE_SEQ = 1;
+      int MESSAGE_TYPE_CREATE_SEQ_RESPONSE = 2;
+      int MESSAGE_TYPE_APPLICATION = 3;
+      int MESSAGE_TYPE_ACK = 4;
+      int MESSAGE_TYPE_TERMINATE_SEQ = 5;
+      
+      int MESSAGE_PART_UNKNOWN = 0;
+      int MESSAGE_PART_RM_HEADERS = 1;
+      int MESSAGE_PART_ADDR_HEADERS = 2;
+      int MESSAGE_PART_CREATE_SEQ = 3;
+      int MESSAGE_PART_CREATE_SEQ_RESPONSE = 4;
+      int MESSAGE_PART_TERMINATE_SEQ = 5;
+      int MAX_MSG_PART_ID = 5;
 
 }

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/MsgInitializer.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/MsgInitializer.java?rev=240162&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/MsgInitializer.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/MsgInitializer.java Thu Aug 25 21:59:19 2005
@@ -0,0 +1,38 @@
+/*
+ * Copyright  1999-2004 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 org.apache.sandesha2;
+
+import org.apache.axis2.context.MessageContext;
+
+
+/**
+ *@ author
+ */
+
+public class MsgInitializer {
+
+	public RMMsgContext initializeMessage (MessageContext ctx) {
+		RMMsgContext rmMsgCtx = new RMMsgContext ();
+		populateRMMsgContext(ctx,rmMsgCtx);
+		return rmMsgCtx;
+	}
+	
+	public static void populateRMMsgContext (MessageContext msgCtx, RMMsgContext rmMsgContext) {
+		//TODO set message parts
+	}
+}

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/MsgValidator.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/MsgValidator.java?rev=240162&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/MsgValidator.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/MsgValidator.java Thu Aug 25 21:59:19 2005
@@ -0,0 +1,31 @@
+/*
+ * Copyright  1999-2004 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 org.apache.sandesha2;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+
+/**
+ * @author 
+ */
+public class MsgValidator {
+
+	public static void validateMessage(MessageContext msgCtx) throws AxisFault{
+        //TODO: Validate message
+    }
+}

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/RMHeaders.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/RMHeaders.java?rev=240162&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/RMHeaders.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/RMHeaders.java Thu Aug 25 21:59:19 2005
@@ -0,0 +1,25 @@
+/*
+ * Copyright  1999-2004 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 org.apache.sandesha2;
+/**
+ * @author 
+ */
+
+public class RMHeaders {
+
+}

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgContext.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgContext.java?rev=240162&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgContext.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgContext.java Thu Aug 25 21:59:19 2005
@@ -0,0 +1,51 @@
+/*
+ * Copyright  1999-2004 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 org.apache.sandesha2;
+
+import java.util.HashMap;
+import org.apache.axis2.addressing.om.AddressingHeaders;
+import org.apache.axis2.context.MessageContext;
+import org.apache.sandesha2.wsrm.CreateSequence;
+import org.apache.sandesha2.wsrm.IOMRMElement;
+import org.apache.sandesha2.wsrm.TerminateSequence;
+
+/**
+ * @author
+ */
+public class RMMsgContext {
+	
+	private MessageContext msgContext;
+	private HashMap rmMessageParts;
+	private int messageType;
+	
+	public RMMsgContext (){
+		rmMessageParts = new HashMap ();
+		messageType = Constants.MESSAGE_PART_UNKNOWN;
+	}
+	
+	public RMMsgContext (MessageContext ctx){
+		this ();
+		this.msgContext = ctx;
+		MsgInitializer.populateRMMsgContext(ctx,this);
+	}
+	
+	public void setMessagePart (int partId, IOMRMElement part){
+		if (partId>=0 && partId<=Constants.MAX_MSG_PART_ID)
+			rmMessageParts.put(new Integer (partId),part);
+	}
+}

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgCreator.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgCreator.java?rev=240162&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgCreator.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/RMMsgCreator.java Thu Aug 25 21:59:19 2005
@@ -0,0 +1,25 @@
+/*
+ * Copyright  1999-2004 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 org.apache.sandesha2;
+
+/**
+ * @author
+ */
+public class RMMsgCreator {
+
+}

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/SandeshaModule.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/SandeshaModule.java?rev=240162&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/SandeshaModule.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/SandeshaModule.java Thu Aug 25 21:59:19 2005
@@ -0,0 +1,35 @@
+/*
+ * Copyright  1999-2004 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 org.apache.sandesha2;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.modules.Module;
+
+public class SandeshaModule implements Module{
+
+    // initialize the module
+    public void init(AxisConfiguration axisSystem) throws AxisFault {
+       
+    }
+
+    // shutdown the module
+    public void shutdown(AxisConfiguration axisSystem) throws AxisFault {
+ 
+    }
+}

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/ServerInHandler.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/ServerInHandler.java?rev=240162&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/ServerInHandler.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/ServerInHandler.java Thu Aug 25 21:59:19 2005
@@ -0,0 +1,33 @@
+/*
+ * Copyright  1999-2004 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 org.apache.sandesha2.handlers;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.handlers.AbstractHandler;
+
+/**
+ * @author 
+ */
+public class ServerInHandler extends AbstractHandler {
+
+	public void invoke(MessageContext arg0) throws AxisFault {
+		// TODO create invoke logic
+	}
+	
+}

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/ServerOutHandler.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/ServerOutHandler.java?rev=240162&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/ServerOutHandler.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/ServerOutHandler.java Thu Aug 25 21:59:19 2005
@@ -0,0 +1,32 @@
+/*
+ * Copyright  1999-2004 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 org.apache.sandesha2.handlers;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.handlers.AbstractHandler;
+
+/**
+ * @author 
+ */
+public class ServerOutHandler extends AbstractHandler {
+
+	public void invoke(MessageContext arg0) throws AxisFault {
+		// TODO create invoke logic
+	}
+}

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java?rev=240162&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java Thu Aug 25 21:59:19 2005
@@ -0,0 +1,31 @@
+/*
+ * Copyright  1999-2004 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 org.apache.sandesha2.msgprocessors;
+
+import org.apache.sandesha2.RMMsgContext;
+
+/**
+ * @author 
+ */
+
+public class CreateSeqMsgProcessor implements MsgProcessor {
+
+	public void processMessage(RMMsgContext rmMsgCtx) throws MsgProcessorException {
+		//TODO: Add create sequence message processing logic
+	}
+}

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/MsgProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/MsgProcessor.java?rev=240162&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/MsgProcessor.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/MsgProcessor.java Thu Aug 25 21:59:19 2005
@@ -0,0 +1,29 @@
+/*
+ * Copyright  1999-2004 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 org.apache.sandesha2.msgprocessors;
+
+import org.apache.sandesha2.RMMsgContext;
+
+
+/**
+ * @author
+ */
+
+public interface MsgProcessor {
+	public void processMessage(RMMsgContext rmMsgCtx) throws MsgProcessorException;
+}

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/MsgProcessorException.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/MsgProcessorException.java?rev=240162&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/MsgProcessorException.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/MsgProcessorException.java Thu Aug 25 21:59:19 2005
@@ -0,0 +1,26 @@
+/*
+ * Copyright  1999-2004 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 org.apache.sandesha2.msgprocessors;
+
+/**
+ * @author 
+ * 
+ */
+public class MsgProcessorException extends Exception {
+
+}



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