|
Oracle Application Server Wireless Java API Reference B10400-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 comlex as composing 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 actuall 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) 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 3 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. 4) byte[] Any other MIME types. This is essentially an opaque block of data upto the protocol handlers to process.
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 |
static java.lang.String |
CONTENT_LOCATION_KEY |
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. |
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() |
java.lang.String |
getContentLocation() |
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) |
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) |
void |
setContentLocation(java.lang.String contentLoc) |
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. |
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. |
void |
writeExternal(java.io.ObjectOutput oo) Write a message instance to a stream. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CONTENT_DISPOSITION_KEY
public static final java.lang.String CONTENT_TYPE_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 FILENAME_KEY
public static final java.lang.String CHARSET_KEY
Constructor Detail |
public MessagePart()
Method Detail |
public java.lang.Object getContent()
public void setContent(java.lang.Object content)
content
- the message content.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 java.util.Enumeration getAllHeaders()
public java.lang.String getSimpleHeader(java.lang.String name)
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 void setHeader(java.lang.String name, java.lang.String value)
name
- header name.value
- header value.public java.lang.String[] removeHeader(java.lang.String name)
name
- header name.public java.lang.String getDisposition()
public void setDisposition(java.lang.String disposition)
disposition
- header value of the content disposition.public java.lang.String getContentType()
public java.lang.String getContentId()
public java.lang.String getContentLocation()
public void setContentType(java.lang.String contentType)
contentType
- header value of the content type.public void setContentId(java.lang.String contentId)
public void setContentLocation(java.lang.String contentLoc)
public boolean isMimeType(java.lang.String mimeType)
public java.lang.String getFileName()
setHeader(java.lang.String, java.lang.String)
public void setFileName(java.lang.String filename)
filename
-public 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 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 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 B10400-01 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |