|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.epfl.lsr.apex.APEXMessage ch.epfl.lsr.apex.APEXDataMessage
An APEXDataMessage
is the message sent for data containing
operations and defines its syntax as it is specified in the
Application Exchange (APEX) Protocol RFC3340 DTD.
A data opeartion may either contain XML or MIME Multipart structured content:
APEXMessage.XMLCONTENT
)
APEXMessage.MIMECONTENT
)
getContentType()
Field Summary | |
static String |
ACTIVE
internal option identifier status |
static String |
FINAL
internal option identifier status |
static String |
NOTPROCESSING
internal option identifier status |
static String |
PASSIV
internal option identifier status |
Fields inherited from class ch.epfl.lsr.apex.APEXMessage |
APPBEEPXML, ATTACH, BEEPXML, BIND, CONTENTTRANSFERENCODING, CONTENTTYPE, DATA, ENC_7BIT, ENC_8BIT, ENC_BASE64, ENC_BINARY, ENC_QUOTEDPRINTABLE, ENC_UUENCODE, ERROR, FILENAME, message, MIMECONTENT, MIMECONTENT_HASHKEY, OK, RELATED, START, START_HASHKEY, status, STRINGCONTENT, STRINGCONTENT_HASHKEY, TERMINATE, TYPE, XMLCONTENT, XMLCONTENT_HASHKEY |
Constructor Summary | |
APEXDataMessage()
Instantiates an empty APEXDataMessage .
|
|
APEXDataMessage(APEXEndpointAddress originator,
APEXEndpointAddress[] recipients,
byte[] byteContent,
String contentType,
String transferEncoding)
Instantiates a new APEXDataMessage containing MIME
Multipart structured content specified in a byte array.
|
|
APEXDataMessage(APEXEndpointAddress originator,
APEXEndpointAddress[] recipients,
MimeBodyPart mpart)
Instantiates a new APEXDataMessage containing MIME
Multipart structured content.
|
|
APEXDataMessage(APEXEndpointAddress originator,
APEXEndpointAddress[] recipients,
String xmlContent)
Instantiates a new APEXDataMessage containing XML
content.
|
|
APEXDataMessage(APEXEndpointAddress originator,
APEXEndpointAddress recipient,
byte[] byteContent,
String contentType,
String transferEncoding)
Instantiates a new APEXDataMessage containing MIME
Multipart structured content specified in a byte array.
|
|
APEXDataMessage(APEXEndpointAddress originator,
APEXEndpointAddress recipient,
MimeBodyPart mpart)
Instantiates a new APEXDataMessage containing MIME
Multipart structured content.
|
|
APEXDataMessage(APEXEndpointAddress originator,
APEXEndpointAddress recipient,
MimeMessage mimeContent)
Instantiates a new APEXDataMessage containing MIME
Multipart structured content.
|
|
APEXDataMessage(APEXEndpointAddress originator,
APEXEndpointAddress recipient,
String xmlContent)
Instantiates a new APEXDataMessage containing XML
content.
|
|
APEXDataMessage(APEXEndpointAddress originator,
HashSet recipients,
byte[] byteContent,
String contentType,
String transferEncoding)
Instantiates a new APEXDataMessage containing MIME
Multipart structured content specified in a byte array.
|
|
APEXDataMessage(APEXEndpointAddress originator,
HashSet recipients,
byte[] byteContent,
String contentType,
String transferEncoding,
HashSet options)
Instantiates a new APEXDataMessage containing MIME
Multipart structured content specified in a byte array.
|
|
APEXDataMessage(APEXEndpointAddress originator,
HashSet recipients,
MimeBodyPart mpart)
Instantiates a new APEXDataMessage containing MIME
Multipart structured content.
|
|
APEXDataMessage(APEXEndpointAddress originator,
HashSet recipients,
MimeMessage mimeContent)
Instantiates a new APEXDataMessage containing MIME
Multipart structured content.
|
|
APEXDataMessage(APEXEndpointAddress originator,
HashSet recipients,
MimeMessage mimeContent,
HashSet options)
Instantiates a new APEXDataMessage containing MIME
Multipart structured content.
|
|
APEXDataMessage(APEXEndpointAddress originator,
HashSet recipients,
String xmlContent)
Instantiates a new APEXDataMessage containing XML
content.
|
|
APEXDataMessage(APEXEndpointAddress originator,
HashSet recipients,
String xmlContent,
HashSet options)
Instantiates a new APEXDataMessage containing XML
content.
|
Method Summary | |
void |
activateFinalAndNonProcessedOptions()
Reactivates final and not processing options before sending a message (only active options are sent to the next hop). |
void |
addContent(Object key,
Object value)
Adds content with an associated key to the content table. |
void |
addOption(APEXOption option)
Adds an option to this message |
void |
addRecipient(APEXEndpointAddress recipient)
Sets the recipient of the message. |
Object |
clone()
|
APEXOption[] |
getAllOptions()
Returns an array containing all options of this message. |
APEXDataMessage |
getAPEXDataMessage(APEXEndpointAddress recipient)
Returns a new APEXDataMessage addressed to the specified
recipient endpoint address. |
APEXDataMessage |
getAPEXDataMessage(HashSet recipients)
Returns a new APEXDataMessage addressed to the specified
set of recipient endpoint addresses. |
Hashtable |
getContent()
Returns the content table of this message. |
Object |
getContent(Object key)
Returns the content in the content table associated to the key. |
String |
getContentID()
Returns the content URI for the starting MIME part |
int |
getContentType()
Returns the content type of this message. |
OutputDataStream |
getDataStream()
Returns the whole message as an OutputDataStream
which is accepted by the Channel.sendMessage method
to send a message over the channel. |
MimeBodyPart |
getMimeContent()
Returns the MIME body part specified by the content ID. |
HashSet |
getOptions()
Returns all options of this message. |
APEXEndpointAddress |
getOriginator()
Returns the originator endpoint address of this message. |
HashSet |
getRecipients()
Returns a set of recpient endpoint addresses of this message. |
APEXEndpointAddress[] |
getRecipientsAddresses()
Returns an array of recpient endpoint addresses of this message. |
Element |
getXMLContent()
Returns the XML content of an XML data message (otherwise null ) |
String |
getXMLMessage()
Returns an XML message of this operation. |
String |
getXMLMessage(HashSet recipients)
Returns an XML message of this data operation for the specified set of recipient endpoint addresses. |
boolean |
hasOriginator()
Returns true if an originator is set, otherwise false . |
boolean |
hasRecipients()
Returns true if at least one recipient is set, otherwise
false . |
void |
removeOptionForProcessing(APEXOption o)
Converts an option to a not processing option (not processed in hops). |
void |
removeOptionPermanently(APEXOption o)
Removes an option from this message. |
void |
removeRecipient(APEXEndpointAddress aea)
Removes a recipient endpoint address from this message. |
void |
setContentID(String contentURI)
Sets the content URI for the starting MIME part. |
void |
setContentType(int type)
Sets the content type of this message (@see APEXMessage). |
void |
setFinalOption(APEXOption o)
Converts an option to a final option (not processed in intermediate hops). |
void |
setMimeContent(MimeMultipart mimeContent)
Sets MIME Multipart content for this message |
void |
setOriginator(APEXEndpointAddress originator)
Sets the originator of the message. |
void |
setPassiveOption(APEXOption o)
Converts an option to a passive option (not sent to next hop). |
void |
setRecipients(HashSet recipients)
Sets the recipients of the message. |
void |
setStringContent(String content)
Sets string content for this message |
void |
setXMLContent(NodeList content)
Sets XML content for this message |
Methods inherited from class ch.epfl.lsr.apex.APEXMessage |
apexMessageFactory, buildMimeBodyPart, getMessage, getMimeMessage, getMimeMultipart, getStatus, hashset2AddressTable, MimeBodyPartToString, setMessage, setStatus, toString |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String ACTIVE
public static final String FINAL
public static final String PASSIV
public static final String NOTPROCESSING
Constructor Detail |
public APEXDataMessage(APEXEndpointAddress originator, HashSet recipients, MimeMessage mimeContent, HashSet options)
Instantiates a new APEXDataMessage
containing MIME
Multipart structured content.
Note: use javax.mail.internet.MimeBodyPart
or javax.mail.internet.MimeMultipart
for the MIME message.
originator
- The originator endpoint addressrecipients
- A set of recipient endpoint addressesmimeContent
- The MIME content of this messageoptions
- A set of optionspublic APEXDataMessage(APEXEndpointAddress originator, HashSet recipients, MimeMessage mimeContent)
Instantiates a new APEXDataMessage
containing MIME
Multipart structured content.
Note: use javax.mail.internet.MimeBodyPart
or javax.mail.internet.MimeMultipart
for the MIME message.
originator
- The originator endpoint addressrecipients
- A set of recipient endpoint addressesmimeContent
- The MIME content of this messagepublic APEXDataMessage(APEXEndpointAddress originator, APEXEndpointAddress recipient, MimeMessage mimeContent)
Instantiates a new APEXDataMessage
containing MIME
Multipart structured content.
Note: use javax.mail.internet.MimeBodyPart
or javax.mail.internet.MimeMultipart
for the MIME message.
originator
- The originator endpoint addressrecipient
- A recipient endpoint addressmimeContent
- The MIME content of this messagepublic APEXDataMessage(APEXEndpointAddress originator, HashSet recipients, byte[] byteContent, String contentType, String transferEncoding, HashSet options) throws APEXParsingException
Instantiates a new APEXDataMessage
containing MIME
Multipart structured content specified in a byte array.
Note: for a correct use, indicate the full transfer encoding used when building the byte array (see documentation).
originator
- The originator endpoint addressrecipients
- A set of recipient endpoint addressesbyteContent
- The byte contentcontentType
- The MIME content-type of the messagetransferEncoding
- The transfer encoding of the byte contentoptions
- A set of options
APEXParsingException
- Thrown if an exception occurs while building the MIME
Multipart messagepublic APEXDataMessage(APEXEndpointAddress originator, HashSet recipients, byte[] byteContent, String contentType, String transferEncoding) throws APEXParsingException
Instantiates a new APEXDataMessage
containing MIME
Multipart structured content specified in a byte array.
Note: for a correct use, indicate the full transfer encoding used when building the byte array (see documentation).
originator
- The originator endpoint addressrecipients
- A set of recipient endpoint addressesbyteContent
- The byte contentcontentType
- The MIME content-type of the messagetransferEncoding
- The transfer encoding of the byte content
APEXParsingException
- Thrown if an exception occurs while building the MIME
Multipart messagepublic APEXDataMessage(APEXEndpointAddress originator, APEXEndpointAddress[] recipients, byte[] byteContent, String contentType, String transferEncoding) throws APEXParsingException
Instantiates a new APEXDataMessage
containing MIME
Multipart structured content specified in a byte array.
Note: for a correct use, indicate the full transfer encoding used when building the byte array (see documentation).
originator
- The originator endpoint addressrecipients
- An array of recipient endpoint addressesbyteContent
- The byte contentcontentType
- The MIME content-type of the messagetransferEncoding
- The transfer encoding of the byte content
APEXParsingException
- Thrown if an exception occurs while building the MIME
Multipart messagepublic APEXDataMessage(APEXEndpointAddress originator, APEXEndpointAddress recipient, byte[] byteContent, String contentType, String transferEncoding) throws APEXParsingException
Instantiates a new APEXDataMessage
containing MIME
Multipart structured content specified in a byte array.
Note: for a correct use, indicate the full transfer encoding used when building the byte array (see documentation).
originator
- The originator endpoint addressrecipient
- A recipient endpoint addressbyteContent
- The byte contentcontentType
- The MIME content-type of the messagetransferEncoding
- The transfer encoding of the byte content
APEXParsingException
- Thrown if an exception occurs while building the MIME
Multipart messagepublic APEXDataMessage(APEXEndpointAddress originator, HashSet recipients, MimeBodyPart mpart) throws APEXParsingException
Instantiates a new APEXDataMessage
containing MIME
Multipart structured content.
originator
- The originator endpoint addressrecipients
- A set of recipient endpoint addressesmpart
- The MIME content of this message
APEXParsingException
- Thrown if an exception occurs while building the MIME
Multipart messagepublic APEXDataMessage(APEXEndpointAddress originator, APEXEndpointAddress recipient, MimeBodyPart mpart) throws APEXParsingException
Instantiates a new APEXDataMessage
containing MIME
Multipart structured content.
originator
- The originator endpoint addressrecipient
- A recipient endpoint addressmpart
- The MIME content of this message
APEXParsingException
- Thrown if an exception occurs while building the MIME
Multipart messagepublic APEXDataMessage(APEXEndpointAddress originator, APEXEndpointAddress[] recipients, MimeBodyPart mpart) throws APEXParsingException
Instantiates a new APEXDataMessage
containing MIME
Multipart structured content.
originator
- The originator endpoint addressrecipients
- An array of recipient endpoint addressesmpart
- The MIME content of this message
APEXParsingException
- Thrown if an exception occurs while building the MIME
Multipart messagepublic APEXDataMessage(APEXEndpointAddress originator, HashSet recipients, String xmlContent, HashSet options)
Instantiates a new APEXDataMessage
containing XML
content.
originator
- The originator endpoint addressrecipients
- A set of recipient endpoint addressesxmlContent
- The XML content of this messageoptions
- A set of optionspublic APEXDataMessage(APEXEndpointAddress originator, APEXEndpointAddress recipient, String xmlContent)
Instantiates a new APEXDataMessage
containing XML
content.
originator
- The originator endpoint addressrecipient
- A recipient endpoint addressxmlContent
- The XML content of this messagepublic APEXDataMessage(APEXEndpointAddress originator, HashSet recipients, String xmlContent)
Instantiates a new APEXDataMessage
containing XML
content.
originator
- The originator endpoint addressrecipients
- A set of recipient endpoint addressesxmlContent
- The XML content of this messagepublic APEXDataMessage(APEXEndpointAddress originator, APEXEndpointAddress[] recipients, String xmlContent)
Instantiates a new APEXDataMessage
containing XML
content.
originator
- The originator endpoint addressrecipients
- An array of recipient endpoint addressesxmlContent
- The XML content of this messagepublic APEXDataMessage()
Instantiates an empty APEXDataMessage
.
Method Detail |
public APEXEndpointAddress getOriginator()
public HashSet getRecipients()
public APEXEndpointAddress[] getRecipientsAddresses()
public Hashtable getContent()
public void setContentID(String contentURI)
contentURI
- The content URIpublic String getContentID()
public Object getContent(Object key)
key
- The key in the content table
public int getContentType()
APEXMessage.XMLCONTENT
,
APEXMessage.MIMECONTENT
public void setFinalOption(APEXOption o)
o
- The option to convertpublic void setPassiveOption(APEXOption o)
o
- The option to convertpublic void removeOptionForProcessing(APEXOption o)
o
- The option to convertpublic void activateFinalAndNonProcessedOptions()
public void removeOptionPermanently(APEXOption o)
o
- The option to be removedpublic void removeRecipient(APEXEndpointAddress aea)
aea
- The endpoint address to be removedpublic HashSet getOptions()
public APEXOption[] getAllOptions()
public Element getXMLContent()
null
)
data
element containing all elementspublic MimeBodyPart getMimeContent()
public void setContentType(int type)
type
- The content typepublic void addContent(Object key, Object value)
key
- The keyvalue
- The value of the contentpublic void addOption(APEXOption option)
option
- An option to be addedpublic void setOriginator(APEXEndpointAddress originator)
originator
- The originator endpoint addresspublic void setRecipients(HashSet recipients)
recipients
- A set of recipient endpoint addressespublic void addRecipient(APEXEndpointAddress recipient)
recipient
- The recipient endpoint addresspublic boolean hasOriginator()
true
if an originator is set, otherwise false
.
public boolean hasRecipients()
true
if at least one recipient is set, otherwise
false
.
public APEXDataMessage getAPEXDataMessage(HashSet recipients)
APEXDataMessage
addressed to the specified
set of recipient endpoint addresses.
recipients
- A set of recpient endpoint addresses
APEXDataMessage
public APEXDataMessage getAPEXDataMessage(APEXEndpointAddress recipient)
APEXDataMessage
addressed to the specified
recipient endpoint address.
recipient
- The recpient endpoint address
APEXDataMessage
public Object clone() throws CloneNotSupportedException
CloneNotSupportedException
public String getXMLMessage(HashSet recipients)
recipients
- A set of recpient endpoint addresses
public String getXMLMessage()
APEXMessage
getXMLMessage
in class APEXMessage
public void setStringContent(String content)
content
- The string contentpublic void setXMLContent(NodeList content)
content
- The XML (NodeList) contentpublic void setMimeContent(MimeMultipart mimeContent)
mimeContent
- The MIME Multipart contentpublic OutputDataStream getDataStream()
APEXMessage
OutputDataStream
which is accepted by the Channel.sendMessage
method
to send a message over the channel.
getDataStream
in class APEXMessage
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |