axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thil...@apache.org
Subject svn commit: r489153 - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/utils/ adb/src/org/apache/axis2/databinding/utils/reader/ adb/test/org/apache/axis2/databinding/utils/reader/ integration/test/org/apache/rahas/ kernel...
Date Wed, 20 Dec 2006 17:32:39 GMT
Author: thilina
Date: Wed Dec 20 09:32:36 2006
New Revision: 489153

URL: http://svn.apache.org/viewvc?view=rev&rev=489153
Log:
Let's use the Base64 & UUIDGenerators from Axiom...

Making those deprecated and extend the Axis2 counterpart extend those in Axiom..


Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/rahas/RahasSAMLTokenUTForHoKV1205Test.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpServiceProcessor.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SessionManager.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Base64.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/UUIDGenerator.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/XMLUtils.java
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/context/OperationContextTest.java
    webservices/axis2/trunk/java/modules/rahas/src/org/apache/rahas/client/STSClient.java
    webservices/axis2/trunk/java/modules/rahas/src/org/apache/rahas/impl/TokenIssuerUtil.java
    webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingSubscriptionProcessor.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/conversation/STSRequester.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/conversation/Util.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
Wed Dec 20 09:32:36 2006
@@ -1,19 +1,5 @@
 package org.apache.axis2.databinding.utils;
 
-import org.apache.axiom.attachments.ByteArrayDataSource;
-import org.apache.axiom.attachments.utils.IOUtils;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.util.StAXUtils;
-import org.apache.axis2.databinding.i18n.ADBMessages;
-import org.apache.axis2.databinding.types.*;
-import org.apache.axis2.util.Base64;
-
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.lang.reflect.Array;
@@ -22,7 +8,56 @@
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.List;
+import java.util.TimeZone;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.axiom.attachments.ByteArrayDataSource;
+import org.apache.axiom.attachments.utils.IOUtils;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axis2.databinding.i18n.ADBMessages;
+import org.apache.axis2.databinding.types.Day;
+import org.apache.axis2.databinding.types.Duration;
+import org.apache.axis2.databinding.types.Entities;
+import org.apache.axis2.databinding.types.Entity;
+import org.apache.axis2.databinding.types.HexBinary;
+import org.apache.axis2.databinding.types.IDRef;
+import org.apache.axis2.databinding.types.IDRefs;
+import org.apache.axis2.databinding.types.Id;
+import org.apache.axis2.databinding.types.Language;
+import org.apache.axis2.databinding.types.Month;
+import org.apache.axis2.databinding.types.MonthDay;
+import org.apache.axis2.databinding.types.NCName;
+import org.apache.axis2.databinding.types.NMToken;
+import org.apache.axis2.databinding.types.NMTokens;
+import org.apache.axis2.databinding.types.Name;
+import org.apache.axis2.databinding.types.NegativeInteger;
+import org.apache.axis2.databinding.types.NonNegativeInteger;
+import org.apache.axis2.databinding.types.NonPositiveInteger;
+import org.apache.axis2.databinding.types.NormalizedString;
+import org.apache.axis2.databinding.types.Notation;
+import org.apache.axis2.databinding.types.PositiveInteger;
+import org.apache.axis2.databinding.types.Time;
+import org.apache.axis2.databinding.types.Token;
+import org.apache.axis2.databinding.types.URI;
+import org.apache.axis2.databinding.types.UnsignedByte;
+import org.apache.axis2.databinding.types.UnsignedInt;
+import org.apache.axis2.databinding.types.UnsignedLong;
+import org.apache.axis2.databinding.types.UnsignedShort;
+import org.apache.axis2.databinding.types.Year;
+import org.apache.axis2.databinding.types.YearMonth;
+import org.apache.axiom.om.util.Base64;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java
Wed Dec 20 09:32:36 2006
@@ -1,15 +1,12 @@
 package org.apache.axis2.databinding.utils.reader;
 
