| com.sun.tck.wma.MultipartMessage
All known Subclasses: com.sun.tck.wma.mms.MultipartObject,
MultipartMessage | public interface MultipartMessage extends Message(Code) | | An interface representing a multipart message. This is a subinterface of
Message which contains methods to add and get
MessagePart s. The interface also allows to specify the subject
of the message. The basic methods for manipulating the address portion of
the message are inherited from Message . Additionally, this
interface defines methods for adding and removing addresses to/from the
"to", "cc" or "bcc" fields. Furthermore it offers methods to get and set
special header fields of the message. The contents of the MultipartMessage
are assembled during the invocation of the MessageConnection.send() method.
The contents of each MessagePart are copied before the send message returns.
Changes to the MessagePart contents after send must not appear in the
transmitted message.
since: WMA 2.0 |
addAddress | boolean addAddress(java.lang.String type, java.lang.String address)(Code) | | Adds an address to the multipart message.
Parameters: type - the adress type ("to", "cc" or "bcc") as a String . Each message can have none or multiple "to","cc" and "bcc" addresses. Eash address is added separately. Themethod is not case sensitive. The implementation of MessageConnection.send() makes sure that the "from"address is set correctly. Parameters: address - the address as a String true if it was possible to add the address, elsefalse throws: java.lang.IllegalArgumentException - if type is none of "to", "cc",or "bcc" or if address is not valid. See Also: MultipartMessage.setAddress(String) |
getAddress | java.lang.String getAddress()(Code) | | Returns the "from" address associated with this message, e.g. address of
the sender. If the message is a newly created message, e.g. not a
received one, then the first "to" address is returned.
Returns null if the "from" or "to" address for the
message, dependent on the case, are not set.
Note: This design allows sending responses to a received message easily
by reusing the same Message object and just replacing the
payload. The address field can normally be kept untouched (unless the
used messaging protocol requires some special handling of the address).
the "from" or "to" address of this message, or null if the address that is expected as a result of this method is notset See Also: MultipartMessage.setAddress(String) |
getAddresses | java.lang.String[] getAddresses(java.lang.String type)(Code) | | Gets the addresses of the multipart message of the specified type (e.g.
"to", "cc", "bcc" or "from") as String . The method is not
case sensitive.
Parameters: type - the type of address list to return the addresses as a String array or null if this value is not present. |
getHeader | java.lang.String getHeader(java.lang.String headerField)(Code) | | Gets the content of the specific header field of the multipart message.
Parameters: headerField - the name of the header field as a String the content of the specified header field as a String or null of the specified headerfield is not present. throws: SecurityException - if the access to specified header field is restricted throws: IllegalArgumentException - if headerField is unknown See Also: Appendix See Also: D for known headerFields See Also: MultipartMessage.setHeader |
getMessagePart | MessagePart getMessagePart(java.lang.String contentID)(Code) | | This method returns a MessagePart from the message that
matches the content-id passed as a parameter.
Parameters: contentID - the content-id for the MessagePart to bereturned MessagePart that matches the provided content-id ornull if there is no MessagePart in thismessage with the provided content-id throws: NullPointerException - if the parameter is null |
getMessageParts | MessagePart[] getMessageParts()(Code) | | Returns an array of all MessagePart s of this message.
array of MessagePart s, or null if noMessagePart s are available |
removeMessagePart | boolean removeMessagePart(MessagePart part)(Code) | | Removes a MessagePart from the multipart message.
Parameters: part - MessagePart to delete true if it was possible to remove theMessagePart , else false throws: NullPointerException - if the parameter is null |
removeMessagePartId | boolean removeMessagePartId(java.lang.String contentID)(Code) | | Removes a MessagePart with the specific
contentID from the multipart message.
Parameters: contentID - identifies which MessagePart must bedeleted. true if it was possible to remove theMessagePart , else false throws: NullPointerException - if the parameter is null |
removeMessagePartLocation | boolean removeMessagePartLocation(java.lang.String contentLocation)(Code) | | Removes MessagePart s with the specific content location
from the multipart message. All MessagePart s with the
specified contentLocation are removed.
Parameters: contentLocation - content location (file name) of the MessagePart true if it was possible to remove theMessagePart , else false throws: NullPointerException - if the parameter is null |
setStartContentId | void setStartContentId(java.lang.String contentId)(Code) | | Sets the Content-ID of the start MessagePart of
a multipart related message. The Content-ID may be set to
null . The StartContentId is set for the
MessagePart that is used to reference the other MessageParts of the
MultipartMessage for presentation or processing purposes.
Parameters: contentId - as a String throws: java.lang.IllegalArgumentException - if contentId isnone of the added MessagePart objects matches thecontentId See Also: MultipartMessage.getStartContentId() |
|
|