|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
An interface representing a multipart message. This is a subinterface of Message which contains methods to add and get MessageParts. 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. Additional 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 of each MessagePart are copied before the send message returns. Changes to the MessagePart contents after send must not appear in the transmitted message.
| Method Summary | ||
boolean |
addAddress(String type,
String address)
Adds an address to the multipart message. |
|
void |
addMessagePart(MessagePart part)
Attaches a MessagePart to the multipart message |
|
String |
getAddress()
Returns the “from” address associated with this message, e.g. address of the sender. |
|
String[] |
getAddresses(String type)
Gets the addresses of the multipart message of the specified type. |
|
String |
getHeader(String headerField)
Gets the content of the specific header field of the multipart message. |
|
MessagePart |
getMessagePart(String contentID)
This method returns a MessagePart from the message that matches the content-id passed as a parameter |
|
MessagePart[] |
getMessageParts()
Returns an array of all MessageParts of this message |
|
String |
getStartContentId()
Returns the contentId of the start MessagePart. |
|
String |
getSubject()
Gets the subject of the multipart message. |
|
boolean |
removeAddress(String type,
String address)
Removes an address from the multipart message. |
|
void |
removeAddresses()
Removes all addresses of types “to”, “cc”, and bcc“ from the multipart message. |
|
void |
removeAddresses(String type)
Removes all addresses of the specified type from the multipart message. |
|
boolean |
removeMessagePart(MessagePart part)
Removes a MessagePart from the multipart message |
|
boolean |
removeMessagePartId(String contentID)
Removes a MessagePart with the specific contentID from the multipart message |
|
boolean |
removeMessagePartLocation(String contentLocation)
Removes MessageParts with the specific content location from the multipart message. |
|
void |
setAddress(String addr)
Sets the “to” address associated with this message. |
|
void |
setHeader(String headerField,
String headerValue)
Sets the specific header of the multipart message. |
|
void |
setStartContentId(String contentId)
Sets the Content-ID of the start MessagePart of a multipart related message. |
|
void |
setSubject(String subject)
Sets the Subject of the multipart message. |
|
| Methods inherited from interface javax.wireless.messaging.Message |
getTimestamp |
| Method Detail |
public boolean addAddress(String type, String address)
type - the address type (“to”, “cc” or “bcc”) as a String. Each message can have none or multiple
“to”, “cc” and “bcc” addresses. Each address is added separately. The type is not case sensitive. The
implementation of MessageConnection.send() makes sure that the “from” address is set correctly.address - the address as a StringIllegalArgumentException - - if type is none of “to”, “cc”, or “bcc” or if address is not valid.public void addMessagePart(MessagePart part) throws SizeExceededException
part - MessagePart to addIllegalArgumentException - - if the Content-ID of the MessagePart conflicts with a
Content-ID of a MessagePart already contained in this MultipartMessage. The Content-IDs must be unique
within a MultipartMessage.NullPointerException - - if the parameter is nullSizeExceededException - - if it’s not possible to attach the MessagePart.public String getAddress()
public String[] getAddresses(String type)
type - “to”, “cc”, “bcc” or “from”public String getHeader(String headerField)
headerField - the name of the header field as a StringSecurityException - - if the access to specified header field is restrictedIllegalArgumentException - - if headerField is unknownpublic MessagePart getMessagePart(String contentID)
contentID - the content-id for the MessagePart to be returnedNullPointerException - - if the parameter is nullpublic MessagePart[] getMessageParts()
public String getStartContentId()
public String getSubject()
public boolean removeAddress(String type, String address)
type - the address type (“to”, “cc”, or “bcc”) as a String.address - the address as a StringNullPointerException - - if type is nullIllegalArgumentException - - if type is none of “to”, “cc”, or “bcc”public void removeAddresses()
public void removeAddresses(String type)
type - the address type (“to”, “cc”, or “bcc”) as a String.NullPointerException - - if type is nullIllegalArgumentException - - if type is none of “to”, “cc”, or “bcc”public boolean removeMessagePart(MessagePart part)
part - MessagePart to deleteNullPointerException - - if the parameter is nullpublic boolean removeMessagePartId(String contentID)
contentID - identifiers which MessagePart must be deleted.NullPointerException - - if the parameter is nullpublic boolean removeMessagePartLocation(String contentLocation)
contentLocation - content location (file name) of the MessagePartNullPointerException - - if the parameter is nullpublic void setAddress(String addr)
addr - address for the messageIllegalArgumentException - - if address is not valid.public void setHeader(String headerField, String headerValue)
headerField - the name of the header field as a StringheaderValue - the value of the header as a StringIllegalArgumentException - - if headerField is unknown, or if headerValue is not correct (depends on headerField!)NullPointerException - - if headerField is nullSecurityException - - if the access to specified header field is restrictedpublic void setStartContentId(String contentId)
contentId - as a StringIllegalArgumentException - - if contentId is none of the added MessageParts objects matches the contentIdpublic void setSubject(String subject)
subject - the message subject as a String
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2007 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.