org.mgif.connectivity.async
Interface Message

All Superinterfaces:
Attributes, Datagram
All Known Subinterfaces:
BinaryMessage, MMMessage, ServiceIndicationMessage, TextMessage

public interface Message
extends Datagram

This is the base interface for derived interfaces that represent various types of messages. This package is designed to work with Message objects that may contain different elements depending on the underlying messaging protocol.

This interface contains the functionality common to all messages. Concrete object instances representing a message will typically implement other (sub)interfaces providing access to the content and other information in the message which is dependent on the type of the message.

See Also:
MGIF

Method Summary
 boolean getDeliveryNotification()
          Returns whether a notification is requested when message final delivery status is known.
 long getExpiration()
          Returns the message's expiration time.
 java.lang.String getMessageId()
          Returns the message ID.
 long getTimestamp()
          Returns the message timestamp.
 int numberOfSegments()
          Returns the number of segments in the underlying protocol that would be needed for sending the specified Message.
 void send()
          Sends the message.
 void setDeliveryNotification(boolean request)
          Sets whether a notification is requested when the final message delivery status is known.
 void setExpiration(long expiration)
          Sets the message's expiration time.
 
Methods inherited from interface org.mgif.connectivity.transfer.Datagram
getLocale, getLocales, getProtocol, getScheme, getTerminalId
 
Methods inherited from interface org.mgif.connectivity.transfer.Attributes
getAttribute, getAttributeNames, getAttributes, isAttribute, removeAttribute, setAttribute
 

Method Detail

getDeliveryNotification

public boolean getDeliveryNotification()
Returns whether a notification is requested when message final delivery status is known.
Returns:
true if notification is requested

getExpiration

public long getExpiration()
Returns the message's expiration time.
Returns:
the absolute time the message expires specified in milliseconds since midnight, January 1, 1970 UTC or -1 if the expiration time has not been set.

getMessageId

public java.lang.String getMessageId()
Returns the message ID. Each message has an unique ID which for example may be used to correlate incoming delivery notifications with sent messages.
Returns:
the message ID

getTimestamp

public long getTimestamp()
Returns the message timestamp.
Returns:
the message timestamp specified in milliseconds since midnight, January 1, 1970 UTC or -1 if the time information is not available in the underlying protocol message.

numberOfSegments

public int numberOfSegments()
Returns the number of segments in the underlying protocol that would be needed for sending the specified Message.

Note that this method does not actually send the message, it will only calculate the number of protocol segments needed for sending the message.


send

public void send()
          throws MessageException
Sends the message.
Throws:
MessageException - if sending fails

setDeliveryNotification

public void setDeliveryNotification(boolean request)
Sets whether a notification is requested when the final message delivery status is known.
Parameters:
request - true to request a notification

setExpiration

public void setExpiration(long expiration)
Sets the message's expiration time.
Parameters:
expiration - the message's expiration time relative to the current time specified in milliseconds


Copyright © 2002 Mobile Games Interoperability Forum. All rights reserved.
This source code is protected by the legal notice posted at http://www.mgif.org/docs/notice.html