Package org.apache.axis.attachments
Interface Attachments
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
AttachmentsImpl
public interface Attachments extends java.io.SerializableAccess the Attachments of a Message. This interface essentially firewalls the rest of Axis from any dependencies on javax.activation.If javax.activation is not available, this is the *only* class that will be compiled in org.apache.axis.attachments.
- Author:
- Rob Jellinghaus (robj@unrealities.com), Rick Rineholt
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCIDprefixThe prefix used to assoc.static intSEND_TYPE_DEFAULTThe default attatchment type.static intSEND_TYPE_DIMEUse the DIME attatchment type.static intSEND_TYPE_MAXstatic intSEND_TYPE_MIMEUse the SOAP with MIME attatchment send type.static intSEND_TYPE_MTOMUse the MTOM attatchment type.static intSEND_TYPE_NONEUse the DIME attatchment type.static intSEND_TYPE_NOTSETUse the default attatchment send type.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PartaddAttachmentPart(Part newPart)Adds an existing attachment to this list.PartcreateAttachmentPart()Create a new attachment Part in this Message.PartcreateAttachmentPart(java.lang.Object part)Create a new attachment Part in this Message.voiddispose()dispose of the attachments and their files; do not use the object after making this call.PartgetAttachmentByReference(java.lang.String reference)This method should look at a refernce and determine if it is a CID: or url to look for attachment.intgetAttachmentCount()This is the number of attachments.java.util.CollectiongetAttachments()This method will return all attachments as a collection.java.util.IteratorgetAttachments(MimeHeaders headers)Retrieves all theAttachmentPartobjects that have header entries that match the specified headers.longgetContentLength()Get the content length of the stream.java.lang.StringgetContentType()Write the content to the stream.IncomingAttachmentStreamsgetIncomingAttachmentStreams()Once this method is called, attachments can only be accessed via the InputStreams.PartgetRootPart()From the complex stream return the SOAP part.intgetSendType()Determine if an object is to be treated as an attchment.booleanisAttachment(java.lang.Object value)Determine if an object is to be treated as an attchment.voidremoveAllAttachments()Removes allAttachmentPartobjects that have been added to thisSOAPMessageobject.PartremoveAttachmentPart(java.lang.String reference)This method uses getAttacmentByReference() to look for attachment.voidsetAttachmentParts(java.util.Collection parts)Will the attachments of this message to that of the colleciton.voidsetRootPart(Part newRoot)Sets the root part of this multipart blockvoidsetSendType(int sendtype)Set the format for attachments.voidwriteContentToStream(java.io.OutputStream os)Write the content to the stream.
-
-
-
Field Detail
-
SEND_TYPE_NOTSET
static final int SEND_TYPE_NOTSET
Use the default attatchment send type.- See Also:
- Constant Field Values
-
SEND_TYPE_MIME
static final int SEND_TYPE_MIME
Use the SOAP with MIME attatchment send type.- See Also:
- Constant Field Values
-
SEND_TYPE_DIME
static final int SEND_TYPE_DIME
Use the DIME attatchment type.- See Also:
- Constant Field Values
-
SEND_TYPE_MTOM
static final int SEND_TYPE_MTOM
Use the MTOM attatchment type.- See Also:
- Constant Field Values
-
SEND_TYPE_NONE
static final int SEND_TYPE_NONE
Use the DIME attatchment type.- See Also:
- Constant Field Values
-
SEND_TYPE_MAX
static final int SEND_TYPE_MAX
- See Also:
- Constant Field Values
-
SEND_TYPE_DEFAULT
static final int SEND_TYPE_DEFAULT
The default attatchment type. MIME- See Also:
- Constant Field Values
-
CIDprefix
static final java.lang.String CIDprefix
The prefix used to assoc. attachments as content-id- See Also:
- Constant Field Values
-
-
Method Detail
-
addAttachmentPart
Part addAttachmentPart(Part newPart) throws AxisFault
Adds an existing attachment to this list. Note: Passed part will be bound to this message.- Parameters:
newPart- new part to add- Returns:
- Part old attachment with the same Content-ID, or null.
- Throws:
AxisFault
-
removeAttachmentPart
Part removeAttachmentPart(java.lang.String reference) throws AxisFault
This method uses getAttacmentByReference() to look for attachment. If attachment has been found, it will be removed from the list, and returned to the user.- Parameters:
reference- The reference that referers to an attachment.- Returns:
- The part associated with the removed attachment, or null.
- Throws:
AxisFault
-
removeAllAttachments
void removeAllAttachments()
Removes allAttachmentPartobjects that have been added to thisSOAPMessageobject.This method does not touch the SOAP part.
-
getAttachmentByReference
Part getAttachmentByReference(java.lang.String reference) throws AxisFault
This method should look at a refernce and determine if it is a CID: or url to look for attachment.- Parameters:
reference- The reference in the xml that referers to an attachment.- Returns:
- The part associated with the attachment.
- Throws:
AxisFault
-
getAttachments
java.util.Collection getAttachments() throws AxisFaultThis method will return all attachments as a collection.- Returns:
- A collection of attachments.
- Throws:
AxisFault
-
getAttachments
java.util.Iterator getAttachments(MimeHeaders headers)
Retrieves all theAttachmentPartobjects that have header entries that match the specified headers. Note that a returned attachment could have headers in addition to those specified.- Parameters:
headers- aMimeHeadersobject containing the MIME headers for which to search- Returns:
- an iterator over all attachments that have a header that matches one of the given headers
-
createAttachmentPart
Part createAttachmentPart(java.lang.Object part) throws AxisFault
Create a new attachment Part in this Message. Will actually, and always, return an AttachmentPart.- Parameters:
part- The part that is referenced- Returns:
- a new attachment part
- Throws:
AxisFault
-
createAttachmentPart
Part createAttachmentPart() throws AxisFault
Create a new attachment Part in this Message. Will actually, and always, return an AttachmentPart.- Returns:
- a new attachment part
- Throws:
AxisFault
-
setAttachmentParts
void setAttachmentParts(java.util.Collection parts) throws AxisFaultWill the attachments of this message to that of the colleciton.- Parameters:
parts-- Throws:
AxisFault
-
getRootPart
Part getRootPart()
From the complex stream return the SOAP part.- Returns:
- will return the root part if the stream is supported, otherwise null.
-
setRootPart
void setRootPart(Part newRoot)
Sets the root part of this multipart block- Parameters:
newRoot- the new rootPart
-
getContentLength
long getContentLength() throws AxisFaultGet the content length of the stream.- Returns:
- the content length of
- Throws:
AxisFault
-
writeContentToStream
void writeContentToStream(java.io.OutputStream os) throws AxisFaultWrite the content to the stream.- Parameters:
os- the stream- Throws:
AxisFault
-
getContentType
java.lang.String getContentType() throws AxisFaultWrite the content to the stream.- Returns:
- the content type
- Throws:
AxisFault
-
getAttachmentCount
int getAttachmentCount()
This is the number of attachments.- Returns:
- the number of attachments
-
isAttachment
boolean isAttachment(java.lang.Object value)
Determine if an object is to be treated as an attchment.- Parameters:
value- the value that is to be determined if its an attachment.- Returns:
- True if value should be treated as an attchment.
-
setSendType
void setSendType(int sendtype)
Set the format for attachments.- Parameters:
sendtype- the format to send. SEND_TYPE_MIME for Multipart Releated Mail type attachments. SEND_TYPE_DIME for DIME type attachments.
-
getSendType
int getSendType()
Determine if an object is to be treated as an attchment.- Returns:
- SEND_TYPE_MIME, SEND_TYPE_DIME, SEND_TYPE_NOTSET
-
dispose
void dispose()
dispose of the attachments and their files; do not use the object after making this call.
-
getIncomingAttachmentStreams
IncomingAttachmentStreams getIncomingAttachmentStreams()
Once this method is called, attachments can only be accessed via the InputStreams. Any other access to the attachments collection (e.g. via getAttachments()) is prohibited and will cause a ConcurrentModificationException to be thrown.- Returns:
- All of the attachment streams.
-
-