axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davidills...@apache.org
Subject svn commit: r487521 - in /webservices/axis2/trunk/java/modules/kernel: src/org/apache/axis2/addressing/EndpointReference.java src/org/apache/axis2/addressing/EndpointReferenceHelper.java test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java
Date Fri, 15 Dec 2006 11:49:04 GMT
Author: davidillsley
Date: Fri Dec 15 03:48:59 2006
New Revision: 487521

URL: http://svn.apache.org/viewvc?view=rev&rev=487521
Log:
Add support for EndpointReference Metadata element attributes per the addressing schema

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java?view=diff&rev=487521&r1=487520&r2=487521
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java
Fri Dec 15 03:48:59 2006
@@ -59,6 +59,7 @@
     private String address;
     private ArrayList addressAttributes;
     private ArrayList metaData;
+    private ArrayList metaDataAttributes;
     private Map referenceParameters;
     private ArrayList extensibleElements;
     private ArrayList attributes;
@@ -128,6 +129,14 @@
         addressAttributes = al;
     }
     
+    public ArrayList getMetadataAttributes(){
+        return metaDataAttributes;
+    }
+    
+    public void setMetadataAttributes(ArrayList al){
+        metaDataAttributes = al;
+    }
+    
     /**
      * hasAnonymousAddress
      * 
@@ -253,6 +262,10 @@
      */
     public String toString() {
         StringBuffer buffer = new StringBuffer("Address: " + address);
+        
+        if(addressAttributes != null){
+            buffer.append(", Address Attributes: ").append(addressAttributes);
+        }
         
         if (metaData != null)
             buffer.append(", Metadata: ").append(metaData);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReferenceHelper.java?view=diff&rev=487521&r1=487520&r2=487521
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
Fri Dec 15 03:48:59 2006
@@ -204,8 +204,19 @@
                     OMElement omElement = (OMElement) metaData.get(i);
                     metadataE.addChild(ElementHelper.importOMElement(omElement, factory));
                 }
+                
+                ArrayList metadataAttributes = epr.getMetadataAttributes();
+                if (metadataAttributes != null) {
+                    Iterator attrIter = metadataAttributes.iterator();
+                    while (attrIter.hasNext()) {
+                        OMAttribute omAttributes = (OMAttribute) attrIter.next();
+                        metadataE.addAttribute(omAttributes);
+                    }
+                }
             }
 
+            
+            
             Map referenceParameters = epr.getAllReferenceParameters();
             if (referenceParameters != null) {
                 OMElement refParameterElement = factory.createOMElement(AddressingConstants.EPR_REFERENCE_PARAMETERS,
wsaNS, eprElement);
@@ -255,6 +266,7 @@
                 while (allAddrAttributes.hasNext()) {
                     OMAttribute attribute = (OMAttribute) allAddrAttributes.next();
                     addressAttributes.add(attribute);
+                    System.out.println("fromOM attr: "+attribute);
                 }
                 epr.setAddressAttributes(addressAttributes);
             }
@@ -272,6 +284,13 @@
                     OMNode node = (OMNode) iterator.next();
                     epr.addMetaData(node);
                 }
+                Iterator allMDAttributes = eprChildElement.getAllAttributes();
+                ArrayList metadataAttributes = new ArrayList();
+                while (allMDAttributes.hasNext()) {
+                    OMAttribute attribute = (OMAttribute) allMDAttributes.next();
+                    metadataAttributes.add(attribute);
+                }
+                epr.setMetadataAttributes(metadataAttributes);
             }
             else if (!isFinalAddressingNamespace &&
                     map.get(AddressingConstants.Submission.EPR_REFERENCE_PROPERTIES).equals(qname))
{

Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java?view=diff&rev=487521&r1=487520&r2=487521
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java
Fri Dec 15 03:48:59 2006
@@ -59,6 +59,11 @@
         addressAttributes.add(attr2);
         epr.setAddressAttributes(addressAttributes);
         
+        ArrayList metadataAttributes = new ArrayList();
+        metadataAttributes.add(attr1);
+        metadataAttributes.add(attr2);
+        epr.setMetadataAttributes(metadataAttributes);
+        
         OMElement om = EndpointReferenceHelper.toOM(omf, epr, new QName("http://nsurl","localName","prefix"),
AddressingConstants.Final.WSA_NAMESPACE);
         
         //Test deserialize using fromOM(OMElement)
@@ -76,6 +81,9 @@
         ArrayList metadata = deser.getMetaData();
         assertEquals(md1, metadata.get(0));
         assertEquals(md2, metadata.get(1));
+        ArrayList mdAttrs = deser.getMetadataAttributes();
+        assertEquals(attr1,mdAttrs.get(0));
+        assertEquals(attr2,mdAttrs.get(1));
         
         ArrayList extelts = deser.getExtensibleElements();
         assertEquals(ext1,extelts.get(0));
@@ -101,6 +109,9 @@
         metadata = deser.getMetaData();
         assertEquals(md1, metadata.get(0));
         assertEquals(md2, metadata.get(1));
+        mdAttrs = deser.getMetadataAttributes();
+        assertEquals(attr1,mdAttrs.get(0));
+        assertEquals(attr2,mdAttrs.get(1));
         
         extelts = deser.getExtensibleElements();
         assertEquals(ext1,extelts.get(0));



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


Mime
View raw message