|
Oracle Application Server Wireless Java API Reference B14043-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.panama.messaging.common.MessagePart
This class declares the main construct that represents a message. Messages can be as simple as text only, or as complex as composed of multi-parts with the type of each part described by its MIME type, similiar to the way email messages are describe.
MIME types can be any standard MIME type plus a few predetermined types that have special meanings to OracleAS Wireless as declared in class ContentTypes.
From an interface point of view, the content of a Part is of the Java Object type. However, the protocol handlers have an implicit set of types that they operate on. While it'd be syntatically correct to give the content of any java type, semantics there are a few rules to observe.
Basically there are several possibility for the actual Java object type of the message content depending on Mime type of the Part:
 1) MultiPart If the MIME type indicates multipart. In this case, the individual parts will be furthur examined.
 2) text If the MIME type indicates text, the content should be a String object.
 3) byte[] Any other MIME types. This is essentially an opaque block of data upto the protocol handlers to process.
 4) Hashtable Hashtable is mostly used currently for messages to be delivered as SMS smart messages. Because different types of smart message requires different set of parameters, hashtable is used for applications to specify the particular parameters needed for the kind of smart message requested. There are a large set of smart message types and OracleAS Wireless out of the box supports three types:
    WapSettings - deliver to handset WAP provisioning messages
    RING_TONE - deliver to handset a piece of music as ringtone
    GRAPHICS - deliver to handset an image as logo etc
Note that the content of the smart messages are often times handset dependent. The product supports only Nokia and Erricsson handset out of the box. Consult your system administrator to understand the actual set of smart message and handset available to you.
WapSettings
, RingTone
, Graphics
, ContentTypes
, Serialized FormField Summary | |
static java.lang.String |
CHARSET_KEY Constant for the charset parameter |
static java.lang.String |
CONTENT_DISPOSITION_KEY Constant for the content disposition header |
static java.lang.String |
CONTENT_ID_KEY Constant for content id header. |
static java.lang.String |
CONTENT_LOCATION_KEY Constant for content location header. |
static java.lang.String |
CONTENT_TYPE_KEY Constant for the content type header |
static java.lang.String |
FILENAME_KEY Constant for the filename parameter within the disposition header |
Constructor Summary | |
MessagePart() |
Method Summary | |
void |
addHeader(java.lang.String name, java.lang.String value) Add one more value for an existing header into the message. Headers are name value pairs both in the form of Strings. |
boolean |
equals(java.lang.Object other) Checks equality of two MessagePart. |
java.util.Enumeration |
getAllHeaders() Return all the headers from this part as an Enumeration of Header objects. |
java.lang.Object |
getContent() Retrieve content of the message. |
java.lang.String |
getContentId() Returns the value of "Content-ID" header field. |
java.lang.String |
getContentLocation() Returns the value of "Content-Location" header field. |
java.lang.String |
getContentType() Returns the value of the "Content-Type" header field. |
java.lang.String |
getDisposition() Returns the value of the "Content-Disposition" header field. |
java.lang.String |
getFileName() Get the filename value for the message part. |
java.lang.String[] |
getHeader(java.lang.String name) Get all the value for the named header. |
java.lang.String |
getHeader(java.lang.String name, java.lang.String delimiter) Get all the headers for this header name, returned as a single String, with headers separated by the delimiter. |
java.lang.String |
getHeaderParameter(java.lang.String header, java.lang.String name) Get parameter in the header. |
java.lang.String |
getSimpleHeader(java.lang.String name) Get the first value for the named header. |
int |
hashCode() Generates and return hashcode for the instance. |
boolean |
isMimeType(java.lang.String mimeType) Compare and determine if the message MIME type is of the one specified. |
void |
readExternal(java.io.ObjectInput oi) Read a message instance from a stream. |
java.lang.String[] |
removeHeader(java.lang.String name) Remove a named header if set. |
void |
setContent(java.lang.Object content) Set the content of the message part. |
void |
setContentId(java.lang.String contentId) Set the value of "Content-ID" header field. |
void |
setContentLocation(java.lang.String contentLoc) set the value of "Content-Location" header field. |
void |
setContentType(java.lang.String contentType) Set the value for content type header. |
void |
setDisposition(java.lang.String disposition) Set the value for content disposition header. Disposition describes how a part should be presented to the user. |
void |
setFileName(java.lang.String filename) Set the filename associated with this message part. |
void |
setHeader(java.lang.String name, java.lang.String value) Set and replace all existing values for this header with this new value. Headers are name value pairs both in the form of Strings. |
java.lang.String |
toString() Overrides the default toString. |
void |
writeExternal(java.io.ObjectOutput oo) Write a message instance to a stream. |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String CHARSET_KEY
public static final java.lang.String CONTENT_DISPOSITION_KEY
public static final java.lang.String CONTENT_ID_KEY
public static final java.lang.String CONTENT_LOCATION_KEY
public static final java.lang.String CONTENT_TYPE_KEY
public static final java.lang.String FILENAME_KEY
Constructor Detail |
public MessagePart()
Method Detail |
public void addHeader(java.lang.String name, java.lang.String value)
name
- header name.value
- header value.setHeader(java.lang.String, java.lang.String)
public boolean equals(java.lang.Object other)
other
- MessagePart which is to checked for equality with "this" object.public java.util.Enumeration getAllHeaders()
public java.lang.Object getContent()
public java.lang.String getContentId()
public java.lang.String getContentLocation()
public java.lang.String getContentType()
public java.lang.String getDisposition()
public java.lang.String getFileName()
setHeader(java.lang.String, java.lang.String)
public java.lang.String[] getHeader(java.lang.String name)
name
- name of headerpublic java.lang.String getHeader(java.lang.String name, java.lang.String delimiter)
name
- name of headerdelimiter
- delimiter which separates each headerpublic java.lang.String getHeaderParameter(java.lang.String header, java.lang.String name)
header
- the header stringname
- the parameter namesetHeader(java.lang.String, java.lang.String)
public java.lang.String getSimpleHeader(java.lang.String name)
name
- name of the headerpublic int hashCode()
public boolean isMimeType(java.lang.String mimeType)
public void readExternal(java.io.ObjectInput oi) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
oi
- the stream to read from.java.io.IOException
java.lang.ClassNotFoundException
public java.lang.String[] removeHeader(java.lang.String name)
name
- header name.public void setContent(java.lang.Object content)
content
- the message content.public void setContentId(java.lang.String contentId)
contentId
-public void setContentLocation(java.lang.String contentLoc)
contentLoc
-public void setContentType(java.lang.String contentType)
contentType
- header value of the content type.public void setDisposition(java.lang.String disposition)
disposition
- header value of the content disposition.public void setFileName(java.lang.String filename)
filename
-public void setHeader(java.lang.String name, java.lang.String value)
name
- header name.value
- header value.public java.lang.String toString()
public void writeExternal(java.io.ObjectOutput oo) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
oo
- the stream to write to.java.io.IOException
|
Oracle Application Server Wireless Java API Reference B14043-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |