You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ch...@apache.org on 2005/05/26 05:58:28 UTC

svn commit: r178575 - in /webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions: ./ DefaultExtensibilityElement.java ExtensionConstants.java ExtensionFactory.java SOAPAddress.java impl/ impl/DefaultExtensibilityElementImpl.java impl/ExtensionFactoryImpl.java impl/SOAPAddressImpl.java

Author: chathura
Date: Wed May 25 20:58:26 2005
New Revision: 178575

URL: http://svn.apache.org/viewcvs?rev=178575&view=rev
Log:
Basic Extension framework added to the WOM. This includes Few Extension elements and a DefaultExtensibilityElement to handle the unidentified Extensibility Elements.

Added:
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/DefaultExtensibilityElement.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/ExtensionConstants.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/ExtensionFactory.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/SOAPAddress.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/DefaultExtensibilityElementImpl.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/ExtensionFactoryImpl.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/SOAPAddressImpl.java

Added: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/DefaultExtensibilityElement.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/DefaultExtensibilityElement.java?rev=178575&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/DefaultExtensibilityElement.java (added)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/DefaultExtensibilityElement.java Wed May 25 20:58:26 2005
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2001-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.wsdl.extensions;
+
+import org.apache.wsdl.WSDLExtensibilityElement;
+import org.w3c.dom.Element;
+
+/**
+ * @author chathura@opensource.lk
+ * This would be the default Extension class in case that the Extensibility Element
+ * in the WSDL file could not be mapped to a particular Extensibility Element. In 
+ * which case the entire Extensibility Element will be kept as a DOM Element
+ */
+public interface DefaultExtensibilityElement extends WSDLExtensibilityElement{
+	/**
+	 * @return The Extensibility Element as a DOM Element
+	 */
+	public Element getElement();
+
+	/**
+	 * Sets the DOM Element as the extensibility Elements 
+	 * Content.
+	 */
+	public void setElement(Element element);
+
+	
+}
\ No newline at end of file

Added: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/ExtensionConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/ExtensionConstants.java?rev=178575&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/ExtensionConstants.java (added)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/ExtensionConstants.java Wed May 25 20:58:26 2005
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2001-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.wsdl.extensions;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author chathura@opensource.lk
+ *
+ */
+public interface ExtensionConstants {
+	
+	/**
+	 * The Type name for the SOAP Address defined in the Port/Endpoint
+	 */
+	public static final QName SOAP_ADDRESS =  new QName("http://schemas.xmlsoap.org/wsdl/soap/", "address");
+
+}

Added: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/ExtensionFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/ExtensionFactory.java?rev=178575&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/ExtensionFactory.java (added)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/ExtensionFactory.java Wed May 25 20:58:26 2005
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2001-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.wsdl.extensions;
+
+import javax.xml.namespace.QName;
+
+import org.apache.wsdl.WSDLExtensibilityElement;
+
+/**
+ * @author chathura@opensource.lk
+ *
+ */
+public interface ExtensionFactory {
+	/**
+	 * Returns the correct "Specific" ExtensibilityElement given the 
+	 * <code>QName</code> 
+	 * @param qName QName of the ExtensibilityElement found in the WSDL
+	 * @return the Specific implementation for the particular QName given.
+	 */
+	public WSDLExtensibilityElement getExtensionElement(QName qName);
+}
\ No newline at end of file

Added: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/SOAPAddress.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/SOAPAddress.java?rev=178575&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/SOAPAddress.java (added)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/SOAPAddress.java Wed May 25 20:58:26 2005
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2001-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.wsdl.extensions;
+
+import org.apache.wsdl.WSDLExtensibilityElement;
+
+/**
+ * @author chathura@opensource.lk
+ * This Extensibility Element is extended to handle particularly the
+ * SOAP Adress or the Endpoint URL.
+ */
+public interface SOAPAddress extends WSDLExtensibilityElement {
+	
+	/**
+	 * Gets the Endpoint adress
+	 */
+	public String getLocationURI();
+
+	/**
+	 * Sets the Endpoint Address
+	 */
+	public void setLocationURI(String locationURI);
+}
\ No newline at end of file

