/*
 * JBoss, the OpenSource EJB server
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package javax.xml.soap;

import java.util.Iterator;
import javax.activation.DataHandler;

/** A single attachment to a SOAPMessage object. A SOAPMessage object may
 * contain zero, one, or many AttachmentPart objects. Each AttachmentPart
 * object consists of two parts, application-specific content and associated
 * MIME headers. The MIME headers consists of name/value pairs that can be
 * used to identify and describe the content.
 * 
 * @author Scott.Stark@jboss.org
 * @version $Revision: 1.2.6.1 $
 */
public abstract class AttachmentPart
{
   private String contentId;
   private String contentLocation;
   private String contentType;

	public AttachmentPart()
   {
   }

	public abstract void addMimeHeader(String name, String value);
	public abstract void clearContent();
	public abstract Iterator getAllMimeHeaders();
	public abstract Object getContent() throws SOAPException;
	public abstract DataHandler getDataHandler() throws SOAPException;
	public abstract Iterator getMatchingMimeHeaders(String[] names);

   public abstract String[] getMimeHeader(String name);

	public abstract Iterator getNonMatchingMimeHeaders(String[] names);

	public abstract int getSize() throws SOAPException;
	public abstract void removeAllMimeHeaders();
	public abstract void removeMimeHeader(String name);
	public abstract void setContent(Object object, String contentType);
	public abstract void setDataHandler(DataHandler dataHandler);
	public abstract void setMimeHeader(String name, String value);

   public String getContentId()
   {
      return contentId;
   }

   public void setContentId(String contentId)
   {
      this.contentId = contentId;
   }

   public String getContentLocation()
   {
      return contentLocation;
   }

   public void setContentLocation(String contentLocation)
   {
      this.contentLocation = contentLocation;
   }

   public String getContentType()
   {
      return contentType;
   }

   public void setContentType(String contentType)
   {
      this.contentType = contentType;
   }
}
