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 di...@apache.org on 2007/08/09 02:58:01 UTC
svn commit: r564063 [8/16] - in /webservices/sandesha/trunk/java: ./
modules/client/ modules/core/
modules/core/src/main/java/org/apache/sandesha2/
modules/core/src/main/java/org/apache/sandesha2/client/
modules/core/src/main/java/org/apache/sandesha2/...
Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AcksTo.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AcksTo.java?view=diff&rev=564063&r1=564062&r2=564063
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AcksTo.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AcksTo.java Wed Aug 8 17:57:51 2007
@@ -1,125 +1,125 @@
-/*
- * 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.wsrm;
-
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.addressing.EndpointReferenceHelper;
-import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.SandeshaException;
-import org.apache.sandesha2.i18n.SandeshaMessageHelper;
-import org.apache.sandesha2.i18n.SandeshaMessageKeys;
-
-/**
- * Represents an AcksTo element which comes within
- * Create Sequence messages.
- */
-
-public class AcksTo implements IOMRMElement {
-
- private EndpointReference epr;
-
- private String rmNamespaceValue = null;
-
- private String addressingNamespaceValue = null;
-
- // Constructor used while parsing
- public AcksTo (String rmNamespaceValue) throws AxisFault {
- if (!isNamespaceSupported(rmNamespaceValue))
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- rmNamespaceValue));
-
- this.rmNamespaceValue = rmNamespaceValue;
- }
-
- // Constructor used while writing
- public AcksTo (EndpointReference epr, String rmNamespaceValue, String addressingNamespaceValue) throws AxisFault {
- this (rmNamespaceValue);
- this.addressingNamespaceValue = addressingNamespaceValue;
- this.epr = epr;
- }
-
- public String getNamespaceValue() {
- return rmNamespaceValue;
- }
-
- public String getAddressingNamespaceValue() {
- return addressingNamespaceValue;
- }
-
- public Object fromOMElement(OMElement element) throws OMException,AxisFault {
- OMElement acksToPart = element.getFirstChildWithName(new QName(
- rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.ACKS_TO));
-
- if (acksToPart == null)
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.noAcksToPart,
- element.toString()));
-
- epr = EndpointReferenceHelper.fromOM (acksToPart);
-
- // Sniff the addressing namespace from the Address child of the EPR
- Iterator children = acksToPart.getChildElements();
- while(children.hasNext() && addressingNamespaceValue == null) {
- OMElement child = (OMElement) children.next();
- if("Address".equals(child.getLocalName())) {
- addressingNamespaceValue = child.getNamespace().getNamespaceURI();
- }
- }
-
- return this;
- }
-
- public OMElement toOMElement(OMElement element) throws OMException,AxisFault {
-
- if (epr == null)
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.cannotSetAcksTo,
- null));
-
- OMFactory factory = element.getOMFactory();
-
- QName acksTo = new QName (rmNamespaceValue,Sandesha2Constants.WSRM_COMMON.ACKS_TO, Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
- OMElement endpointElement = EndpointReferenceHelper.toOM (factory,epr, acksTo ,addressingNamespaceValue);
-
- element.addChild(endpointElement);
- return element;
- }
-
- public EndpointReference getEPR() {
- return epr;
- }
-
- public boolean isNamespaceSupported (String namespaceName) {
- if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
- return true;
-
- if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
- return true;
-
- return false;
- }
-}
+/*
+ * 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.wsrm;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.addressing.EndpointReferenceHelper;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+
+/**
+ * Represents an AcksTo element which comes within
+ * Create Sequence messages.
+ */
+
+public class AcksTo implements IOMRMElement {
+
+ private EndpointReference epr;
+
+ private String rmNamespaceValue = null;
+
+ private String addressingNamespaceValue = null;
+
+ // Constructor used while parsing
+ public AcksTo (String rmNamespaceValue) throws AxisFault {
+ if (!isNamespaceSupported(rmNamespaceValue))
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ rmNamespaceValue));
+
+ this.rmNamespaceValue = rmNamespaceValue;
+ }
+
+ // Constructor used while writing
+ public AcksTo (EndpointReference epr, String rmNamespaceValue, String addressingNamespaceValue) throws AxisFault {
+ this (rmNamespaceValue);
+ this.addressingNamespaceValue = addressingNamespaceValue;
+ this.epr = epr;
+ }
+
+ public String getNamespaceValue() {
+ return rmNamespaceValue;
+ }
+
+ public String getAddressingNamespaceValue() {
+ return addressingNamespaceValue;
+ }
+
+ public Object fromOMElement(OMElement element) throws OMException,AxisFault {
+ OMElement acksToPart = element.getFirstChildWithName(new QName(
+ rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.ACKS_TO));
+
+ if (acksToPart == null)
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.noAcksToPart,
+ element.toString()));
+
+ epr = EndpointReferenceHelper.fromOM (acksToPart);
+
+ // Sniff the addressing namespace from the Address child of the EPR
+ Iterator children = acksToPart.getChildElements();
+ while(children.hasNext() && addressingNamespaceValue == null) {
+ OMElement child = (OMElement) children.next();
+ if("Address".equals(child.getLocalName())) {
+ addressingNamespaceValue = child.getNamespace().getNamespaceURI();
+ }
+ }
+
+ return this;
+ }
+
+ public OMElement toOMElement(OMElement element) throws OMException,AxisFault {
+
+ if (epr == null)
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.cannotSetAcksTo,
+ null));
+
+ OMFactory factory = element.getOMFactory();
+
+ QName acksTo = new QName (rmNamespaceValue,Sandesha2Constants.WSRM_COMMON.ACKS_TO, Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
+ OMElement endpointElement = EndpointReferenceHelper.toOM (factory,epr, acksTo ,addressingNamespaceValue);
+
+ element.addChild(endpointElement);
+ return element;
+ }
+
+ public EndpointReference getEPR() {
+ return epr;
+ }
+
+ public boolean isNamespaceSupported (String namespaceName) {
+ if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
+ return true;
+
+ if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
+ return true;
+
+ return false;
+ }
+}
Propchange: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AcksTo.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Address.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Address.java?view=diff&rev=564063&r1=564062&r2=564063
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Address.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Address.java Wed Aug 8 17:57:51 2007
@@ -1,99 +1,99 @@
-/*
- * Copyright 2005-2006 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.wsrm;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.i18n.SandeshaMessageHelper;
-import org.apache.sandesha2.i18n.SandeshaMessageKeys;
-
-/**
- * Represents an Address element, that is contained within the MakeConnection message.
- */
-
-public class Address implements IOMRMElement {
-
- private String address = null;
-
- private String rmNamespaceValue = null;
-
- public Address(String rmNamespaceValue) {
- this.rmNamespaceValue = rmNamespaceValue;
- }
-
- public Object fromOMElement(OMElement element) throws OMException {
-
- OMElement addressPart = element.getFirstChildWithName(new QName(
- rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.ADDRESS));
- if (addressPart == null)
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.cannotFindAddressElement,
- element.toString()));
-
- String addressText = addressPart.getText();
- if (addressText == null || "".equals(addressText))
- throw new OMException(
- SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.cannotFindAddressText,
- element.toString()));
-
- this.address = addressText;
- return this;
- }
-
- public String getNamespaceValue(){
- return rmNamespaceValue;
- }
-
- public OMElement toOMElement(OMElement element) throws OMException {
-
- if (address == null || "".equals(address))
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.addressNotValid));
-
- OMFactory factory = element.getOMFactory();
-
- OMNamespace rmNamespace = factory.createOMNamespace(rmNamespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_MC);
- OMElement addressElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.ADDRESS, rmNamespace);
-
- addressElement.setText(address);
- element.addChild(addressElement);
-
- return element;
- }
-
- public String getAddress() {
- return address;
- }
-
- public void setAddress(String address) {
- this.address = address;
- }
-
- public boolean isNamespaceSupported (String namespaceName) {
- if (Sandesha2Constants.SPEC_2007_02.MC_NS_URI.equals(namespaceName))
- return true;
-
- return false;
- }
-}
+/*
+ * Copyright 2005-2006 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.wsrm;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+
+/**
+ * Represents an Address element, that is contained within the MakeConnection message.
+ */
+
+public class Address implements IOMRMElement {
+
+ private String address = null;
+
+ private String rmNamespaceValue = null;
+
+ public Address(String rmNamespaceValue) {
+ this.rmNamespaceValue = rmNamespaceValue;
+ }
+
+ public Object fromOMElement(OMElement element) throws OMException {
+
+ OMElement addressPart = element.getFirstChildWithName(new QName(
+ rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.ADDRESS));
+ if (addressPart == null)
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.cannotFindAddressElement,
+ element.toString()));
+
+ String addressText = addressPart.getText();
+ if (addressText == null || "".equals(addressText))
+ throw new OMException(
+ SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.cannotFindAddressText,
+ element.toString()));
+
+ this.address = addressText;
+ return this;
+ }
+
+ public String getNamespaceValue(){
+ return rmNamespaceValue;
+ }
+
+ public OMElement toOMElement(OMElement element) throws OMException {
+
+ if (address == null || "".equals(address))
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.addressNotValid));
+
+ OMFactory factory = element.getOMFactory();
+
+ OMNamespace rmNamespace = factory.createOMNamespace(rmNamespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_MC);
+ OMElement addressElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.ADDRESS, rmNamespace);
+
+ addressElement.setText(address);
+ element.addChild(addressElement);
+
+ return element;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public boolean isNamespaceSupported (String namespaceName) {
+ if (Sandesha2Constants.SPEC_2007_02.MC_NS_URI.equals(namespaceName))
+ return true;
+
+ return false;
+ }
+}
Propchange: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Address.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequence.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequence.java?view=diff&rev=564063&r1=564062&r2=564063
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequence.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequence.java Wed Aug 8 17:57:51 2007
@@ -1,128 +1,128 @@
-/*
- * 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.wsrm;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.SandeshaException;
-import org.apache.sandesha2.i18n.SandeshaMessageHelper;
-import org.apache.sandesha2.i18n.SandeshaMessageKeys;
-
-/**
- * Adds the Close Sequence body part.
- */
-
-public class CloseSequence implements IOMRMPart {
-
- private Identifier identifier;
-
- private String namespaceValue = null;
-
- public CloseSequence(String namespaceValue) throws SandeshaException {
- if (!isNamespaceSupported(namespaceValue))
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- namespaceValue));
-
- this.namespaceValue = namespaceValue;
- }
-
- public String getNamespaceValue() {
- return namespaceValue;
- }
-
- public Object fromOMElement(OMElement body) throws OMException,SandeshaException {
-
- if (!(body instanceof SOAPBody))
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.closeSeqCannotBeAddedToNonBody));
-
- OMElement closeSeqPart = body.getFirstChildWithName(new QName(
- namespaceValue, Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE));
-
- if (closeSeqPart == null)
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.noCloseSequencePartInElement,
- body.toString()));
-
- identifier = new Identifier(namespaceValue);
- identifier.fromOMElement(closeSeqPart);
-
- return this;
- }
-
- public OMElement toOMElement(OMElement body) throws OMException {
-
- if (body == null || !(body instanceof SOAPBody))
- throw new OMException(
- SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.closeSeqCannotBeAddedToNonBody));
-
- if (identifier == null)
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.closeSeqPartNullID));
-
- OMFactory factory = body.getOMFactory();
-
- OMNamespace rmNamespace = factory.createOMNamespace(namespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
- OMElement closeSequenceElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE, rmNamespace);
-
- identifier.toOMElement(closeSequenceElement);
- body.addChild(closeSequenceElement);
-
- return body;
- }
-
- public Identifier getIdentifier() {
- return identifier;
- }
-
- public void setIdentifier(Identifier identifier) {
- this.identifier = identifier;
- }
-
- public void toSOAPEnvelope(SOAPEnvelope envelope) {
- SOAPBody body = envelope.getBody();
-
- //detach if already exist.
- OMElement elem = body.getFirstChildWithName(new QName(namespaceValue,
- Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE));
- if (elem!=null)
- elem.detach();
-
- toOMElement(body);
- }
-
- public boolean isNamespaceSupported (String namespaceName) {
- if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
- return true;
-
- if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
- return true;
-
- return false;
- }
-
-}
+/*
+ * 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.wsrm;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+
+/**
+ * Adds the Close Sequence body part.
+ */
+
+public class CloseSequence implements IOMRMPart {
+
+ private Identifier identifier;
+
+ private String namespaceValue = null;
+
+ public CloseSequence(String namespaceValue) throws SandeshaException {
+ if (!isNamespaceSupported(namespaceValue))
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ namespaceValue));
+
+ this.namespaceValue = namespaceValue;
+ }
+
+ public String getNamespaceValue() {
+ return namespaceValue;
+ }
+
+ public Object fromOMElement(OMElement body) throws OMException,SandeshaException {
+
+ if (!(body instanceof SOAPBody))
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.closeSeqCannotBeAddedToNonBody));
+
+ OMElement closeSeqPart = body.getFirstChildWithName(new QName(
+ namespaceValue, Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE));
+
+ if (closeSeqPart == null)
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.noCloseSequencePartInElement,
+ body.toString()));
+
+ identifier = new Identifier(namespaceValue);
+ identifier.fromOMElement(closeSeqPart);
+
+ return this;
+ }
+
+ public OMElement toOMElement(OMElement body) throws OMException {
+
+ if (body == null || !(body instanceof SOAPBody))
+ throw new OMException(
+ SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.closeSeqCannotBeAddedToNonBody));
+
+ if (identifier == null)
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.closeSeqPartNullID));
+
+ OMFactory factory = body.getOMFactory();
+
+ OMNamespace rmNamespace = factory.createOMNamespace(namespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
+ OMElement closeSequenceElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE, rmNamespace);
+
+ identifier.toOMElement(closeSequenceElement);
+ body.addChild(closeSequenceElement);
+
+ return body;
+ }
+
+ public Identifier getIdentifier() {
+ return identifier;
+ }
+
+ public void setIdentifier(Identifier identifier) {
+ this.identifier = identifier;
+ }
+
+ public void toSOAPEnvelope(SOAPEnvelope envelope) {
+ SOAPBody body = envelope.getBody();
+
+ //detach if already exist.
+ OMElement elem = body.getFirstChildWithName(new QName(namespaceValue,
+ Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE));
+ if (elem!=null)
+ elem.detach();
+
+ toOMElement(body);
+ }
+
+ public boolean isNamespaceSupported (String namespaceName) {
+ if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
+ return true;
+
+ if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
+ return true;
+
+ return false;
+ }
+
+}
Propchange: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequence.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequenceResponse.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequenceResponse.java?view=diff&rev=564063&r1=564062&r2=564063
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequenceResponse.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequenceResponse.java Wed Aug 8 17:57:51 2007
@@ -1,129 +1,129 @@
-/*
- * 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.wsrm;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.SandeshaException;
-import org.apache.sandesha2.i18n.SandeshaMessageHelper;
-import org.apache.sandesha2.i18n.SandeshaMessageKeys;
-
-/**
- * Adds the Close Sequence Response body part.
- */
-public class CloseSequenceResponse implements IOMRMPart {
-
- private Identifier identifier;
-
- private String namespaceValue = null;
-
- public CloseSequenceResponse(String namespaceValue) throws SandeshaException {
- if (!isNamespaceSupported(namespaceValue))
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- namespaceValue));
-
- this.namespaceValue = namespaceValue;
- }
-
- public String getNamespaceValue() {
- return namespaceValue;
- }
-
- public Object fromOMElement(OMElement body) throws OMException,SandeshaException {
-
- if (!(body instanceof SOAPBody))
- throw new OMException(
- SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.closeSeqResponseCannotBeAddedToNonBody));
-
- OMElement closeSeqResponsePart = body.getFirstChildWithName(new QName(
- namespaceValue, Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE_RESPONSE));
-
- if (closeSeqResponsePart == null)
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.noCloseSeqResponsePartInElement,
- body.toString()));
-
- identifier = new Identifier(namespaceValue);
- identifier.fromOMElement(closeSeqResponsePart);
-
- return this;
- }
-
- public OMElement toOMElement(OMElement body) throws OMException {
-
- if (body == null || !(body instanceof SOAPBody))
- throw new OMException(
- SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.closeSeqResponseCannotBeAddedToNonBody));
-
- if (identifier == null)
- throw new OMException(
- SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.closeSeqResponsePartNullID));
-
- OMFactory factory = body.getOMFactory();
-
- OMNamespace rmNamespace = factory.createOMNamespace(namespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
- OMElement closeSequenceResponseElement = factory.createOMElement(
- Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE_RESPONSE, rmNamespace);
- identifier.toOMElement(closeSequenceResponseElement);
- body.addChild(closeSequenceResponseElement);
-
- return body;
- }
-
- public Identifier getIdentifier() {
- return identifier;
- }
-
- public void setIdentifier(Identifier identifier) {
- this.identifier = identifier;
- }
-
- public void toSOAPEnvelope(SOAPEnvelope envelope) {
- SOAPBody body = envelope.getBody();
-
- //detach if already exist.
- OMElement elem = body.getFirstChildWithName(new QName(namespaceValue,
- Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE_RESPONSE));
- if (elem!=null)
- elem.detach();
-
- toOMElement(body);
- }
-
- public boolean isNamespaceSupported (String namespaceName) {
- if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
- return true;
-
- if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
- return true;
-
- return false;
- }
-
-}
+/*
+ * 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.wsrm;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+
+/**
+ * Adds the Close Sequence Response body part.
+ */
+public class CloseSequenceResponse implements IOMRMPart {
+
+ private Identifier identifier;
+
+ private String namespaceValue = null;
+
+ public CloseSequenceResponse(String namespaceValue) throws SandeshaException {
+ if (!isNamespaceSupported(namespaceValue))
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ namespaceValue));
+
+ this.namespaceValue = namespaceValue;
+ }
+
+ public String getNamespaceValue() {
+ return namespaceValue;
+ }
+
+ public Object fromOMElement(OMElement body) throws OMException,SandeshaException {
+
+ if (!(body instanceof SOAPBody))
+ throw new OMException(
+ SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.closeSeqResponseCannotBeAddedToNonBody));
+
+ OMElement closeSeqResponsePart = body.getFirstChildWithName(new QName(
+ namespaceValue, Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE_RESPONSE));
+
+ if (closeSeqResponsePart == null)
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.noCloseSeqResponsePartInElement,
+ body.toString()));
+
+ identifier = new Identifier(namespaceValue);
+ identifier.fromOMElement(closeSeqResponsePart);
+
+ return this;
+ }
+
+ public OMElement toOMElement(OMElement body) throws OMException {
+
+ if (body == null || !(body instanceof SOAPBody))
+ throw new OMException(
+ SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.closeSeqResponseCannotBeAddedToNonBody));
+
+ if (identifier == null)
+ throw new OMException(
+ SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.closeSeqResponsePartNullID));
+
+ OMFactory factory = body.getOMFactory();
+
+ OMNamespace rmNamespace = factory.createOMNamespace(namespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
+ OMElement closeSequenceResponseElement = factory.createOMElement(
+ Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE_RESPONSE, rmNamespace);
+ identifier.toOMElement(closeSequenceResponseElement);
+ body.addChild(closeSequenceResponseElement);
+
+ return body;
+ }
+
+ public Identifier getIdentifier() {
+ return identifier;
+ }
+
+ public void setIdentifier(Identifier identifier) {
+ this.identifier = identifier;
+ }
+
+ public void toSOAPEnvelope(SOAPEnvelope envelope) {
+ SOAPBody body = envelope.getBody();
+
+ //detach if already exist.
+ OMElement elem = body.getFirstChildWithName(new QName(namespaceValue,
+ Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE_RESPONSE));
+ if (elem!=null)
+ elem.detach();
+
+ toOMElement(body);
+ }
+
+ public boolean isNamespaceSupported (String namespaceName) {
+ if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
+ return true;
+
+ if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
+ return true;
+
+ return false;
+ }
+
+}
Propchange: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequenceResponse.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequence.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequence.java?view=diff&rev=564063&r1=564062&r2=564063
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequence.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequence.java Wed Aug 8 17:57:51 2007
@@ -1,197 +1,197 @@
-/*
- * 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.wsrm;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.axis2.AxisFault;
-import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.SandeshaException;
-import org.apache.sandesha2.i18n.SandeshaMessageHelper;
-import org.apache.sandesha2.i18n.SandeshaMessageKeys;
-import org.apache.sandesha2.util.SpecSpecificConstants;
-
-/**
- * Represent the CreateSequence body element.
- */
-
-public class CreateSequence implements IOMRMPart {
-
- private AcksTo acksTo = null;
-
- private Expires expires = null;
-
- private SequenceOffer sequenceOffer = null;
-
- private String rmNamespaceValue = null;
-
- private String secNamespaceValue = null;
-
- private OMElement securityTokenReference = null;
-
- // Constructor used while parsing
- public CreateSequence(String rmNamespaceValue) throws SandeshaException {
- if (!isNamespaceSupported(rmNamespaceValue))
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- rmNamespaceValue));
-
- this.rmNamespaceValue = rmNamespaceValue;
- this.secNamespaceValue = SpecSpecificConstants.getSecurityNamespace(rmNamespaceValue);
- }
-
- // Constructor used while writing
- public CreateSequence (AcksTo acksTo,SOAPFactory factory,String rmNamespaceValue) throws SandeshaException {
- this (rmNamespaceValue);
- this.acksTo = acksTo;
- }
-
- public String getNamespaceValue() {
- return rmNamespaceValue;
- }
-
- public String getAddressingNamespaceValue() {
- if(acksTo != null) return acksTo.getAddressingNamespaceValue();
- return null;
- }
-
- public Object fromOMElement(OMElement bodyElement) throws OMException,AxisFault {
-
- OMElement createSequencePart = bodyElement
- .getFirstChildWithName(new QName(rmNamespaceValue,
- Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE));
- if (createSequencePart == null)
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.noCreateSeqPartInElement,
- bodyElement.toString()));
-
- acksTo = new AcksTo(rmNamespaceValue);
- acksTo.fromOMElement(createSequencePart);
-
- OMElement offerPart = createSequencePart.getFirstChildWithName(new QName(rmNamespaceValue,
- Sandesha2Constants.WSRM_COMMON.SEQUENCE_OFFER));
- if (offerPart != null) {
- sequenceOffer = new SequenceOffer(rmNamespaceValue);
- sequenceOffer.fromOMElement(createSequencePart);
- }
-
- OMElement expiresPart = createSequencePart.getFirstChildWithName(
- new QName(rmNamespaceValue,
- Sandesha2Constants.WSRM_COMMON.EXPIRES));
- if (expiresPart != null) {
- expires = new Expires(rmNamespaceValue);
- expires.fromOMElement(createSequencePart);
- }
-
- if(secNamespaceValue != null) {
- securityTokenReference = createSequencePart.getFirstChildWithName(
- new QName(secNamespaceValue, "SecurityTokenReference"));
- }
- return this;
- }
-
- public OMElement toOMElement(OMElement bodyElement) throws OMException, AxisFault {
-
- if (bodyElement == null || !(bodyElement instanceof SOAPBody))
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.createSeqCannotBeAddedToNonBody));
-
- if (acksTo == null)
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.createSeqNullAcksTo));
-
- SOAPBody soapBody = (SOAPBody) bodyElement;
-
- OMFactory factory = bodyElement.getOMFactory();
-
- OMNamespace rmNamespace = factory.createOMNamespace(rmNamespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
- OMElement createSequenceElement = factory.createOMElement(
- Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE, rmNamespace);
-
- acksTo.toOMElement(createSequenceElement);
-
- if (sequenceOffer != null) {
- sequenceOffer.toOMElement(createSequenceElement);
- }
-
- if (expires != null) {
- expires.toOMElement(createSequenceElement);
- }
-
- if(securityTokenReference != null) {
- createSequenceElement.addChild(securityTokenReference);
- }
-
- soapBody.addChild(createSequenceElement);
- return soapBody;
- }
-
- public void setAcksTo(AcksTo acksTo) {
- this.acksTo = acksTo;
- }
-
- public void setSequenceOffer(SequenceOffer sequenceOffer) {
- this.sequenceOffer = sequenceOffer;
- }
-
- public AcksTo getAcksTo() {
- return acksTo;
- }
-
- public SequenceOffer getSequenceOffer() {
- return sequenceOffer;
- }
-
- public void toSOAPEnvelope(SOAPEnvelope envelope) throws AxisFault {
- SOAPBody body = envelope.getBody();
-
- //detach if already exist.
- OMElement elem = body.getFirstChildWithName(new QName(rmNamespaceValue,
- Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE));
- if (elem!=null)
- elem.detach();
-
- toOMElement(body);
- }
-
- public boolean isNamespaceSupported (String namespaceName) {
- if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
- return true;
-
- if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
- return true;
-
- return false;
- }
-
- public OMElement getSecurityTokenReference() {
- return securityTokenReference;
- }
-
- public void setSecurityTokenReference(OMElement theSTR) {
- this.securityTokenReference = theSTR;
- }
-
-}
+/*
+ * 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.wsrm;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axis2.AxisFault;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+import org.apache.sandesha2.util.SpecSpecificConstants;
+
+/**
+ * Represent the CreateSequence body element.
+ */
+
+public class CreateSequence implements IOMRMPart {
+
+ private AcksTo acksTo = null;
+
+ private Expires expires = null;
+
+ private SequenceOffer sequenceOffer = null;
+
+ private String rmNamespaceValue = null;
+
+ private String secNamespaceValue = null;
+
+ private OMElement securityTokenReference = null;
+
+ // Constructor used while parsing
+ public CreateSequence(String rmNamespaceValue) throws SandeshaException {
+ if (!isNamespaceSupported(rmNamespaceValue))
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ rmNamespaceValue));
+
+ this.rmNamespaceValue = rmNamespaceValue;
+ this.secNamespaceValue = SpecSpecificConstants.getSecurityNamespace(rmNamespaceValue);
+ }
+
+ // Constructor used while writing
+ public CreateSequence (AcksTo acksTo,SOAPFactory factory,String rmNamespaceValue) throws SandeshaException {
+ this (rmNamespaceValue);
+ this.acksTo = acksTo;
+ }
+
+ public String getNamespaceValue() {
+ return rmNamespaceValue;
+ }
+
+ public String getAddressingNamespaceValue() {
+ if(acksTo != null) return acksTo.getAddressingNamespaceValue();
+ return null;
+ }
+
+ public Object fromOMElement(OMElement bodyElement) throws OMException,AxisFault {
+
+ OMElement createSequencePart = bodyElement
+ .getFirstChildWithName(new QName(rmNamespaceValue,
+ Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE));
+ if (createSequencePart == null)
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.noCreateSeqPartInElement,
+ bodyElement.toString()));
+
+ acksTo = new AcksTo(rmNamespaceValue);
+ acksTo.fromOMElement(createSequencePart);
+
+ OMElement offerPart = createSequencePart.getFirstChildWithName(new QName(rmNamespaceValue,
+ Sandesha2Constants.WSRM_COMMON.SEQUENCE_OFFER));
+ if (offerPart != null) {
+ sequenceOffer = new SequenceOffer(rmNamespaceValue);
+ sequenceOffer.fromOMElement(createSequencePart);
+ }
+
+ OMElement expiresPart = createSequencePart.getFirstChildWithName(
+ new QName(rmNamespaceValue,
+ Sandesha2Constants.WSRM_COMMON.EXPIRES));
+ if (expiresPart != null) {
+ expires = new Expires(rmNamespaceValue);
+ expires.fromOMElement(createSequencePart);
+ }
+
+ if(secNamespaceValue != null) {
+ securityTokenReference = createSequencePart.getFirstChildWithName(
+ new QName(secNamespaceValue, "SecurityTokenReference"));
+ }
+ return this;
+ }
+
+ public OMElement toOMElement(OMElement bodyElement) throws OMException, AxisFault {
+
+ if (bodyElement == null || !(bodyElement instanceof SOAPBody))
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.createSeqCannotBeAddedToNonBody));
+
+ if (acksTo == null)
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.createSeqNullAcksTo));
+
+ SOAPBody soapBody = (SOAPBody) bodyElement;
+
+ OMFactory factory = bodyElement.getOMFactory();
+
+ OMNamespace rmNamespace = factory.createOMNamespace(rmNamespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
+ OMElement createSequenceElement = factory.createOMElement(
+ Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE, rmNamespace);
+
+ acksTo.toOMElement(createSequenceElement);
+
+ if (sequenceOffer != null) {
+ sequenceOffer.toOMElement(createSequenceElement);
+ }
+
+ if (expires != null) {
+ expires.toOMElement(createSequenceElement);
+ }
+
+ if(securityTokenReference != null) {
+ createSequenceElement.addChild(securityTokenReference);
+ }
+
+ soapBody.addChild(createSequenceElement);
+ return soapBody;
+ }
+
+ public void setAcksTo(AcksTo acksTo) {
+ this.acksTo = acksTo;
+ }
+
+ public void setSequenceOffer(SequenceOffer sequenceOffer) {
+ this.sequenceOffer = sequenceOffer;
+ }
+
+ public AcksTo getAcksTo() {
+ return acksTo;
+ }
+
+ public SequenceOffer getSequenceOffer() {
+ return sequenceOffer;
+ }
+
+ public void toSOAPEnvelope(SOAPEnvelope envelope) throws AxisFault {
+ SOAPBody body = envelope.getBody();
+
+ //detach if already exist.
+ OMElement elem = body.getFirstChildWithName(new QName(rmNamespaceValue,
+ Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE));
+ if (elem!=null)
+ elem.detach();
+
+ toOMElement(body);
+ }
+
+ public boolean isNamespaceSupported (String namespaceName) {
+ if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
+ return true;
+
+ if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
+ return true;
+
+ return false;
+ }
+
+ public OMElement getSecurityTokenReference() {
+ return securityTokenReference;
+ }
+
+ public void setSecurityTokenReference(OMElement theSTR) {
+ this.securityTokenReference = theSTR;
+ }
+
+}
Propchange: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequence.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequenceResponse.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequenceResponse.java?view=diff&rev=564063&r1=564062&r2=564063
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequenceResponse.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequenceResponse.java Wed Aug 8 17:57:51 2007
@@ -1,183 +1,183 @@
-/*
- * 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.wsrm;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.AxisFault;
-import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.SandeshaException;
-import org.apache.sandesha2.i18n.SandeshaMessageHelper;
-import org.apache.sandesha2.i18n.SandeshaMessageKeys;
-
-/**
- * Adds the CreateSequenceResponse body part.
- */
-
-public class CreateSequenceResponse implements IOMRMPart {
-
- private Identifier identifier;
-
- private Accept accept;
-
- private Expires expires;
-
- private String rmNamespaceValue = null;
-
- public CreateSequenceResponse(String rmNamespaceValue) throws SandeshaException {
- if (!isNamespaceSupported(rmNamespaceValue))
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- rmNamespaceValue));
-
- this.rmNamespaceValue = rmNamespaceValue;
- }
-
- public String getNamespaceValue() {
- return rmNamespaceValue;
- }
-
- public Object fromOMElement(OMElement bodyElement) throws OMException,AxisFault {
-
- if (bodyElement == null || !(bodyElement instanceof SOAPBody))
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.createSeqResponseCannotBeAddedToNonBody));
-
- SOAPBody SOAPBody = (SOAPBody) bodyElement;
-
- OMElement createSeqResponsePart = SOAPBody
- .getFirstChildWithName(new QName(rmNamespaceValue,Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE_RESPONSE));
- if (createSeqResponsePart == null)
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.noCreateSeqResponsePartInElement,
- bodyElement.toString()));
-
- identifier = new Identifier(rmNamespaceValue);
- identifier.fromOMElement(createSeqResponsePart);
-
- OMElement expiresPart = createSeqResponsePart.getFirstChildWithName(
- new QName(rmNamespaceValue,
- Sandesha2Constants.WSRM_COMMON.EXPIRES));
- if (expiresPart != null) {
- expires = new Expires(rmNamespaceValue);
- expires.fromOMElement(createSeqResponsePart);
- }
-
- OMElement acceptPart = createSeqResponsePart.getFirstChildWithName(
- new QName(rmNamespaceValue,
- Sandesha2Constants.WSRM_COMMON.ACCEPT));
- if (acceptPart != null) {
- accept = new Accept(rmNamespaceValue);
- accept.fromOMElement(createSeqResponsePart);
- }
-
- return this;
- }
-
- public OMElement toOMElement(OMElement bodyElement) throws OMException, AxisFault {
-
- if (bodyElement == null || !(bodyElement instanceof SOAPBody))
- throw new OMException(
- SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.createSeqResponseCannotBeAddedToNonBody));
-
- SOAPBody SOAPBody = (SOAPBody) bodyElement;
-
- if (identifier == null)
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.invalidIdentifier,
- bodyElement.toString()));
-
- OMFactory factory = bodyElement.getOMFactory();
-
- OMNamespace rmNamespace = factory.createOMNamespace(rmNamespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
-
- OMElement createSequenceResponseElement = factory.createOMElement(
- Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE_RESPONSE,
- rmNamespace);
-
- identifier.toOMElement(createSequenceResponseElement);
-
- if (expires != null) {
- expires.toOMElement(createSequenceResponseElement);
- }
-
- if (accept != null) {
- accept.toOMElement(createSequenceResponseElement);
- }
-
- SOAPBody.addChild(createSequenceResponseElement);
-
-
-
- return SOAPBody;
- }
-
- public void setIdentifier(Identifier identifier) {
- this.identifier = identifier;
- }
-
- public Identifier getIdentifier() {
- return identifier;
- }
-
- public void setAccept(Accept accept) {
- this.accept = accept;
- }
-
- public Accept getAccept() {
- return accept;
- }
-
- public Expires getExpires() {
- return expires;
- }
-
- public void setExpires(Expires expires) {
- this.expires = expires;
- }
-
- public void toSOAPEnvelope(SOAPEnvelope envelope) throws AxisFault {
- SOAPBody body = envelope.getBody();
-
- //detach if already exist.
- OMElement elem = body.getFirstChildWithName(new QName(rmNamespaceValue,
- Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE_RESPONSE));
- if (elem!=null)
- elem.detach();
-
- toOMElement(body);
- }
-
- public boolean isNamespaceSupported (String namespaceName) {
- if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
- return true;
-
- if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
- return true;
-
- return false;
- }
-
-}
+/*
+ * 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.wsrm;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.AxisFault;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+
+/**
+ * Adds the CreateSequenceResponse body part.
+ */
+
+public class CreateSequenceResponse implements IOMRMPart {
+
+ private Identifier identifier;
+
+ private Accept accept;
+
+ private Expires expires;
+
+ private String rmNamespaceValue = null;
+
+ public CreateSequenceResponse(String rmNamespaceValue) throws SandeshaException {
+ if (!isNamespaceSupported(rmNamespaceValue))
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ rmNamespaceValue));
+
+ this.rmNamespaceValue = rmNamespaceValue;
+ }
+
+ public String getNamespaceValue() {
+ return rmNamespaceValue;
+ }
+
+ public Object fromOMElement(OMElement bodyElement) throws OMException,AxisFault {
+
+ if (bodyElement == null || !(bodyElement instanceof SOAPBody))
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.createSeqResponseCannotBeAddedToNonBody));
+
+ SOAPBody SOAPBody = (SOAPBody) bodyElement;
+
+ OMElement createSeqResponsePart = SOAPBody
+ .getFirstChildWithName(new QName(rmNamespaceValue,Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE_RESPONSE));
+ if (createSeqResponsePart == null)
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.noCreateSeqResponsePartInElement,
+ bodyElement.toString()));
+
+ identifier = new Identifier(rmNamespaceValue);
+ identifier.fromOMElement(createSeqResponsePart);
+
+ OMElement expiresPart = createSeqResponsePart.getFirstChildWithName(
+ new QName(rmNamespaceValue,
+ Sandesha2Constants.WSRM_COMMON.EXPIRES));
+ if (expiresPart != null) {
+ expires = new Expires(rmNamespaceValue);
+ expires.fromOMElement(createSeqResponsePart);
+ }
+
+ OMElement acceptPart = createSeqResponsePart.getFirstChildWithName(
+ new QName(rmNamespaceValue,
+ Sandesha2Constants.WSRM_COMMON.ACCEPT));
+ if (acceptPart != null) {
+ accept = new Accept(rmNamespaceValue);
+ accept.fromOMElement(createSeqResponsePart);
+ }
+
+ return this;
+ }
+
+ public OMElement toOMElement(OMElement bodyElement) throws OMException, AxisFault {
+
+ if (bodyElement == null || !(bodyElement instanceof SOAPBody))
+ throw new OMException(
+ SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.createSeqResponseCannotBeAddedToNonBody));
+
+ SOAPBody SOAPBody = (SOAPBody) bodyElement;
+
+ if (identifier == null)
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.invalidIdentifier,
+ bodyElement.toString()));
+
+ OMFactory factory = bodyElement.getOMFactory();
+
+ OMNamespace rmNamespace = factory.createOMNamespace(rmNamespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
+
+ OMElement createSequenceResponseElement = factory.createOMElement(
+ Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE_RESPONSE,
+ rmNamespace);
+
+ identifier.toOMElement(createSequenceResponseElement);
+
+ if (expires != null) {
+ expires.toOMElement(createSequenceResponseElement);
+ }
+
+ if (accept != null) {
+ accept.toOMElement(createSequenceResponseElement);
+ }
+
+ SOAPBody.addChild(createSequenceResponseElement);
+
+
+
+ return SOAPBody;
+ }
+
+ public void setIdentifier(Identifier identifier) {
+ this.identifier = identifier;
+ }
+
+ public Identifier getIdentifier() {
+ return identifier;
+ }
+
+ public void setAccept(Accept accept) {
+ this.accept = accept;
+ }
+
+ public Accept getAccept() {
+ return accept;
+ }
+
+ public Expires getExpires() {
+ return expires;
+ }
+
+ public void setExpires(Expires expires) {
+ this.expires = expires;
+ }
+
+ public void toSOAPEnvelope(SOAPEnvelope envelope) throws AxisFault {
+ SOAPBody body = envelope.getBody();
+
+ //detach if already exist.
+ OMElement elem = body.getFirstChildWithName(new QName(rmNamespaceValue,
+ Sandesha2Constants.WSRM_COMMON.CREATE_SEQUENCE_RESPONSE));
+ if (elem!=null)
+ elem.detach();
+
+ toOMElement(body);
+ }
+
+ public boolean isNamespaceSupported (String namespaceName) {
+ if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
+ return true;
+
+ if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
+ return true;
+
+ return false;
+ }
+
+}
Propchange: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequenceResponse.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Endpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Expires.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Expires.java?view=diff&rev=564063&r1=564062&r2=564063
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Expires.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Expires.java Wed Aug 8 17:57:51 2007
@@ -1,105 +1,105 @@
-/*
- * 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.wsrm;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.SandeshaException;
-import org.apache.sandesha2.i18n.SandeshaMessageHelper;
-import org.apache.sandesha2.i18n.SandeshaMessageKeys;
-
-/**
- * Represents an Expires element.
- */
-
-public class Expires implements IOMRMElement {
-
- private String duration = null;
-
- private String namespaceValue = null;
-
- public Expires(String namespaceValue) throws SandeshaException {
- if (!isNamespaceSupported(namespaceValue))
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- namespaceValue));
-
- this.namespaceValue = namespaceValue;
- }
-
- public Object fromOMElement(OMElement element) throws OMException {
- OMElement expiresPart = element.getFirstChildWithName(new QName(
- namespaceValue, Sandesha2Constants.WSRM_COMMON.EXPIRES));
- if (expiresPart == null)
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.noExpiresPartInElement,
- element.toString()));
- String expiresText = expiresPart.getText();
- if (expiresText == null || expiresText == "")
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.cannotProcessExpires));
-
- duration = expiresText;
- return element;
- }
-
- public String getNamespaceValue() throws OMException {
- return namespaceValue;
- }
-
- public OMElement toOMElement(OMElement element) throws OMException {
-
- if (duration == null || duration == "")
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.cannotProcessExpires));
-
- OMFactory factory = element.getOMFactory();
-
- OMNamespace rmNamespace = factory.createOMNamespace(namespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
- OMElement expiresElement = factory.createOMElement(
- Sandesha2Constants.WSRM_COMMON.EXPIRES, rmNamespace);
-
- expiresElement.setText(duration);
- element.addChild(expiresElement);
-
- return element;
- }
-
- public String getDuration() {
- return duration;
- }
-
- public void setDuration(String duration) {
- this.duration = duration;
- }
-
- public boolean isNamespaceSupported (String namespaceName) {
- if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
- return true;
-
- if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
- return true;
-
- return false;
- }
-}
+/*
+ * 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.wsrm;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+
+/**
+ * Represents an Expires element.
+ */
+
+public class Expires implements IOMRMElement {
+
+ private String duration = null;
+
+ private String namespaceValue = null;
+
+ public Expires(String namespaceValue) throws SandeshaException {
+ if (!isNamespaceSupported(namespaceValue))
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ namespaceValue));
+
+ this.namespaceValue = namespaceValue;
+ }
+
+ public Object fromOMElement(OMElement element) throws OMException {
+ OMElement expiresPart = element.getFirstChildWithName(new QName(
+ namespaceValue, Sandesha2Constants.WSRM_COMMON.EXPIRES));
+ if (expiresPart == null)
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.noExpiresPartInElement,
+ element.toString()));
+ String expiresText = expiresPart.getText();
+ if (expiresText == null || expiresText == "")
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.cannotProcessExpires));
+
+ duration = expiresText;
+ return element;
+ }
+
+ public String getNamespaceValue() throws OMException {
+ return namespaceValue;
+ }
+
+ public OMElement toOMElement(OMElement element) throws OMException {
+
+ if (duration == null || duration == "")
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.cannotProcessExpires));
+
+ OMFactory factory = element.getOMFactory();
+
+ OMNamespace rmNamespace = factory.createOMNamespace(namespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
+ OMElement expiresElement = factory.createOMElement(
+ Sandesha2Constants.WSRM_COMMON.EXPIRES, rmNamespace);
+
+ expiresElement.setText(duration);
+ element.addChild(expiresElement);
+
+ return element;
+ }
+
+ public String getDuration() {
+ return duration;
+ }
+
+ public void setDuration(String duration) {
+ this.duration = duration;
+ }
+
+ public boolean isNamespaceSupported (String namespaceName) {
+ if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
+ return true;
+
+ if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
+ return true;
+
+ return false;
+ }
+}
Propchange: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Expires.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/FaultCode.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/FaultCode.java?view=diff&rev=564063&r1=564062&r2=564063
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/FaultCode.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/FaultCode.java Wed Aug 8 17:57:51 2007
@@ -1,176 +1,176 @@
-/*
- * 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.wsrm;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.SandeshaException;
-import org.apache.sandesha2.i18n.SandeshaMessageHelper;
-import org.apache.sandesha2.i18n.SandeshaMessageKeys;
-
-/**
- * Represents an FaultCode element.
- */
-
-public class FaultCode implements IOMRMElement {
-
- private QName faultCode = null;
-
- private String namespaceValue = null;
-
- private String detail;
-
- private OMElement detailOMElement;
-
- private OMElement extendedDetailOMElement;
-
- public FaultCode(String namespaceValue) throws SandeshaException {
- if (!isNamespaceSupported(namespaceValue))
- throw new SandeshaException (SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.unknownSpec,
- namespaceValue));
-
- this.namespaceValue = namespaceValue;
- }
-
- public String getNamespaceValue() {
- return namespaceValue;
- }
-
- public Object fromOMElement(OMElement sequenceFault) throws OMException {
-
- if (sequenceFault == null)
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.noFaultCodePart,
- null));
-
- OMElement faultCodePart = sequenceFault
- .getFirstChildWithName(new QName(namespaceValue,
- Sandesha2Constants.WSRM_COMMON.FAULT_CODE));
-
- if (faultCodePart == null)
- throw new OMException(SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.noFaultCode,
- sequenceFault.toString()));
-
- this.faultCode = faultCodePart.getTextAsQName();
-
- OMElement detailPart = sequenceFault
- .getFirstChildWithName(new QName(namespaceValue,
- Sandesha2Constants.WSRM_COMMON.DETAIL));
-
- if (detailPart != null) {
- detailOMElement = detailPart;
-
- OMElement identifier = detailPart
- .getFirstChildWithName(new QName(namespaceValue,
- Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
- if (identifier != null) {
- detail = identifier.getText();
- }
- }
-
- return sequenceFault;
-
- }
-
- public OMElement toOMElement(OMElement sequenceFault) throws OMException {
-
- if (sequenceFault == null)
- throw new OMException(
- SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.nullPassedElement));
-
- if (faultCode == null)
- throw new OMException(
- SandeshaMessageHelper.getMessage(
- SandeshaMessageKeys.noFaultCode));
-
- OMFactory factory = sequenceFault.getOMFactory();
-
- OMNamespace rmNamespace = factory.createOMNamespace(namespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
- OMElement faultCodeElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.FAULT_CODE,rmNamespace);
- OMElement detailElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.DETAIL,rmNamespace);
-
- faultCodeElement.setText(faultCode);
- sequenceFault.addChild(faultCodeElement);
-
- if (detailOMElement != null)
- detailElement.addChild(detailOMElement);
-
- if (detail != null)
- detailElement.setText(detail);
-
- if (extendedDetailOMElement != null) {
- detailElement.addChild(extendedDetailOMElement);
- }
-
- sequenceFault.addChild(detailElement);
-
- return sequenceFault;
- }
-
- public void setFaultCode(QName faultCode) {
- this.faultCode = faultCode;
- }
-
- public QName getFaultCode() {
- return faultCode;
- }
-
- public void setDetail(String detail) {
- this.detail = detail;
- }
-
- public String getDetail() {
- return detail;
- }
-
- public OMElement getDetailOMElement() {
- return detailOMElement;
- }
-
- public void setDetailOMElement(OMElement detailOMElement) {
- this.detailOMElement = detailOMElement;
- }
-
- public void setExtendedDetailOMElement(OMElement detail2) {
- this.extendedDetailOMElement = detail2;
- }
-
- public OMElement getExtendedDetailOMElement() {
- return extendedDetailOMElement;
- }
-
- public boolean isNamespaceSupported (String namespaceName) {
- if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
- return true;
-
- if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
- return true;
-
- return false;
- }
-
-
-}
+/*
+ * 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.wsrm;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+
+/**
+ * Represents an FaultCode element.
+ */
+
+public class FaultCode implements IOMRMElement {
+
+ private QName faultCode = null;
+
+ private String namespaceValue = null;
+
+ private String detail;
+
+ private OMElement detailOMElement;
+
+ private OMElement extendedDetailOMElement;
+
+ public FaultCode(String namespaceValue) throws SandeshaException {
+ if (!isNamespaceSupported(namespaceValue))
+ throw new SandeshaException (SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.unknownSpec,
+ namespaceValue));
+
+ this.namespaceValue = namespaceValue;
+ }
+
+ public String getNamespaceValue() {
+ return namespaceValue;
+ }
+
+ public Object fromOMElement(OMElement sequenceFault) throws OMException {
+
+ if (sequenceFault == null)
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.noFaultCodePart,
+ null));
+
+ OMElement faultCodePart = sequenceFault
+ .getFirstChildWithName(new QName(namespaceValue,
+ Sandesha2Constants.WSRM_COMMON.FAULT_CODE));
+
+ if (faultCodePart == null)
+ throw new OMException(SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.noFaultCode,
+ sequenceFault.toString()));
+
+ this.faultCode = faultCodePart.getTextAsQName();
+
+ OMElement detailPart = sequenceFault
+ .getFirstChildWithName(new QName(namespaceValue,
+ Sandesha2Constants.WSRM_COMMON.DETAIL));
+
+ if (detailPart != null) {
+ detailOMElement = detailPart;
+
+ OMElement identifier = detailPart
+ .getFirstChildWithName(new QName(namespaceValue,
+ Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
+ if (identifier != null) {
+ detail = identifier.getText();
+ }
+ }
+
+ return sequenceFault;
+
+ }
+
+ public OMElement toOMElement(OMElement sequenceFault) throws OMException {
+
+ if (sequenceFault == null)
+ throw new OMException(
+ SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.nullPassedElement));
+
+ if (faultCode == null)
+ throw new OMException(
+ SandeshaMessageHelper.getMessage(
+ SandeshaMessageKeys.noFaultCode));
+
+ OMFactory factory = sequenceFault.getOMFactory();
+
+ OMNamespace rmNamespace = factory.createOMNamespace(namespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
+ OMElement faultCodeElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.FAULT_CODE,rmNamespace);
+ OMElement detailElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.DETAIL,rmNamespace);
+
+ faultCodeElement.setText(faultCode);
+ sequenceFault.addChild(faultCodeElement);
+
+ if (detailOMElement != null)
+ detailElement.addChild(detailOMElement);
+
+ if (detail != null)
+ detailElement.setText(detail);
+
+ if (extendedDetailOMElement != null) {
+ detailElement.addChild(extendedDetailOMElement);
+ }
+
+ sequenceFault.addChild(detailElement);
+
+ return sequenceFault;
+ }
+
+ public void setFaultCode(QName faultCode) {
+ this.faultCode = faultCode;
+ }
+
+ public QName getFaultCode() {
+ return faultCode;
+ }
+
+ public void setDetail(String detail) {
+ this.detail = detail;
+ }
+
+ public String getDetail() {
+ return detail;
+ }
+
+ public OMElement getDetailOMElement() {
+ return detailOMElement;
+ }
+
+ public void setDetailOMElement(OMElement detailOMElement) {
+ this.detailOMElement = detailOMElement;
+ }
+
+ public void setExtendedDetailOMElement(OMElement detail2) {
+ this.extendedDetailOMElement = detail2;
+ }
+
+ public OMElement getExtendedDetailOMElement() {
+ return extendedDetailOMElement;
+ }
+
+ public boolean isNamespaceSupported (String namespaceName) {
+ if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
+ return true;
+
+ if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
+ return true;
+
+ return false;
+ }
+
+
+}
Propchange: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/FaultCode.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/IOMRMElement.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/IOMRMElement.java?view=diff&rev=564063&r1=564062&r2=564063
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/IOMRMElement.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/IOMRMElement.java Wed Aug 8 17:57:51 2007
@@ -1,32 +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.wsrm;
-
-/**
- * This is the base interface for all RM infoset objects.
- */
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.AxisFault;
-
-public interface IOMRMElement {
- public String getNamespaceValue();
- public Object fromOMElement(OMElement element) throws AxisFault ;
- public OMElement toOMElement(OMElement element) throws AxisFault ;
- public boolean isNamespaceSupported (String namespaceName);
-}
+/*
+ * 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.wsrm;
+
+/**
+ * This is the base interface for all RM infoset objects.
+ */
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.AxisFault;
+
+public interface IOMRMElement {
+ public String getNamespaceValue();
+ public Object fromOMElement(OMElement element) throws AxisFault ;
+ public OMElement toOMElement(OMElement element) throws AxisFault ;
+ public boolean isNamespaceSupported (String namespaceName);
+}
Propchange: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/IOMRMElement.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/IOMRMPart.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/IOMRMPart.java?view=diff&rev=564063&r1=564062&r2=564063
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/IOMRMPart.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/IOMRMPart.java Wed Aug 8 17:57:51 2007
@@ -1,30 +1,30 @@
-/*
- * 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.wsrm;
-
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.AxisFault;
-
-/**
- * This is the base interface for RM infoset objects that are added directly so
- * SOAPBody or SOAPHeader (we call them MessageParts).
- */
-
-public interface IOMRMPart extends IOMRMElement {
- public void toSOAPEnvelope (SOAPEnvelope envelope) throws AxisFault;
-}
+/*
+ * 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.wsrm;
+
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.AxisFault;
+
+/**
+ * This is the base interface for RM infoset objects that are added directly so
+ * SOAPBody or SOAPHeader (we call them MessageParts).
+ */
+
+public interface IOMRMPart extends IOMRMElement {
+ public void toSOAPEnvelope (SOAPEnvelope envelope) throws AxisFault;
+}
Propchange: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/IOMRMPart.java
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org