KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > Part


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.axis;
18
19
20 /**
21  * A part of a MIME message. Typically, in a MIME message there will be one
22  * <code>SOAPPart</code> containing the SOAP message, and 0 or more
23  * <code>AttachmentParts</code> instances containing each of the attachments.
24  */

25 public interface Part extends java.io.Serializable JavaDoc
26 {
27     /**
28      * Gets all the values of the <CODE>MimeHeader</CODE> object
29      * in this <CODE>SOAPPart</CODE> object that is identified by
30      * the given <CODE>String</CODE>.
31      * @param name the name of the header; example:
32      * "Content-Type"
33      * @return a <CODE>String</CODE> array giving all the values for
34      * the specified header
35      * @see #setMimeHeader(java.lang.String, java.lang.String) setMimeHeader(java.lang.String, java.lang.String)
36      */

37     public String JavaDoc[] getMimeHeader(String JavaDoc name);
38
39     // fixme: no explicit method to get the value associated with a header e.g.
40
// String getMimeHeader(header)
41
/**
42      * Add the specified MIME header, as per JAXM.
43      *
44      * @param header the MIME header name
45      * @param value the value associated with the header
46      */

47     public void addMimeHeader (String JavaDoc header, String JavaDoc value);
48
49     // fixme: what do we mean by location? Is this a URL, a locator in a stream,
50
// a place in the xml? something else?
51
/**
52      * Get the content location.
53      *
54      * @return a <code>String</code> giving the location
55      */

56     public String JavaDoc getContentLocation();
57
58     /**
59      * Set content location.
60      *
61      * @param loc the new location
62      */

63     public void setContentLocation(String JavaDoc loc);
64
65     // fixme: confusing docs - what's going on here?
66
/**
67      * Sets Content-Id of this part.
68      * already defined.
69      * @param newCid new Content-Id
70      */

71     public void setContentId(String JavaDoc newCid);
72
73     /**
74      * Get the content ID.
75      *
76      * @return the content ID
77      */

78     public String JavaDoc getContentId();
79
80     // for these 2 methods...
81
// fixme: is this an iterator over mime header names or values?
82
// fixme: why this API rather than just exposing the header names, and
83
// a method to fetch the value for a name?
84
/**
85      * Get an <code>Iterator</code> over all headers that match any item in
86      * <code>match</code>.
87      */

88     public java.util.Iterator JavaDoc getMatchingMimeHeaders( final String JavaDoc[] match);
89
90     /**
91      * Get all headers that do not match.
92      */

93     public java.util.Iterator JavaDoc getNonMatchingMimeHeaders( final String JavaDoc[] match);
94
95     // fixke: are content types MIME types or something else, or what?
96
/**
97      * Get the content type.
98      *
99      * @return the content type <code>String</code>
100      */

101     public String JavaDoc getContentType();
102
103     /**
104      * Content ID.
105      *
106      * @return the contentId reference value that should be used directly
107      * as an href in a SOAP element to reference this attachment.
108      * <B>Not part of JAX-RPC, JAX-M, SAAJ, etc. </B>
109      */

110     public String JavaDoc getContentIdRef();
111 }
112
113
Popular Tags