Added: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/DefaultExtensibilityElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/DefaultExtensibilityElementImpl.java?rev=178575&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/DefaultExtensibilityElementImpl.java (added)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/DefaultExtensibilityElementImpl.java Wed May 25 20:58:26 2005
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2001-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.wsdl.extensions.impl;
+
+import org.apache.wsdl.extensions.DefaultExtensibilityElement;
+import org.apache.wsdl.impl.WSDLExtensibilityElementImpl;
+import org.w3c.dom.Element;
+
+/**
+ * @author chathura@opensource.lk
+ * This would be the default Extension class in case that the Extensibility Element
+ * in the WSDL file could not be mapped to a particular Extensibility Element. In 
+ * which case the entire Extensibility Element will be kept as a DOM Element
+ *  
+ */
+public class DefaultExtensibilityElementImpl extends
+		WSDLExtensibilityElementImpl implements DefaultExtensibilityElement {
+
+	private Element element;
+
+	/**
+	 * @return The Extensibility Element as a DOM Element
+	 */
+	public Element getElement() {
+		return element;
+	}
+
+	/**
+	 * Sets the DOM Element as the extensibility Elements 
+	 * Content.
+	 */
+	public void setElement(Element element) {
+		this.element = element;
+	}
+
+}
\ No newline at end of file

Added: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/ExtensionFactoryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/ExtensionFactoryImpl.java?rev=178575&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/ExtensionFactoryImpl.java (added)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/ExtensionFactoryImpl.java Wed May 25 20:58:26 2005
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2001-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.wsdl.extensions.impl;
+
+import javax.xml.namespace.QName;
+
+import org.apache.wsdl.WSDLExtensibilityElement;
+import org.apache.wsdl.extensions.ExtensionConstants;
+import org.apache.wsdl.extensions.ExtensionFactory;
+
+/**
+ * @author chathura@opensource.lk
+ *
+ */
+public class ExtensionFactoryImpl implements ExtensionFactory , ExtensionConstants{
+	/**
+	 * Returns the correct "Specific" ExtensibilityElement given the 
+	 * <code>QName</code> 
+	 * @param qName QName of the ExtensibilityElement found in the WSDL
+	 * @return the Specific implementation for the particular QName given.
+	 */
+	 public WSDLExtensibilityElement getExtensionElement(QName qName){
+	 	if(qName.equals(SOAP_ADDRESS))
+	 		return new SOAPAddressImpl();
+	 	
+	 	
+	 	return new DefaultExtensibilityElementImpl();
+	 }
+
+}

Added: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/SOAPAddressImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/SOAPAddressImpl.java?rev=178575&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/SOAPAddressImpl.java (added)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/SOAPAddressImpl.java Wed May 25 20:58:26 2005
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2001-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.wsdl.extensions.impl;
+
+import org.apache.wsdl.extensions.ExtensionConstants;
+import org.apache.wsdl.extensions.SOAPAddress;
+import org.apache.wsdl.impl.WSDLExtensibilityElementImpl;
+
+/**
+ * @author chathura@opensource.lk
+ * This Extensibility Element is extended to handle particularly the
+ * SOAP Adress or the Endpoint URL.
+ *
+ */
+public class SOAPAddressImpl extends WSDLExtensibilityElementImpl implements ExtensionConstants, SOAPAddress{
+	/**
+	 * Location of the Endpoint
+	 */
+	private String locationURI;
+	
+	
+	public SOAPAddressImpl(){
+		type = SOAP_ADDRESS;
+	}
+	
+
+	/**
+	 * Gets the Endpoint adress
+	 */
+	public String getLocationURI() {
+		return locationURI;
+	}
+	
+	/**
+	 * Sets the Endpoint Address
+	 */
+	public void setLocationURI(String locationURI) {
+		this.locationURI = locationURI;
+	}	
+}