whitlock    2003/03/18 06:49:00

  Modified:    java/src/org/apache/wsif/providers/soap/apacheaxis
                        WSIFAXISUtils.java WSIFOperation_ApacheAxis.java
                        MIMEHelper.java
               java/test/mime MimeTest.java Mime.java MimeImpl.java
  Added:       java/src/org/apache/wsif/attachments WSIFAttachmentPart.java
  Removed:     java/src/org/apache/wsif WSIFAttachmentPart.java
  Log:
  16993: move WSIFAttachmentPart
  
  Revision  Changes    Path
  1.4       +1 -1      
xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apacheaxis/WSIFAXISUtils.java
  
  Index: WSIFAXISUtils.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apacheaxis/WSIFAXISUtils.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WSIFAXISUtils.java        14 Mar 2003 11:41:40 -0000      1.3
  +++ WSIFAXISUtils.java        18 Mar 2003 14:48:59 -0000      1.4
  @@ -63,8 +63,8 @@
   import javax.xml.soap.SOAPException;
   
   import org.apache.axis.attachments.AttachmentPart;
  -import org.apache.wsif.WSIFAttachmentPart;
   import org.apache.wsif.WSIFException;
  +import org.apache.wsif.attachments.WSIFAttachmentPart;
   import org.apache.wsif.logging.Trc;
   
   /**
  
  
  
  1.80      +1 -1      
xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apacheaxis/WSIFOperation_ApacheAxis.java
  
  Index: WSIFOperation_ApacheAxis.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apacheaxis/WSIFOperation_ApacheAxis.java,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- WSIFOperation_ApacheAxis.java     18 Mar 2003 13:52:14 -0000      1.79
  +++ WSIFOperation_ApacheAxis.java     18 Mar 2003 14:48:59 -0000      1.80
  @@ -116,13 +116,13 @@
   import org.apache.axis.message.SOAPFaultElement;
   import org.apache.axis.message.SOAPHeaderElement;
   import org.apache.axis.transport.http.HTTPConstants;
  -import org.apache.wsif.WSIFAttachmentPart;
   import org.apache.wsif.WSIFConstants;
   import org.apache.wsif.WSIFCorrelationId;
   import org.apache.wsif.WSIFException;
   import org.apache.wsif.WSIFMessage;
   import org.apache.wsif.WSIFPort;
   import org.apache.wsif.WSIFResponseHandler;
  +import org.apache.wsif.attachments.WSIFAttachmentPart;
   import org.apache.wsif.base.WSIFDefaultOperation;
   import org.apache.wsif.logging.Trc;
   import org.apache.wsif.providers.ProviderUtils;
  
  
  
  1.5       +1 -1      
xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apacheaxis/MIMEHelper.java
  
  Index: MIMEHelper.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apacheaxis/MIMEHelper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MIMEHelper.java   7 Mar 2003 15:38:38 -0000       1.4
  +++ MIMEHelper.java   18 Mar 2003 14:49:00 -0000      1.5
  @@ -75,9 +75,9 @@
   import org.apache.axis.client.Call;
   import org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory;
   import org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory;
  -import org.apache.wsif.WSIFAttachmentPart;
   import org.apache.wsif.WSIFException;
   import org.apache.wsif.WSIFMessage;
  +import org.apache.wsif.attachments.WSIFAttachmentPart;
   import org.apache.wsif.logging.Trc;
   
   /**
  
  
  
  1.23      +1 -1      xml-axis-wsif/java/test/mime/MimeTest.java
  
  Index: MimeTest.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/mime/MimeTest.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- MimeTest.java     18 Mar 2003 13:52:14 -0000      1.22
  +++ MimeTest.java     18 Mar 2003 14:49:00 -0000      1.23
  @@ -81,7 +81,6 @@
   import junit.framework.TestSuite;
   
   import org.apache.axis.attachments.PlainTextDataSource;
  -import org.apache.wsif.WSIFAttachmentPart;
   import org.apache.wsif.WSIFConstants;
   import org.apache.wsif.WSIFException;
   import org.apache.wsif.WSIFMessage;
  @@ -89,6 +88,7 @@
   import org.apache.wsif.WSIFPort;
   import org.apache.wsif.WSIFService;
   import org.apache.wsif.WSIFServiceFactory;
  +import org.apache.wsif.attachments.WSIFAttachmentPart;
   import org.apache.wsif.util.WSIFPluggableProviders;
   import org.apache.wsif.util.WSIFProperties;
   import util.TestUtilities;
  
  
  
  1.12      +1 -1      xml-axis-wsif/java/test/mime/Mime.java
  
  Index: Mime.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/mime/Mime.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Mime.java 12 Mar 2003 11:42:24 -0000      1.11
  +++ Mime.java 18 Mar 2003 14:49:00 -0000      1.12
  @@ -61,7 +61,7 @@
   
   import javax.activation.DataHandler;
   
  -import org.apache.wsif.WSIFAttachmentPart;
  +import org.apache.wsif.attachments.WSIFAttachmentPart;
   
   public interface Mime {
       public String dataHandlerToString(DataHandler dh);
  
  
  
  1.16      +1 -1      xml-axis-wsif/java/test/mime/MimeImpl.java
  
  Index: MimeImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/mime/MimeImpl.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- MimeImpl.java     18 Mar 2003 13:52:14 -0000      1.15
  +++ MimeImpl.java     18 Mar 2003 14:49:00 -0000      1.16
  @@ -67,9 +67,9 @@
   import javax.activation.DataHandler;
   import javax.activation.FileDataSource;
   
  -import org.apache.wsif.WSIFAttachmentPart;
   import org.apache.wsif.WSIFConstants;
   import org.apache.wsif.WSIFMessage;
  +import org.apache.wsif.attachments.WSIFAttachmentPart;
   import org.apache.wsif.providers.java.WSIFOperation_Java;
   
   /**
  
  
  
  1.1                  
xml-axis-wsif/java/src/org/apache/wsif/attachments/WSIFAttachmentPart.java
  
  Index: WSIFAttachmentPart.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2002 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:  
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "WSIF" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written 
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation and was
   * originally based on software copyright (c) 2001, 2002, International
   * Business Machines, Inc., http://www.apache.org.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.wsif.attachments;
  
  import java.util.HashMap;
  import java.util.Iterator;
  import java.util.Map;
  
  import javax.activation.DataHandler;
  
  import org.apache.wsif.WSIFException;
  import org.apache.wsif.logging.Trc;
  
  /**
   * WSIFAttachmentPart is a MIME attachment that is described in a binding 
   * independent way. 
   * 
   * @author Mark Whitlock
   */
  public class WSIFAttachmentPart implements Cloneable /*,Serializable */ {
      private static final long serialVersionUID = 1L;
      private transient DataHandler dh;
      private Map properties;
  
      public WSIFAttachmentPart() {
          Trc.entry(this);
          this.dh = null;
          this.properties = new HashMap();
          Trc.exit();
      }
  
      public WSIFAttachmentPart(DataHandler dh) {
          Trc.entry(this, dh);
          this.dh = dh;
          this.properties = new HashMap();
          Trc.exit();
      }
  
      public WSIFAttachmentPart(DataHandler dh, Map properties)
          throws WSIFException {
          Trc.entry(this, dh, properties);
          validateProperties(properties);
          this.dh = dh;
          this.properties = properties;
          Trc.exit();
      }
  
      public void setProperty(String name, String value) throws WSIFException {
          Trc.entry(this, name, value);
          properties.put(name, value);
          Trc.exit();
      }
  
      public void setProperties(Map properties) throws WSIFException {
          Trc.entry(this, properties);
          validateProperties(properties);
          properties.putAll(properties);
          Trc.exit();
      }
  
      public String getProperty(String name) {
          Trc.entry(this, name);
          String value = (String) properties.get(name);
          Trc.exit(value);
          return value;
      }
  
      public boolean containsProperty(String name) {
          Trc.entry(this, name);
          boolean ok = properties.containsKey(name);
          Trc.exit(ok);
          return ok;
      }
  
      public Iterator getPropertyIterator() {
          Trc.entry(this);
          Iterator it = properties.keySet().iterator();
          Trc.exit(it);
          return it;
      }
  
      public void clearProperties() {
          Trc.entry(this);
          properties = new HashMap();
          Trc.exit();
      }
  
      public DataHandler getDataHandler() {
          Trc.entry(this);
          Trc.exit(dh);
          return dh;
      }
  
      public void setDataHandler(DataHandler dh) {
          Trc.entry(this, dh);
          this.dh = dh;
          Trc.exit();
      }
  
      private void validateProperties(Map properties) throws WSIFException {
          Trc.entry(this, properties);
          Iterator it = properties.keySet().iterator();
          while (it.hasNext()) {
              String next = (String) it.next();
              if (!(properties.get(next) instanceof String))
                  throw new WSIFException(
                      "Property " + next + " was not a String.");
          }
          Trc.exit();
      }
  
      public Object clone() throws CloneNotSupportedException {
          Trc.entry(this);
          DataHandler dh1 = new DataHandler(dh.getDataSource());
          HashMap properties1 = new HashMap(properties);
          WSIFAttachmentPart wap = null;
          try {
              wap = new WSIFAttachmentPart(dh1, properties1);
          } catch (WSIFException we) {
              Trc.exception(we);
              throw new CloneNotSupportedException(we.toString());
          }
          Trc.exit(wap);
          return wap;
      }
      
      //    /**
      //     * Override default deserialization
      //     */
      //    private void writeObject(ObjectOutputStream oos) throws IOException {
      //        Trc.entry(this, oos);
      //        oos.defaultWriteObject();
      //        writeOutDh(oos);
      //        oos.flush();
      //        Trc.exit();
      //    }
      //
      //    /**
      //     * Override default deserialization
      //     */
      //    private void readObject(ObjectInputStream ois)
      //        throws ClassNotFoundException, IOException {
      //        Trc.entry(this, ois);
      //        ois.defaultReadObject();
      //        dh = convertDh(ois.readObject());
      //        Trc.exit();
      //    }
      //
      //    private DataHandler convertDh(Object o) {
      //        return null;
      //    }
      //
      //    private void writeOutDh(ObjectOutputStream oos) {
      //    }
  }
  
  
  

Reply via email to