net.sourceforge.jmmslib
Class MmsMessage

java.lang.Object
  extended by net.sourceforge.jmmslib.MmsMessage

public class MmsMessage
extends java.lang.Object

Represents an mms message.

This class is used to fill the field of an mms message and do some basic data validation.

The field required for the various type of mms messages are listed on the document WAP-209-MMSEncapsulation-20020105-a, avaiable at the Open Mobile Alliance web site.

Author:
Andrea Zito

Field Summary
static java.lang.String CHARSET_US_ASCII
           
static java.lang.String CHARSET_UTF8
           
static java.lang.String CTYPE_APPLICATION_MULTIPART_MIXED
           
static java.lang.String CTYPE_APPLICATION_MULTIPART_RELATED
           
static java.lang.String CTYPE_IMAGE
           
static java.lang.String CTYPE_IMAGE_GIF
           
static java.lang.String CTYPE_IMAGE_JPEG
           
static java.lang.String CTYPE_IMAGE_PNG
           
static java.lang.String CTYPE_IMAGE_TIFF
           
static java.lang.String CTYPE_IMAGE_VND_WAP_WBMP
           
static java.lang.String CTYPE_MULTIPART
           
static java.lang.String CTYPE_MULTIPART_MIXED
           
static java.lang.String CTYPE_TEXT
           
static java.lang.String CTYPE_TEXT_HTML
           
static java.lang.String CTYPE_TEXT_PLAIN
           
static java.lang.String CTYPE_TEXT_WML
           
static java.lang.String CTYPE_UNKNOWN
           
static java.lang.String MMS_ADDRESS_TYPE_IPV4
           
static java.lang.String MMS_ADDRESS_TYPE_IPV6
           
static java.lang.String MMS_ADDRESS_TYPE_MAIL
           
static java.lang.String MMS_ADDRESS_TYPE_MOBILE_NUMBER
           
static java.lang.String MMS_BCC
           
static java.lang.String MMS_CC
           
static java.lang.String MMS_CLASS
           
static java.lang.String MMS_CLASS_ADVERTISEMENT
           
static java.lang.String MMS_CLASS_AUTO
           
static java.lang.String MMS_CLASS_INFORMATIONAL
           
static java.lang.String MMS_CLASS_PERSONAL
           
static java.lang.String MMS_CONTENT_TYPE
           
static java.lang.String MMS_DATE
           
static java.lang.String MMS_DELIVERY_REPORT
           
static java.lang.String MMS_DELIVERY_REPORT_NO
           
static java.lang.String MMS_DELIVERY_REPORT_YES
           
static java.lang.String MMS_DELIVERY_TIME
           
static java.lang.String MMS_EXPIRY
           
static java.lang.String MMS_FROM
           
static java.lang.String MMS_MESSAGE_ID
           
static java.lang.String MMS_MESSAGE_TYPE
           
static java.lang.String MMS_MESSAGE_TYPE_SEND_CONF
           
static java.lang.String MMS_MESSAGE_TYPE_SEND_REQUEST
           
static java.lang.String MMS_PRIORITY
           
static java.lang.String MMS_PRIORITY_HIGH
           
static java.lang.String MMS_PRIORITY_LOW
           
static java.lang.String MMS_PRIORITY_NORMAL
           
static java.lang.String MMS_READ_REPLY
           
static java.lang.String MMS_READ_REPLY_NO
           
static java.lang.String MMS_READ_REPLY_YES
           
static java.lang.String MMS_RESPONSE_STATUS
           
static java.lang.String MMS_RESPONSE_STATUS_ERROR_CONTENT_NOT_ACCEPTED
           
static java.lang.String MMS_RESPONSE_STATUS_ERROR_MESSAGE_FORMAT_CORRUPT
           
static java.lang.String MMS_RESPONSE_STATUS_ERROR_MESSAGE_NOT_FOUND
           
static java.lang.String MMS_RESPONSE_STATUS_ERROR_NETWORK_PROBLEM
           
static java.lang.String MMS_RESPONSE_STATUS_ERROR_SENDING_ADDRESS_UNRESOLVED
           
static java.lang.String MMS_RESPONSE_STATUS_ERROR_SERVICE_DENIED
           
static java.lang.String MMS_RESPONSE_STATUS_ERROR_UNSPECIFIED
           
static java.lang.String MMS_RESPONSE_STATUS_ERROR_UNSUPPORTED_MESSAGE
           
static java.lang.String MMS_RESPONSE_STATUS_OK
           
static java.lang.String MMS_RESPONSE_TEXT
           
static java.lang.String MMS_SENDER_VISIBILITY
           
static java.lang.String MMS_SENDER_VISIBILITY_HIDE
           
static java.lang.String MMS_SENDER_VISIBILITY_SHOW
           
static java.lang.String MMS_SUBJECT
           
static java.lang.String MMS_TO
           
static java.lang.String MMS_TRANSACTION_ID
           
static java.lang.String MMS_VERSION
           
static java.lang.String MMS_VERSION_1
           
 
Constructor Summary
MmsMessage()
          Creates an MmsMessage object.
 
Method Summary
 void addMessaceBCC(java.lang.String receiver, java.lang.String addressType)
          Adds a message BCC
 void addMessageCC(java.lang.String receiver, java.lang.String addressType)
          Adds a message CC.
 void addMessageReceiver(java.lang.String receiver, java.lang.String addressType)
          Adds a message receiver.
 void addPart(MmsPart part)
          Add a part to the MMS message.
 java.util.List<java.lang.String> getMessageBCC()
          Return the BCCs list
 java.util.List<java.lang.String> getMessageCC()
          Return the CCs list.
 java.lang.String getMessageClass()
          Returns the message class.
 java.lang.String getMessageContentType()
          Returns the message content type.
 java.util.Date getMessageDate()
          Returns the date of the message.
 java.util.Date getMessageDeliveryTime()
          Returns the delivery time of the message.
 java.util.Date getMessageExpiryTime()
          Returns the message expiry time.
 java.lang.String getMessageID()
          Returns the message identifier
 java.lang.String getMessagePriority()
          Returns the message priority.
 java.util.List<java.lang.String> getMessageReceivers()
          Returns the receivers for this MMS message.
 java.lang.String getMessageSender()
          Return the message sender.
 java.lang.String getMessageSubject()
          Return the message subject.
 java.lang.String getMessageType()
          Returns the message type.
 MmsPart getPart(int i)
          Returns the ith part or null if i is greater then parts number.
 java.util.List<MmsPart> getParts()
          Returns the mms parts in the message.
 int getPartsNumber()
          Return the number of parts in the message.
 java.lang.String getResponseStatus()
          Returns the response status.
 java.lang.String getResponseText()
          Returns the response text
 java.lang.String getSenderVisibility()
          Returns the sender visibility.
 java.lang.String getTransactionID()
          Returns the transaction id.
 java.lang.String getVersion()
          Return the version of the MMS Protocol.
 boolean isDeliveryReportEnabled()
          Checks whether the delivery report is enabled
 boolean isMessageBCCSet()
          Checks if at least one BCC is present.
 boolean isMessageCCSet()
          Checks if there is at least one message CC.
 boolean isMessageClassSet()
          Checks if the message class is present.
 boolean isMessageContentTypeSet()
          Chekcs if the message content type is present.
 boolean isMessageDateSet()
          Checks if the message date is present.
 boolean isMessageDeliveryTimeAbsolute()
          Checks if the delivery time is absolute.
 boolean isMessageDeliveryTimeSet()
          Checks if the delivery time is present.
 boolean isMessageExpiryTimeAbsolute()
          Checks if the expiry time is absolute.
 boolean isMessageExpiryTimeSet()
          Checks if the expiry time is specified.
 boolean isMessageIDSet()
          Checks if the message identifier is present.
 boolean isMessagePrioritySet()
          Checks if the priority is specified.
 boolean isMessageReceiverSet()
          Checks if there is at least one receiver.
 boolean isMessageSenderSet()
          Checks if the message sender is specified.
 boolean isMessageSubjectSet()
          Checks if the subject is present.
 boolean isMessageTypeSet()
          Checks if the message type is specified.
 boolean isReadReplyEnabled()
          Checks whether the read reply is enabled
 boolean isResonseTextSet()
          Checks if the response text is present.
 boolean isResponseStatusSet()
          Checks if the response status is present.
 boolean isSenderVisibilitySet()
          Checks if the visibility is present.
 boolean isTransactionIDSet()
          Checks if the transaction identifier is set
 boolean isVersionSet()
          Checks if the version is present.
 void setDeliveryReport(boolean enabled)
          Enables/disables the message delivery report.
 void setMessageClass(java.lang.String messageClass)
          Sets the message class.
 void setMessageContentType(java.lang.String type)
          Sets the content type for the message.
 void setMessageDate(java.util.Date d)
          Sets the message date.
 void setMessageDate(long d)
          Sets the message date.
 void setMessageDeliveryTime(java.util.Date time, boolean absolute)
          Sets the message delivery time.
 void setMessageExpiryTime(java.util.Date time, boolean absolute)
          Sets the message expiry time.
 void setMessageID(java.lang.String id)
          Sets the message identifier.
 void setMessagePriority(java.lang.String priority)
          Sets the message priority.
 void setMessageSender(java.lang.String sender, java.lang.String addressType)
          Set the message sender.
 void setMessageSubject(java.lang.String subject)
          Sets the message subject
 void setMessageType(java.lang.String type)
          Sets the MMS message type.
 void setReadReply(boolean enabled)
          Enables/disables the message read reply.
 void setResponseStatus(java.lang.String status)
          Set the response status.
 void setResponseText(java.lang.String text)
          Sets the response text.
 void setSenderVisibility(java.lang.String visibility)
          Sets the sender visibility.
 void setTransactionID(java.lang.String id)
          Sets the transaction id.
 void setVersion(java.lang.String version)
          Sets the version of the MMS message.
 java.lang.String toString()
          Produce a string representation of the message easily readable by a human.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MMS_MESSAGE_TYPE

public static final java.lang.String MMS_MESSAGE_TYPE
See Also:
Constant Field Values

MMS_TRANSACTION_ID

public static final java.lang.String MMS_TRANSACTION_ID
See Also:
Constant Field Values

MMS_VERSION

public static final java.lang.String MMS_VERSION
See Also:
Constant Field Values

MMS_DATE

public static final java.lang.String MMS_DATE
See Also:
Constant Field Values

MMS_FROM

public static final java.lang.String MMS_FROM
See Also:
Constant Field Values

MMS_TO

public static final java.lang.String MMS_TO
See Also:
Constant Field Values

MMS_CC

public static final java.lang.String MMS_CC
See Also:
Constant Field Values

MMS_BCC

public static final java.lang.String MMS_BCC
See Also:
Constant Field Values

MMS_SUBJECT

public static final java.lang.String MMS_SUBJECT
See Also:
Constant Field Values

MMS_CLASS

public static final java.lang.String MMS_CLASS
See Also:
Constant Field Values

MMS_EXPIRY

public static final java.lang.String MMS_EXPIRY
See Also:
Constant Field Values

MMS_DELIVERY_TIME

public static final java.lang.String MMS_DELIVERY_TIME
See Also:
Constant Field Values

MMS_PRIORITY

public static final java.lang.String MMS_PRIORITY
See Also:
Constant Field Values

MMS_SENDER_VISIBILITY

public static final java.lang.String MMS_SENDER_VISIBILITY
See Also:
Constant Field Values

MMS_DELIVERY_REPORT

public static final java.lang.String MMS_DELIVERY_REPORT
See Also:
Constant Field Values

MMS_READ_REPLY

public static final java.lang.String MMS_READ_REPLY
See Also:
Constant Field Values

MMS_CONTENT_TYPE

public static final java.lang.String MMS_CONTENT_TYPE
See Also:
Constant Field Values

MMS_RESPONSE_STATUS

public static final java.lang.String MMS_RESPONSE_STATUS
See Also:
Constant Field Values