-import org.apache.axis2.databinding.utils.Constants;
-import org.apache.axis2.databinding.utils.ConverterUtil;
-import org.apache.axis2.util.Base64;
-
-import javax.xml.namespace.QName;
+import javax.activation.DataHandler;
 import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.XMLStreamException;
+import javax.xml.namespace.QName;
 import javax.xml.stream.Location;
-import javax.activation.DataHandler;
-import java.io.InputStream;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.axis2.databinding.utils.ConverterUtil;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *

Modified: webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java
Wed Dec 20 09:32:36 2006
@@ -1,35 +1,35 @@
 package org.apache.axis2.databinding.utils.reader;
 
-import org.custommonkey.xmlunit.XMLTestCase;
-import org.apache.axis2.util.StreamWrapper;
-import org.apache.axis2.util.Base64;
-import org.apache.axis2.databinding.utils.Constants;
-import org.apache.axis2.databinding.ADBBean;
-import org.apache.axiom.om.OMFactory;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.axiom.attachments.ByteArrayDataSource;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.impl.serialize.StreamingOMSerializer;
-import org.apache.axiom.attachments.ByteArrayDataSource;
-import org.xml.sax.SAXException;
+import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axis2.databinding.ADBBean;
+import org.apache.axis2.databinding.utils.Constants;
+import org.apache.axiom.om.util.Base64;
+import org.apache.axis2.util.StreamWrapper;
+import org.custommonkey.xmlunit.XMLTestCase;
 import org.w3c.dom.Document;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.activation.DataHandler;
-import java.util.ArrayList;
-import java.util.List;
-import java.io.IOException;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
+import org.xml.sax.SAXException;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/rahas/RahasSAMLTokenUTForHoKV1205Test.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/rahas/RahasSAMLTokenUTForHoKV1205Test.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/rahas/RahasSAMLTokenUTForHoKV1205Test.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/rahas/RahasSAMLTokenUTForHoKV1205Test.java
Wed Dec 20 09:32:36 2006
@@ -16,10 +16,12 @@
 
 package org.apache.rahas;
 
+import javax.xml.namespace.QName;
+
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
-import org.apache.axis2.util.Base64;
+import org.apache.axiom.om.util.Base64;
 import org.apache.neethi.Policy;
 import org.apache.rampart.handler.config.InflowConfiguration;
 import org.apache.rampart.handler.config.OutflowConfiguration;
@@ -27,8 +29,6 @@
 import org.apache.ws.security.WSConstants;
 import org.apache.ws.security.util.WSSecurityUtil;
 import org.opensaml.XML;
