Oracle Application Server Wireless Java API Reference
B14043-01


oracle.panama.messaging.common
Class Message

java.lang.Object
  extended byoracle.panama.messaging.common.MessagePart
      extended byoracle.panama.messaging.common.Message

All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable
Direct Known Subclasses:
MM1Message, MM7Message

public class Message
extends MessagePart

This class describes the structure of a message content for delivering. The Message class defines the interface for applications to represent complex message content, which is MIME type based and potentially multipart. The main content of a message is actually described in MessagePart, the Message class encapsulates a few message-wide properties.
The message can be extended to represent customized message format.It implements the Externalizable interface so that it can be serialized fast. It can be stored in the database persistently as a Java object. No information will be lost even if it is an extended one. Instances of the Messages object potentially can be persisted after externalization depending on how the system routes the message.

See Also:
Serialized Form

Field Summary

Fields inherited from class oracle.panama.messaging.common.MessagePart
CHARSET_KEY, CONTENT_DISPOSITION_KEY, CONTENT_ID_KEY, CONTENT_LOCATION_KEY, CONTENT_TYPE_KEY, FILENAME_KEY

Constructor Summary
Message()

Method Summary
boolean equals(java.lang.Object other)
Checks equality for two message object.
java.lang.String getSubject()
Gets the subject of the message.
int hashCode()
Generates and returns hashcode for the instance.
void readExternal(java.io.ObjectInput oi)
Read a message instance from a stream.
void setSubject(java.lang.String subject)
Sets the subject of the message.
java.lang.String toString()
Overrides default toString to append message subject.
void writeExternal(java.io.ObjectOutput oo)
Write a message instance to a stream.

Methods inherited from class oracle.panama.messaging.common.MessagePart
addHeader, getAllHeaders, getContent, getContentId, getContentLocation, getContentType, getDisposition, getFileName, getHeader, getHeader, getHeaderParameter, getSimpleHeader, isMimeType, removeHeader, setContent, setContentId, setContentLocation, setContentType, setDisposition, setFileName, setHeader

Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

Message

public Message()

Method Detail

equals

public boolean equals(java.lang.Object other)
Checks equality for two message object.
Overrides:
equals in class MessagePart
Parameters:
other - instance that is to be checked with "this" instance.
Returns:
true if the instances are equal else false.

getSubject

public java.lang.String getSubject()
Gets the subject of the message.
Returns:
the message subject represented as a String

hashCode

public int hashCode()
Generates and returns hashcode for the instance.
Overrides:
hashCode in class MessagePart
Returns:
hash code.

readExternal

public void readExternal(java.io.ObjectInput oi)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Read a message instance from a stream.
Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class MessagePart
Parameters:
oi - the stream to read from.
Throws:
java.io.IOException
java.lang.ClassNotFoundException

setSubject

public void setSubject(java.lang.String subject)
Sets the subject of the message.
Parameters:
subject - subject of the message.

toString

public java.lang.String toString()
Overrides default toString to append message subject.
Overrides:
toString in class MessagePart
Returns:
string with message subject.

writeExternal

public void writeExternal(java.io.ObjectOutput oo)
                   throws java.io.IOException
Write a message instance to a stream.
Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class MessagePart
Parameters:
oo - the stream to write to.
Throws:
java.io.IOException

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.