MMS_RESPONSE_TEXT

public static final java.lang.String MMS_RESPONSE_TEXT
See Also:
Constant Field Values

MMS_MESSAGE_ID

public static final java.lang.String MMS_MESSAGE_ID
See Also:
Constant Field Values

CHARSET_US_ASCII

public static final java.lang.String CHARSET_US_ASCII
See Also:
Constant Field Values

CHARSET_UTF8

public static final java.lang.String CHARSET_UTF8
See Also:
Constant Field Values

MMS_MESSAGE_TYPE_SEND_REQUEST

public static final java.lang.String MMS_MESSAGE_TYPE_SEND_REQUEST
See Also:
Constant Field Values

MMS_MESSAGE_TYPE_SEND_CONF

public static final java.lang.String MMS_MESSAGE_TYPE_SEND_CONF
See Also:
Constant Field Values

MMS_VERSION_1

public static final java.lang.String MMS_VERSION_1
See Also:
Constant Field Values

MMS_DELIVERY_REPORT_YES

public static final java.lang.String MMS_DELIVERY_REPORT_YES
See Also:
Constant Field Values

MMS_DELIVERY_REPORT_NO

public static final java.lang.String MMS_DELIVERY_REPORT_NO
See Also:
Constant Field Values

MMS_CLASS_PERSONAL

public static final java.lang.String MMS_CLASS_PERSONAL
See Also:
Constant Field Values

MMS_CLASS_ADVERTISEMENT

public static final java.lang.String MMS_CLASS_ADVERTISEMENT
See Also:
Constant Field Values

MMS_CLASS_INFORMATIONAL

public static final java.lang.String MMS_CLASS_INFORMATIONAL
See Also:
Constant Field Values

MMS_CLASS_AUTO

public static final java.lang.String MMS_CLASS_AUTO
See Also:
Constant Field Values

MMS_PRIORITY_LOW

public static final java.lang.String MMS_PRIORITY_LOW
See Also:
Constant Field Values

MMS_PRIORITY_NORMAL

public static final java.lang.String MMS_PRIORITY_NORMAL
See Also:
Constant Field Values

MMS_PRIORITY_HIGH

public static final java.lang.String MMS_PRIORITY_HIGH
See Also:
Constant Field Values

MMS_READ_REPLY_YES

public static final java.lang.String MMS_READ_REPLY_YES
See Also:
Constant Field Values

MMS_READ_REPLY_NO

public static final java.lang.String MMS_READ_REPLY_NO
See Also:
Constant Field Values

MMS_RESPONSE_STATUS_OK

public static final java.lang.String MMS_RESPONSE_STATUS_OK
See Also:
Constant Field Values

MMS_RESPONSE_STATUS_ERROR_UNSPECIFIED

public static final java.lang.String MMS_RESPONSE_STATUS_ERROR_UNSPECIFIED
See Also:
Constant Field Values

MMS_RESPONSE_STATUS_ERROR_SERVICE_DENIED

public static final java.lang.String MMS_RESPONSE_STATUS_ERROR_SERVICE_DENIED
See Also:
Constant Field Values

MMS_RESPONSE_STATUS_ERROR_MESSAGE_FORMAT_CORRUPT

public static final java.lang.String MMS_RESPONSE_STATUS_ERROR_MESSAGE_FORMAT_CORRUPT
See Also:
Constant Field Values

MMS_RESPONSE_STATUS_ERROR_SENDING_ADDRESS_UNRESOLVED

public static final java.lang.String MMS_RESPONSE_STATUS_ERROR_SENDING_ADDRESS_UNRESOLVED
See Also:
Constant Field Values

MMS_RESPONSE_STATUS_ERROR_MESSAGE_NOT_FOUND

public static final java.lang.String MMS_RESPONSE_STATUS_ERROR_MESSAGE_NOT_FOUND
See Also:
Constant Field Values

MMS_RESPONSE_STATUS_ERROR_NETWORK_PROBLEM

public static final java.lang.String MMS_RESPONSE_STATUS_ERROR_NETWORK_PROBLEM
See Also:
Constant Field Values

MMS_RESPONSE_STATUS_ERROR_CONTENT_NOT_ACCEPTED

public static final java.lang.String MMS_RESPONSE_STATUS_ERROR_CONTENT_NOT_ACCEPTED
See Also:
Constant Field Values

MMS_RESPONSE_STATUS_ERROR_UNSUPPORTED_MESSAGE

public static final java.lang.String MMS_RESPONSE_STATUS_ERROR_UNSUPPORTED_MESSAGE
See Also:
Constant Field Values

MMS_SENDER_VISIBILITY_HIDE

public static final java.lang.String MMS_SENDER_VISIBILITY_HIDE
See Also:
Constant Field Values

MMS_SENDER_VISIBILITY_SHOW

public static final java.lang.String MMS_SENDER_VISIBILITY_SHOW
See Also:
Constant Field Values

MMS_ADDRESS_TYPE_MOBILE_NUMBER

public static final java.lang.String MMS_ADDRESS_TYPE_MOBILE_NUMBER
See Also:
Constant Field Values

MMS_ADDRESS_TYPE_MAIL

public static final java.lang.String MMS_ADDRESS_TYPE_MAIL
See Also:
Constant Field Values

MMS_ADDRESS_TYPE_IPV4

public static final java.lang.String MMS_ADDRESS_TYPE_IPV4
See Also:
Constant Field Values

MMS_ADDRESS_TYPE_IPV6

public static final java.lang.String MMS_ADDRESS_TYPE_IPV6
See Also:
Constant Field Values

CTYPE_UNKNOWN

public static final java.lang.String CTYPE_UNKNOWN
See Also:
Constant Field Values

CTYPE_TEXT

public static final java.lang.String CTYPE_TEXT
See Also:
Constant Field Values

CTYPE_TEXT_PLAIN

public static final java.lang.String CTYPE_TEXT_PLAIN
See Also:
Constant Field Values

CTYPE_TEXT_HTML

public static final java.lang.String CTYPE_TEXT_HTML
See Also:
Constant Field Values

CTYPE_TEXT_WML

public static final java.lang.String CTYPE_TEXT_WML
See Also:
Constant Field Values

CTYPE_IMAGE

public static final java.lang.String CTYPE_IMAGE
See Also:
Constant Field Values

CTYPE_IMAGE_JPEG

public static final java.lang.String CTYPE_IMAGE_JPEG
See Also:
Constant Field Values

CTYPE_IMAGE_GIF

public static final java.lang.String CTYPE_IMAGE_GIF
See Also:
Constant Field Values

CTYPE_IMAGE_TIFF

public static final java.lang.String CTYPE_IMAGE_TIFF
See Also:
Constant Field Values

CTYPE_IMAGE_PNG

public static final java.lang.String CTYPE_IMAGE_PNG
See Also:
Constant Field Values

CTYPE_IMAGE_VND_WAP_WBMP

public static final java.lang.String CTYPE_IMAGE_VND_WAP_WBMP
See Also:
Constant Field Values

CTYPE_MULTIPART

public static final java.lang.String CTYPE_MULTIPART
See Also:
Constant Field Values

CTYPE_MULTIPART_MIXED

public static final java.lang.String CTYPE_MULTIPART_MIXED
See Also:
Constant Field Values

CTYPE_APPLICATION_MULTIPART_MIXED

public static final java.lang.String CTYPE_APPLICATION_MULTIPART_MIXED
See Also:
Constant Field Values

CTYPE_APPLICATION_MULTIPART_RELATED

public static final java.lang.String CTYPE_APPLICATION_MULTIPART_RELATED
See Also:
Constant Field Values
Constructor Detail

MmsMessage

public MmsMessage()
Creates an MmsMessage object.

Method Detail

setMessageType

public void setMessageType(java.lang.String type)
                    throws MmsMessageException
Sets the MMS message type.
Supported types:
  1. MMS_MESSAGE_TYPE_SEND_REQUEST
  2. MMS_MESSAGE_TYPE_SEND_CONF

