axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r700032 - in /webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model: MTOM10Assertion.java MTOM11Assertion.java MTOMAssertion.java
Date Mon, 29 Sep 2008 08:56:36 GMT
Author: nandana
Date: Mon Sep 29 01:56:36 2008
New Revision: 700032

URL: http://svn.apache.org/viewvc?rev=700032&view=rev
Log:
Model mtom policy classes 

Added:
    webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM10Assertion.java
    webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM11Assertion.java
Modified:
    webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOMAssertion.java

Added: webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM10Assertion.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM10Assertion.java?rev=700032&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM10Assertion.java
(added)
+++ webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM10Assertion.java
Mon Sep 29 01:56:36 2008
@@ -0,0 +1,53 @@
+package org.apache.axis2.policy.model;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.Constants;
+import org.apache.neethi.PolicyComponent;
+
+/** Assertion to pick up the QName <wsoma:OptimizedMimeSerialization xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/>
*/
+public class MTOM10Assertion extends MTOMAssertion {
+
+    public final static String NS = "http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization";
+
+    public final static String MTOM_SERIALIZATION_CONFIG_LN = "OptimizedMimeSerialization";
+
+    public final static String PREFIX = "wsoma";
+
+    public QName getName() {
+        return new QName(NS, MTOM_SERIALIZATION_CONFIG_LN);
+    }
+
+    public short getType() {
+        return Constants.TYPE_ASSERTION;
+    }
+
+    public boolean equal(PolicyComponent policyComponent) {
+        throw new UnsupportedOperationException("TODO");
+    }
+
+    public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+        String prefix = writer.getPrefix(NS);
+
+        if (prefix == null) {
+            prefix = PREFIX;
+            writer.setPrefix(PREFIX, NS);
+        }
+
+        writer.writeStartElement(PREFIX, MTOM_SERIALIZATION_CONFIG_LN, NS);
+
+        if (optional)
+            writer.writeAttribute("Optional", "true");
+
+        writer.writeNamespace(PREFIX, NS);
+        writer.writeEndElement();
+
+    }
+
+    public PolicyComponent normalize() {
+        throw new UnsupportedOperationException("TODO");
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM11Assertion.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM11Assertion.java?rev=700032&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM11Assertion.java
(added)
+++ webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOM11Assertion.java
Mon Sep 29 01:56:36 2008
@@ -0,0 +1,52 @@
+package org.apache.axis2.policy.model;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.Constants;
+import org.apache.neethi.PolicyComponent;
+
+public class MTOM11Assertion extends MTOMAssertion {
+    
+    public final static String NS = "http://www.w3.org/2007/08/soap12-mtom-policy";
+
+    public final static String MTOM_LN = "MTOM";
+
+    public final static String PREFIX = "wsoma";
+
+    public QName getName() {
+        return new QName(NS, MTOM_LN);
+    }
+
+    public PolicyComponent normalize() {
+        throw new UnsupportedOperationException("TODO");
+    }
+
+    public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+        String prefix = writer.getPrefix(NS);
+
+        if (prefix == null) {
+            prefix = PREFIX;
+            writer.setPrefix(PREFIX, NS);
+        }
+
+        writer.writeStartElement(PREFIX, MTOM_LN, NS);
+
+        if (optional)
+            writer.writeAttribute("Optional", "true");
+
+        writer.writeNamespace(PREFIX, NS);
+        writer.writeEndElement();
+        
+    }
+
+    public boolean equal(PolicyComponent policyComponent) {
+        throw new UnsupportedOperationException("TODO");
+    }
+
+    public short getType() {
+        return Constants.TYPE_ASSERTION;
+    }
+
+}

Modified: webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOMAssertion.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOMAssertion.java?rev=700032&r1=700031&r2=700032&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOMAssertion.java
(original)
+++ webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/model/MTOMAssertion.java
Mon Sep 29 01:56:36 2008
@@ -20,69 +20,18 @@
 package org.apache.axis2.policy.model;
 
 import org.apache.neethi.Assertion;
-import org.apache.neethi.Constants;
-import org.apache.neethi.PolicyComponent;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-/** Assertion to pick up the QName <wsoma:OptimizedMimeSerialization xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/>
*/
-public class MTOMAssertion implements Assertion {
-
-    private boolean isOptional = false;
-
-    public final static String NS =
-            "http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization";
-
-    public final static String MTOM_SERIALIZATION_CONFIG_LN = "OptimizedMimeSerialization";
-    public final static String PREFIX = "wsoma";
-
-    public QName getName() {
-        return new QName(NS, MTOM_SERIALIZATION_CONFIG_LN);
-    }
-
-    public short getType() {
-        return Constants.TYPE_ASSERTION;
-    }
-
-    public boolean equal(PolicyComponent policyComponent) {
-        throw new UnsupportedOperationException("TODO");
-    }
 
+public abstract class MTOMAssertion implements Assertion {
 
+    protected boolean optional = false;
+    
     public boolean isOptional() {
-
-        return isOptional;
+        return optional;
     }
-
+    
     public void setOptional(boolean isOptional) {
-        this.isOptional = isOptional;
-    }
-
-    public void serialize(XMLStreamWriter writer) throws XMLStreamException {
-        String prefix = writer.getPrefix(NS);
-
-        if (prefix == null) {
-            prefix = PREFIX;
-            writer.setPrefix(PREFIX, NS);
-        }
-
-        writer.writeStartElement(PREFIX, MTOM_SERIALIZATION_CONFIG_LN, NS);
-
-        if (isOptional)
-            writer.writeAttribute("Optional", "true");
-
-        writer.writeNamespace(PREFIX, NS);
-        writer.writeEndElement();
-
-    }
-
-
-    public PolicyComponent normalize() {
-        throw new UnsupportedOperationException("TODO");
+        this.optional = isOptional;
     }
 
-
 }
 	
\ No newline at end of file



Mime
View raw message