-
-import javax.xml.namespace.QName;
 
 public class RahasSAMLTokenUTForHoKV1205Test extends TestClient {
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
Wed Dec 20 09:32:36 2006
@@ -28,7 +28,7 @@
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.axis2.util.SessionUtils;
-import org.apache.axis2.util.UUIDGenerator;
+import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axis2.util.threadpool.ThreadFactory;
 import org.apache.axis2.util.threadpool.ThreadPool;
 import org.apache.commons.logging.Log;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
Wed Dec 20 09:32:36 2006
@@ -41,7 +41,7 @@
 import org.apache.axis2.transport.http.util.RESTUtil;
 import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.util.MessageContextBuilder;
-import org.apache.axis2.util.UUIDGenerator;
+import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.axiom.om.impl.builder.StAXBuilder;
@@ -543,7 +543,7 @@
     private boolean isRESTRequest(HttpServletRequest request) {
         String contentType = request.getContentType();
         String soapActionHeader = request.getHeader(HTTPConstants.HEADER_SOAP_ACTION);
-
+//possible bug.. 
         return ((soapActionHeader == null) ||
                 (contentType != null && contentType.indexOf(HTTPConstants.MEDIA_TYPE_X_WWW_FORM)
> -1));
     }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpServiceProcessor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpServiceProcessor.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpServiceProcessor.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpServiceProcessor.java
Wed Dec 20 09:32:36 2006
@@ -45,7 +45,7 @@
 import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.axis2.util.MessageContextBuilder;
-import org.apache.axis2.util.UUIDGenerator;
+import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.http.Header;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SessionManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SessionManager.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SessionManager.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SessionManager.java
Wed Dec 20 09:32:36 2006
@@ -38,7 +38,7 @@
 import org.apache.axis2.context.ServiceGroupContext;
 import org.apache.axis2.context.SessionContext;
 import org.apache.axis2.engine.DependencyManager;
-import org.apache.axis2.util.UUIDGenerator;
+import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java
Wed Dec 20 09:32:36 2006
@@ -21,7 +21,7 @@
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.engine.AxisEngine;
-import org.apache.axis2.util.UUIDGenerator;
+import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Base64.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Base64.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Base64.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Base64.java Wed
Dec 20 09:32:36 2006
@@ -20,275 +20,9 @@
 import java.io.OutputStream;
 import java.io.Writer;
 
-public class Base64 {
-    private static final char[] S_BASE64CHAR = {'A', 'B', 'C', 'D', 'E', 'F',
-                                                'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S',
-                                                'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b',
'c', 'd', 'e', 'f',
-                                                'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's',
-                                                't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1',
'2', '3', '4', '5',
-                                                '6', '7', '8', '9', '+', '/'};
 
-    private static final char S_BASE64PAD = '=';
-
-    private static final byte[] S_DECODETABLE = new byte[128];
-
-    static {
-        for (int i = 0; i < S_DECODETABLE.length; i++)
-            S_DECODETABLE[i] = Byte.MAX_VALUE; // 127
-        for (int i = 0; i < S_BASE64CHAR.length; i++)
-                // 0 to 63
-            S_DECODETABLE[S_BASE64CHAR[i]] = (byte) i;
-    }
-
-    private static int decode0(char[] ibuf, byte[] obuf, int wp) {
-        int outlen = 3;
-        if (ibuf[3] == S_BASE64PAD)
-            outlen = 2;
-        if (ibuf[2] == S_BASE64PAD)
-            outlen = 1;
-        int b0 = S_DECODETABLE[ibuf[0]];
-        int b1 = S_DECODETABLE[ibuf[1]];
-        int b2 = S_DECODETABLE[ibuf[2]];
-        int b3 = S_DECODETABLE[ibuf[3]];
-        switch (outlen) {
-            case 1:
-                obuf[wp] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
-                return 1;
-            case 2:
-                obuf[wp++] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
-                obuf[wp] = (byte) (b1 << 4 & 0xf0 | b2 >> 2 & 0xf);
-                return 2;
-            case 3:
-                obuf[wp++] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
-                obuf[wp++] = (byte) (b1 << 4 & 0xf0 | b2 >> 2 & 0xf);
-                obuf[wp] = (byte) (b2 << 6 & 0xc0 | b3 & 0x3f);
-                return 3;
-            default:
-                throw new RuntimeException("internalError00");
-        }
-    }
-
-    /**
-     *  
-     */
-    public static byte[] decode(char[] data, int off, int len) {
-        char[] ibuf = new char[4];
-        int ibufcount = 0;
-        byte[] obuf = new byte[len / 4 * 3 + 3];
-        int obufcount = 0;
-        for (int i = off; i < off + len; i++) {
-            char ch = data[i];
-            if (ch == S_BASE64PAD || ch < S_DECODETABLE.length
-                    && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
-                ibuf[ibufcount++] = ch;
-                if (ibufcount == ibuf.length) {
-                    ibufcount = 0;
-                    obufcount += decode0(ibuf, obuf, obufcount);
-                }
-            }
-        }
-        if (obufcount == obuf.length)
-            return obuf;
-        byte[] ret = new byte[obufcount];
-        System.arraycopy(obuf, 0, ret, 0, obufcount);
-        return ret;
-    }
-
-    /**
-     *  
-     */
-    public static byte[] decode(String data) {
-        char[] ibuf = new char[4];
-        int ibufcount = 0;
-        byte[] obuf = new byte[data.length() / 4 * 3 + 3];
-        int obufcount = 0;
-        for (int i = 0; i < data.length(); i++) {
-            char ch = data.charAt(i);
-            if (ch == S_BASE64PAD || ch < S_DECODETABLE.length
-                    && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
-                ibuf[ibufcount++] = ch;
-                if (ibufcount == ibuf.length) {
-                    ibufcount = 0;
-                    obufcount += decode0(ibuf, obuf, obufcount);
-                }
-            }
-        }
-        if (obufcount == obuf.length)
-            return obuf;
-        byte[] ret = new byte[obufcount];
-        System.arraycopy(obuf, 0, ret, 0, obufcount);
-        return ret;
-    }
-
-    /**
-     *  
-     */
-    public static void decode(char[] data, int off, int len,
-                              OutputStream ostream) throws IOException {
-        char[] ibuf = new char[4];
-        int ibufcount = 0;
-        byte[] obuf = new byte[3];
-        for (int i = off; i < off + len; i++) {
-            char ch = data[i];
-            if (ch == S_BASE64PAD || ch < S_DECODETABLE.length
-                    && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
-                ibuf[ibufcount++] = ch;
-                if (ibufcount == ibuf.length) {
-                    ibufcount = 0;
-                    int obufcount = decode0(ibuf, obuf, 0);
-                    ostream.write(obuf, 0, obufcount);
-                }
-            }
-        }
-    }
-
-    /**
-     *  
-     */
-    public static void decode(String data, OutputStream ostream)
-            throws IOException {
-        char[] ibuf = new char[4];
-        int ibufcount = 0;
-        byte[] obuf = new byte[3];
-        for (int i = 0; i < data.length(); i++) {
-            char ch = data.charAt(i);
-            if (ch == S_BASE64PAD || ch < S_DECODETABLE.length
-                    && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
-                ibuf[ibufcount++] = ch;
-                if (ibufcount == ibuf.length) {
-                    ibufcount = 0;
-                    int obufcount = decode0(ibuf, obuf, 0);
-                    ostream.write(obuf, 0, obufcount);
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns base64 representation of specified byte array.
-     */
-    public static String encode(byte[] data) {
-        return encode(data, 0, data.length);
-    }
-
-    /**
-     * Returns base64 representation of specified byte array.
-     */
-    public static String encode(byte[] data, int off, int len) {
-        if (len <= 0)
-            return "";
-        char[] out = new char[len / 3 * 4 + 4];
-        int rindex = off;
-        int windex = 0;
-        int rest = len - off;
-        while (rest >= 3) {
-            int i = ((data[rindex] & 0xff) << 16)
-                    + ((data[rindex + 1] & 0xff) << 8)
-                    + (data[rindex + 2] & 0xff);
-            out[windex++] = S_BASE64CHAR[i >> 18];
-            out[windex++] = S_BASE64CHAR[(i >> 12) & 0x3f];
-            out[windex++] = S_BASE64CHAR[(i >> 6) & 0x3f];
-            out[windex++] = S_BASE64CHAR[i & 0x3f];
-            rindex += 3;
-            rest -= 3;
-        }
-        if (rest == 1) {
-            int i = data[rindex] & 0xff;
-            out[windex++] = S_BASE64CHAR[i >> 2];
-            out[windex++] = S_BASE64CHAR[(i << 4) & 0x3f];
-            out[windex++] = S_BASE64PAD;
-            out[windex++] = S_BASE64PAD;
-        } else if (rest == 2) {
-            int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff);
-            out[windex++] = S_BASE64CHAR[i >> 10];
-            out[windex++] = S_BASE64CHAR[(i >> 4) & 0x3f];
-            out[windex++] = S_BASE64CHAR[(i << 2) & 0x3f];
-            out[windex++] = S_BASE64PAD;
-        }
-        return new String(out, 0, windex);
-    }
-
-    /**
-     * Outputs base64 representation of the specified byte array to a byte
-     * stream.
-     */
-    public static void encode(byte[] data, int off, int len,
-                              OutputStream ostream) throws IOException {
-        if (len <= 0)
-            return;
-        byte[] out = new byte[4];
-        int rindex = off;
-        int rest = len - off;
-        while (rest >= 3) {
-            int i = ((data[rindex] & 0xff) << 16)
-                    + ((data[rindex + 1] & 0xff) << 8)
-                    + (data[rindex + 2] & 0xff);
-            out[0] = (byte) S_BASE64CHAR[i >> 18];
-            out[1] = (byte) S_BASE64CHAR[(i >> 12) & 0x3f];
-            out[2] = (byte) S_BASE64CHAR[(i >> 6) & 0x3f];
-            out[3] = (byte) S_BASE64CHAR[i & 0x3f];
-            ostream.write(out, 0, 4);
-            rindex += 3;
-            rest -= 3;
-        }
-        if (rest == 1) {
-            int i = data[rindex] & 0xff;
-            out[0] = (byte) S_BASE64CHAR[i >> 2];
-            out[1] = (byte) S_BASE64CHAR[(i << 4) & 0x3f];
-            out[2] = (byte) S_BASE64PAD;
-            out[3] = (byte) S_BASE64PAD;
-            ostream.write(out, 0, 4);
-        } else if (rest == 2) {
-            int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff);
-            out[0] = (byte) S_BASE64CHAR[i >> 10];
-            out[1] = (byte) S_BASE64CHAR[(i >> 4) & 0x3f];
-            out[2] = (byte) S_BASE64CHAR[(i << 2) & 0x3f];
-            out[3] = (byte) S_BASE64PAD;
-            ostream.write(out, 0, 4);
-        }
-    }
-
-    /**
-     * Outputs base64 representation of the specified byte array to a character
-     * stream.
-     */
-    public static void encode(byte[] data, int off, int len, Writer writer)
-            throws IOException {
-        if (len <= 0)
-            return;
-        char[] out = new char[4];
-        int rindex = off;
-        int rest = len - off;
-        int output = 0;
-        while (rest >= 3) {
-            int i = ((data[rindex] & 0xff) << 16)
-                    + ((data[rindex + 1] & 0xff) << 8)
-                    + (data[rindex + 2] & 0xff);
-            out[0] = S_BASE64CHAR[i >> 18];
-            out[1] = S_BASE64CHAR[(i >> 12) & 0x3f];
-            out[2] = S_BASE64CHAR[(i >> 6) & 0x3f];
-            out[3] = S_BASE64CHAR[i & 0x3f];
-            writer.write(out, 0, 4);
-            rindex += 3;
-            rest -= 3;
-            output += 4;
-            if (output % 76 == 0)
-                writer.write("\n");
-        }
-        if (rest == 1) {
-            int i = data[rindex] & 0xff;
-            out[0] = S_BASE64CHAR[i >> 2];
-            out[1] = S_BASE64CHAR[(i << 4) & 0x3f];
-            out[2] = S_BASE64PAD;
-            out[3] = S_BASE64PAD;
-            writer.write(out, 0, 4);
-        } else if (rest == 2) {
-            int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff);
-            out[0] = S_BASE64CHAR[i >> 10];
-            out[1] = S_BASE64CHAR[(i >> 4) & 0x3f];
-            out[2] = S_BASE64CHAR[(i << 2) & 0x3f];
-            out[3] = S_BASE64PAD;
-            writer.write(out, 0, 4);
-        }
-    }
+/**
+ * @deprecated
+ */
+public class Base64 extends org.apache.axiom.om.util.Base64{
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java
Wed Dec 20 09:32:36 2006
@@ -25,6 +25,7 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.SOAPEnvelope;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/UUIDGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/UUIDGenerator.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/UUIDGenerator.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/UUIDGenerator.java
Wed Dec 20 09:32:36 2006
@@ -23,82 +23,8 @@
 import java.util.Date;
 import java.util.Random;
 
-public class UUIDGenerator {
-    /**
-     * This class will give UUIDs for axis2.
-     */
-
-    private static String baseUUID = null;
-    private static long incrementingValue = 0;
-
-
-    private static Random myRand = null;
-
-    /**
-     * MD5 a random string with localhost/date etc will return 128 bits
-     * construct a string of 18 characters from those bits.
-     *
-     * @return string
-     */
-    public static String getUUID() {
-        if (baseUUID == null) {
-            baseUUID = getInitialUUID();
-            baseUUID = "urn:uuid:" + baseUUID;
-        }
-        if(++incrementingValue >= Long.MAX_VALUE){
-            incrementingValue = 0;
-        }
-        return  baseUUID + (System.currentTimeMillis() + incrementingValue);
-    }
-
-    protected static String getInitialUUID() {
-        if (myRand == null) {
-            myRand = new Random();
-        }
-        long rand = myRand.nextLong();
-        String sid;
-        try {
-            sid = InetAddress.getLocalHost().toString();
-        } catch (UnknownHostException e) {
-            sid = Thread.currentThread().getName();
-        }
-        StringBuffer sb = new StringBuffer();
-        sb.append(sid);
-        sb.append(":");
-        sb.append(Long.toString(rand));
-        MessageDigest md5 = null;
-        try {
-            md5 = MessageDigest.getInstance("MD5");
-        } catch (NoSuchAlgorithmException e) {
-            //System.out.println("Error: " + e);
-            //todo heve to be properly handle
-        }
-        md5.update(sb.toString().getBytes());
-        byte[] array = md5.digest();
-        StringBuffer sb2 = new StringBuffer();
-        for (int j = 0; j < array.length; ++j) {
-            int b = array[j] & 0xFF;
-            sb2.append(Integer.toHexString(b));
-        }
-        int begin = myRand.nextInt();
-        if (begin < 0) begin = begin * -1;
-        begin = begin % 8;
-        return sb2.toString().substring(begin, begin + 18).toUpperCase();
-    }
-
-    public static void main(String[] args) {
-        long startTime = new Date().getTime();
-        for (int i = 0; i < 100000; i++) {
-            UUIDGenerator.getInitialUUID();
-        }
-        long endTime = new Date().getTime();
-        System.out.println("getInitialUUID Difference = " + (endTime - startTime));
-
-        startTime = new Date().getTime();
-        for (int i = 0; i < 100000; i++) {
-            UUIDGenerator.getUUID();
-        }
-        endTime = new Date().getTime();
-        System.out.println("getUUID Difference = " + (endTime - startTime));
-    }
+/**
+ * @deprecated
+ */
+public class UUIDGenerator extends org.apache.axiom.om.util.UUIDGenerator{
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java Wed Dec
20 09:32:36 2006
@@ -23,6 +23,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.context.ConfigurationContext;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/XMLUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/XMLUtils.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/XMLUtils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/XMLUtils.java Wed
Dec 20 09:32:36 2006
@@ -23,6 +23,7 @@
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.util.Base64;
 import org.apache.axiom.om.util.StAXUtils;
 import org.w3c.dom.Attr;
 import org.w3c.dom.CharacterData;

Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/context/OperationContextTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/context/OperationContextTest.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/context/OperationContextTest.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/context/OperationContextTest.java
Wed Dec 20 09:32:36 2006
@@ -26,7 +26,7 @@
 import org.apache.axis2.description.TransportInDescription;
 import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.util.UUIDGenerator;
+import org.apache.axiom.om.util.UUIDGenerator;
 
 import javax.xml.namespace.QName;
 

Modified: webservices/axis2/trunk/java/modules/rahas/src/org/apache/rahas/client/STSClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rahas/src/org/apache/rahas/client/STSClient.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/rahas/src/org/apache/rahas/client/STSClient.java
(original)
+++ webservices/axis2/trunk/java/modules/rahas/src/org/apache/rahas/client/STSClient.java
Wed Dec 20 09:32:36 2006
@@ -31,7 +31,7 @@
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.OutInAxisOperation;
-import org.apache.axis2.util.UUIDGenerator;
+import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.neethi.Assertion;

Modified: webservices/axis2/trunk/java/modules/rahas/src/org/apache/rahas/impl/TokenIssuerUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rahas/src/org/apache/rahas/impl/TokenIssuerUtil.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/rahas/src/org/apache/rahas/impl/TokenIssuerUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/rahas/src/org/apache/rahas/impl/TokenIssuerUtil.java
Wed Dec 20 09:32:36 2006
@@ -15,12 +15,15 @@
  */
 package org.apache.rahas.impl;
 
+import java.security.SecureRandom;
+
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.Base64;
+import org.apache.rahas.RahasConstants;
 import org.apache.rahas.RahasData;
 import org.apache.rahas.Token;
 import org.apache.rahas.TrustException;
 import org.apache.rahas.TrustUtil;
-import org.apache.rahas.RahasConstants;
 import org.apache.ws.security.WSConstants;
 import org.apache.ws.security.WSSecurityException;
 import org.apache.ws.security.components.crypto.Crypto;
@@ -29,12 +32,9 @@
 import org.apache.ws.security.conversation.dkalgo.P_SHA1;
 import org.apache.ws.security.message.WSSecEncryptedKey;
 import org.apache.ws.security.util.WSSecurityUtil;
-import org.apache.axis2.util.Base64;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import java.security.SecureRandom;
-
 /**
  * 
  */
@@ -142,7 +142,7 @@
                 OMElement binSecElem = TrustUtil.createBinarySecretElement(wstVersion,
                                                                            reqProofTokElem,
                                                                            null);
-                binSecElem.setText(org.apache.axis2.util.Base64.encode(secret));
+                binSecElem.setText(Base64.encode(secret));
                 token.setSecret(secret);
             } else {
                 throw new IllegalArgumentException(config.proofKeyType);

Modified: webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingSubscriptionProcessor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingSubscriptionProcessor.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingSubscriptionProcessor.java
(original)
+++ webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingSubscriptionProcessor.java
Wed Dec 20 09:32:36 2006
@@ -38,7 +38,7 @@
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.databinding.types.Duration;
 import org.apache.axis2.databinding.utils.ConverterUtil;
-import org.apache.axis2.util.UUIDGenerator;
+import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.savan.SavanConstants;
 import org.apache.savan.SavanException;
 import org.apache.savan.SavanMessageContext;

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/conversation/STSRequester.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/conversation/STSRequester.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/conversation/STSRequester.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/conversation/STSRequester.java
Wed Dec 20 09:32:36 2006
@@ -16,6 +16,8 @@
 
 package org.apache.rampart.conversation;
 
+import javax.xml.namespace.QName;
+
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
 import org.apache.axis2.AxisFault;
@@ -26,7 +28,7 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.OutInAxisOperation;
 import org.apache.axis2.description.Parameter;
-import org.apache.axis2.util.Base64;
+import org.apache.axiom.om.util.Base64;
 import org.apache.rahas.RahasConstants;
 import org.apache.rahas.TrustException;
 import org.apache.rahas.TrustUtil;
@@ -36,8 +38,6 @@
 import org.apache.ws.security.conversation.ConversationConstants;
 import org.apache.ws.security.util.WSSecurityUtil;
 import org.w3c.dom.Element;
-
-import javax.xml.namespace.QName;
 
 /**
  * @deprecated

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/conversation/Util.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/conversation/Util.java?view=diff&rev=489153&r1=489152&r2=489153
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/conversation/Util.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/conversation/Util.java
Wed Dec 20 09:32:36 2006
@@ -17,7 +17,7 @@
 package org.apache.rampart.conversation;
 
 import org.apache.axiom.om.OMElement;
-import org.apache.axis2.util.Base64;
+import org.apache.axiom.om.util.Base64;
 import org.apache.axis2.util.Loader;
 import org.apache.rahas.RahasConstants;
 import org.apache.rahas.Token;



---------------------------------------------------------------------
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