Parameters:
type - type of the message
Throws:
MmsMessageException - message type not supported

isMessageTypeSet

public boolean isMessageTypeSet()
Checks if the message type is specified.

Returns:
true if message type is specified, false otherwise

setTransactionID

public void setTransactionID(java.lang.String id)
Sets the transaction id.

Parameters:
id - transaction id

isTransactionIDSet

public boolean isTransactionIDSet()
Checks if the transaction identifier is set

Returns:
true if set

setVersion

public void setVersion(java.lang.String version)
                throws MmsMessageException
Sets the version of the MMS message.
The only supported value is MMS_VERSION_1.

Parameters:
version - version of the MMS message
Throws:
MmsMessageException - version not supported

isVersionSet

public boolean isVersionSet()
Checks if the version is present.

Returns:
true if present, false otherwise

setMessageDate

public void setMessageDate(java.util.Date d)
Sets the message date.

Parameters:
d - date

setMessageDate

public void setMessageDate(long d)
Sets the message date.

Parameters:
d - date

isMessageDateSet

public boolean isMessageDateSet()
Checks if the message date is present.

Returns:
true if present, false otherwise

setMessageSender

public void setMessageSender(java.lang.String sender,
                             java.lang.String addressType)
                      throws MmsMessageException
Set the message sender.
Supported values for addressType
  1. MMS_ADDRESS_TYPE_IPV4
  2. MMS_ADDRESS_TYPE_IPV6
  3. MMS_ADDRESS_TYPE_MAIL
  4. MMS_ADDRESS_TYPE_MOBILE_NUMBER

Parameters:
sender - sender address
addressType - address type
Throws:
MmsMessageException - address type not supported

isMessageSenderSet

public boolean isMessageSenderSet()
Checks if the message sender is specified.

Returns:
true if present

addMessageReceiver

public void addMessageReceiver(java.lang.String receiver,
                               java.lang.String addressType)
                        throws MmsMessageException
Adds a message receiver.

Parameters:
receiver - receiver address
addressType - address type
Throws:
MmsMessageException - address type not supported
See Also:
setMessageSender(String, String)

isMessageReceiverSet

public boolean isMessageReceiverSet()
Checks if there is at least one receiver.

Returns:
true if a receiver is present

getMessageReceivers

public java.util.List<java.lang.String> getMessageReceivers()
Returns the receivers for this MMS message.

Returns:
receivers list

addMessageCC

public void addMessageCC(java.lang.String receiver,
                         java.lang.String addressType)
                  throws MmsMessageException
Adds a message CC.

Parameters:
receiver - CC address
addressType - address type
Throws:
MmsMessageException - address type not supported
See Also:
setMessageSender(String, String)

isMessageCCSet

public boolean isMessageCCSet()
Checks if there is at least one message CC.

Returns:
true if one or more CC are present

getMessageCC

public java.util.List<java.lang.String> getMessageCC()
Return the CCs list.

Returns:
CC list

addMessaceBCC

public void addMessaceBCC(java.lang.String receiver,
                          java.lang.String addressType)
                   throws MmsMessageException
Adds a message BCC

Parameters:
receiver - BCC address
addressType - address type
Throws:
MmsMessageException - address type not supported
See Also:
setMessageSender(String, String)

isMessageBCCSet

public boolean isMessageBCCSet()
Checks if at least one BCC is present.

Returns:
true if present

getMessageBCC

public java.util.List<java.lang.String> getMessageBCC()
Return the BCCs list

Returns:
BCC list

setMessageSubject

public void setMessageSubject(java.lang.String subject)
Sets the message subject

Parameters:
subject -

isMessageSubjectSet

public boolean isMessageSubjectSet()
Checks if the subject is present.

Returns:
true if present

setMessageClass

public void setMessageClass(java.lang.String messageClass)
                     throws MmsMessageException
Sets the message class.
Supported class:
  1. MMS_CLASS_AUTO
  2. MMS_CLASS_PERSONAL
  3. MMS_CLASS_INFORMATIONAL
  4. MMS_CLASS_ADVERTISEMENT

Parameters:
messageClass - message class
Throws:
MmsMessageException - the message class is not supported

isMessageClassSet

public boolean isMessageClassSet()
Checks if the message class is present.

Returns:
true if present

setMessageExpiryTime

public void setMessageExpiryTime(java.util.Date time,
                                 boolean absolute)
Sets the message expiry time.
If the absolute parameter is true, then time is considered the exact date of expire for the mms message. Otherwise time will be added to the message date to calculate the exact expire date.

Parameters:
time - Time value
absolute - Specifies if the time is relative or absolute

isMessageExpiryTimeSet

public boolean isMessageExpiryTimeSet()
Checks if the expiry time is specified.

Returns:
true if present

setMessageDeliveryTime

public void setMessageDeliveryTime(java.util.Date time,
                                   boolean absolute)
Sets the message delivery time.

Parameters:
time - time value
absolute - specifies if the time is relative or absolute
See Also:
setMessageExpiryTime(Date, boolean)

isMessageDeliveryTimeSet

public boolean isMessageDeliveryTimeSet()
Checks if the delivery time is present.

Returns:
true if present

setMessagePriority

public void setMessagePriority(java.lang.String priority)
                        throws MmsMessageException
Sets the message priority.
Supported priorities:
  1. MMS_PRIORITY_HIGH
  2. MMS_PRIORITY_NORMAL
  3. MMS_PRIORITY_LOW

Parameters:
priority - priority of the message
Throws:
MmsMessageException - priority not supported

isMessagePrioritySet

public boolean isMessagePrioritySet()
Checks if the priority is specified.

Returns:
true if specified

setSenderVisibility

public void setSenderVisibility(java.lang.String visibility)
                         throws MmsMessageException
Sets the sender visibility.
Supported visibilities:
  1. MMS_SENDER_VISIBILITY_HIDE
  2. MMS_SENDER_VISIBILITY_SHOW

Parameters:
visibility - visibility value
Throws:
MmsMessageException - visibility not supported

isSenderVisibilitySet

public boolean isSenderVisibilitySet()
Checks if the visibility is present.

Returns:
true if present

setDeliveryReport

public void setDeliveryReport(boolean enabled)
Enables/disables the message delivery report.

Parameters:
enabled - whether to enable the message delivery report

setReadReply

public void setReadReply(boolean enabled)
Enables/disables the message read reply.

Parameters:
enabled - whether to enable the message read reply

setResponseStatus

public void setResponseStatus(java.lang.String status)
                       throws MmsMessageException
Set the response status.
Supported responses:
  1. MMS_RESPONSE_STATUS_ERROR_CONTENT_NOT_ACCEPTED
  2. MMS_RESPONSE_STATUS_ERROR_MESSAGE_FORMAT_CORRUPT
  3. MMS_RESPONSE_STATUS_ERROR_MESSAGE_NOT_FOUND
  4. MMS_RESPONSE_STATUS_ERROR_NETWORK_PROBLEM
  5. MMS_RESPONSE_STATUS_ERROR_SENDING_ADDRESS_UNRESOLVED
  6. MMS_RESPONSE_STATUS_ERROR_SERVICE_DENIED
  7. MMS_RESPONSE_STATUS_ERROR_UNSPECIFIED
  8. MMS_RESPONSE_STATUS_ERROR_UNSUPPORTED_MESSAGE
  9. MMS_RESPONSE_STATUS_OK

Parameters:
status - response status
Throws:
MmsMessageException - status not supported

isResponseStatusSet

public boolean isResponseStatusSet()
Checks if the response status is present.

Returns:
true if present

setResponseText

public void setResponseText(java.lang.String text)
Sets the response text.

Parameters:
text - response

isResonseTextSet

public boolean isResonseTextSet()
Checks if the response text is present.

Returns:
true if present

setMessageID

public void setMessageID(java.lang.String id)
Sets the message identifier.

Parameters:
id - message identifier

isMessageIDSet

public boolean isMessageIDSet()
Checks if the message identifier is present.

Returns:
true if present

setMessageContentType

public void setMessageContentType(java.lang.String type)
Sets the content type for the message.
Supported content types:
  1. CTYPE_APPLICATION_MULTIPART_MIXED
  2. CTYPE_APPLICATION_MULTIPART_RELATED
  3. CTYPE_IMAGE
  4. CTYPE_IMAGE_GIF
  5. CTYPE_IMAGE_JPEG
  6. CTYPE_IMAGE_PNG
  7. CTYPE_IMAGE_TIFF
  8. CTYPE_IMAGE_VND_WAP_WBMP
  9. CTYPE_MULTIPART
  10. CTYPE_MULTIPART_MIXED
  11. CTYPE_TEXT
  12. CTYPE_TEXT_HTML
  13. CTYPE_TEXT_PLAIN
  14. CTYPE_TEXT_WML
  15. CTYPE_UNKNOWN

Parameters:
type - content type

isMessageContentTypeSet

public boolean isMessageContentTypeSet()
Chekcs if the message content type is present.

Returns:
true if present

addPart

public void addPart(MmsPart part)
             throws MmsMessageException
Add a part to the MMS message.
Checks if the content type of the message is compatible with the content type of the part.

Parameters:
part - part to add to the message
Throws:
MmsMessageException - the part is not compatible with the message

getPartsNumber

public int getPartsNumber()
Return the number of parts in the message.

Returns:
parts number

getParts

public java.util.List<MmsPart> getParts()
Returns the mms parts in the message.

Returns:
mms parts

getPart

public MmsPart getPart(int i)
Returns the ith part or null if i is greater then parts number.

Parameters:
i - part number desidered
Returns:
ith part number

getMessageType

public java.lang.String getMessageType()
Returns the message type.

Returns:
message type

getTransactionID

public java.lang.String getTransactionID()
Returns the transaction id.

Returns:
transaction id

getVersion

public java.lang.String getVersion()
Return the version of the MMS Protocol.

Returns:
version of MMS

getMessageDate

public java.util.Date getMessageDate()
Returns the date of the message.

Returns:
message's date

getMessageSender

public java.lang.String getMessageSender()
Return the message sender.

Returns:
sender

getMessageSubject

public java.lang.String getMessageSubject()
Return the message subject.

Returns:
message subject

getMessageClass

public java.lang.String getMessageClass()
Returns the message class.

Returns:
message class

getMessageExpiryTime

public java.util.Date getMessageExpiryTime()
Returns the message expiry time.

Returns:
expiry time

isMessageExpiryTimeAbsolute

public boolean isMessageExpiryTimeAbsolute()
Checks if the expiry time is absolute.

Returns:
true if absolute, false otherwise

getMessageDeliveryTime

public java.util.Date getMessageDeliveryTime()
Returns the delivery time of the message.

Returns:
delivery time

isMessageDeliveryTimeAbsolute

public boolean isMessageDeliveryTimeAbsolute()
Checks if the delivery time is absolute.

Returns:
true if absolute, false otherwise

getMessagePriority

public java.lang.String getMessagePriority()
Returns the message priority.

Returns:
message priority

getSenderVisibility

public java.lang.String getSenderVisibility()
Returns the sender visibility.

Returns:
sender visibility

isDeliveryReportEnabled

public boolean isDeliveryReportEnabled()
Checks whether the delivery report is enabled

Returns:
true if enabled

isReadReplyEnabled

public boolean isReadReplyEnabled()
Checks whether the read reply is enabled

Returns:
true if enabled

getResponseStatus

public java.lang.String getResponseStatus()
Returns the response status.

Returns:
response status

getResponseText

public java.lang.String getResponseText()
Returns the response text

Returns:
response text

getMessageID

public java.lang.String getMessageID()
Returns the message identifier

Returns:
message identifier

getMessageContentType

public java.lang.String getMessageContentType()
Returns the message content type.

Returns:
message content type

toString

public java.lang.String toString()
Produce a string representation of the message easily readable by a human.

Overrides:
toString in class java.lang.Object
Returns:
string representation of the message