|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.epfl.lsr.apex.APEXMessage
An APEXMessage
is an abstract class identifying an APEX
message.
In order to obtain a data message to send over the APEX mesh, a new APEXDataMessage
must be instantiated.
A APEXMessage is either:
APEXAttachMessage
,APEXBindMessage
,APEXTerminateMessage
, orAPEXDataMessage
which may contain either
APEXMessage.XMLCONTENT
)
APEXMessage.MIMECONTENT
)
APEXAttachMessage
,
APEXBindMessage
,
APEXTerminateMessage
,
APEXDataMessage
,
APEXDataMessage.getContentType()
Field Summary | |
static String |
APPBEEPXML
MIME identifier for APPLICATION/BEEP+XML messages |
static int |
ATTACH
Message type: attach message |
static String |
BEEPXML
MIME identifier for BEEP+XML messages |
static int |
BIND
Message type: bind message |
static String |
CONTENTTRANSFERENCODING
Content-Transfer-Encoding identifier |
static String |
CONTENTTYPE
Content-Type identifier |
static int |
DATA
Message type: data message |
static String |
ENC_7BIT
Encoding type for 7 bit |
static String |
ENC_8BIT
Encoding type for 8 bit |
static String |
ENC_BASE64
Encoding type for base 64 |
static String |
ENC_BINARY
Encoding type for binary content |
static String |
ENC_QUOTEDPRINTABLE
Encoding type for quoted printable |
static String |
ENC_UUENCODE
Encoding type for UUEncode |
static int |
ERROR
Message type: error message |
static String |
FILENAME
Filename identifier |
protected MessageMSG |
message
the received org.beepcore.beep.core.MessageMSG message |
static int |
MIMECONTENT
Content Type of this message: MIME Multipart structured content |
static String |
MIMECONTENT_HASHKEY
Table key for MIME content |
static int |
OK
Message type: ok message |
static String |
RELATED
MIME identifier for multipart/related |
static String |
START
start identifier |
static String |
START_HASHKEY
Table key for start identifier |
protected APEXStatus |
status
an optional APEX status associated to this message |
static int |
STRINGCONTENT
Content Type of this message: String content (only for instantiation) |
static String |
STRINGCONTENT_HASHKEY
Table key for String content |
static int |
TERMINATE
Message type: terminate message |
static String |
TYPE
type identifier |
static int |
XMLCONTENT
Content Type of this message: XML content |
static String |
XMLCONTENT_HASHKEY
Table key for XML content |
Constructor Summary | |
APEXMessage()
|
Method Summary | |
static APEXMessage |
apexMessageFactory(MessageMSG message)
Accepts an incoming org.beepcore.beep.core.MessageMSG and
parses this object in order to extract a complete APEXMessage .
|
static MimeBodyPart |
buildMimeBodyPart(String content)
Builds a MIME body part of a textual String and adds the BEEP headers (beep-xml) for Content-Type |
OutputDataStream |
getDataStream()
Returns the whole message as an OutputDataStream
which is accepted by the Channel.sendMessage method
to send a message over the channel. |
MessageMSG |
getMessage()
Returns the org.beepcore.beep.core.MessageMSG associated to this message (used internally for processing). |
static MimeMessage |
getMimeMessage(MimeMultipart mmp)
Converts a MIME Multipart in a fully defined MIME message. |
static MimeMultipart |
getMimeMultipart(MimeBodyPart part1,
MimeBodyPart part2)
Relates ( multipart/related ) two MIME body parts
in one MIME Multipart. |
APEXStatus |
getStatus()
Returns the status listener for this message. |
abstract String |
getXMLMessage()
Returns an XML message of this operation. |
static APEXEndpointAddress[] |
hashset2AddressTable(HashSet recipientSet)
Converts a HashSet containing APEXEndpointAddress es
into an array. |
static String |
MimeBodyPartToString(MimeBodyPart mbp)
Converts a MimeBodyPart to a String . |
void |
setMessage(MessageMSG m)
Adds a org.beepcore.beep.core.MessageMSG message to this message (used internally for processing). |
void |
setStatus(APEXStatus s)
Sets a status listener for this message. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String BEEPXML
public static final String APPBEEPXML
public static final String START
public static final String TYPE
public static final String CONTENTTYPE
public static final String RELATED
public static final String CONTENTTRANSFERENCODING
public static final String FILENAME
public static final String ENC_BASE64
public static final String ENC_7BIT
public static final String ENC_8BIT
public static final String ENC_BINARY
public static final String ENC_UUENCODE
public static final String ENC_QUOTEDPRINTABLE
public static final int ATTACH
public static final int BIND
public static final int TERMINATE
public static final int DATA
public static final int OK
public static final int ERROR
public static final int XMLCONTENT
public static final int STRINGCONTENT
public static final int MIMECONTENT
public static final String XMLCONTENT_HASHKEY
public static final String STRINGCONTENT_HASHKEY
public static final String MIMECONTENT_HASHKEY
public static final String START_HASHKEY
protected MessageMSG message
protected APEXStatus status
Constructor Detail |
public APEXMessage()
Method Detail |
public void setMessage(MessageMSG m)
m
- The received messageMSGpublic MessageMSG getMessage()
public void setStatus(APEXStatus s)
s
- The status listenerpublic APEXStatus getStatus()
public abstract String getXMLMessage()
public static APEXEndpointAddress[] hashset2AddressTable(HashSet recipientSet)
HashSet
containing APEXEndpointAddress
es
into an array.
recipientSet
- The APEXEndpointAddress
HashSet
APEXEndpointAddresses
espublic static MimeBodyPart buildMimeBodyPart(String content) throws MessagingException
Content-Type
content
- The String
MessagingException
public static MimeMultipart getMimeMultipart(MimeBodyPart part1, MimeBodyPart part2) throws MessagingException
multipart/related
) two MIME body parts
in one MIME Multipart.
part1
- First MIME body partpart2
- Second MIME body part
MessagingException
- Thrown on exceptions in MimeMultipartpublic static String MimeBodyPartToString(MimeBodyPart mbp)
MimeBodyPart
to a String
.
mbp
- The MimeBodyPart
String
public OutputDataStream getDataStream()
OutputDataStream
which is accepted by the Channel.sendMessage
method
to send a message over the channel.
public static MimeMessage getMimeMessage(MimeMultipart mmp) throws MessagingException
mmp
- The MIME Multipart
MessagingException
- Thrown on conversion by the javax.mail.mime packagepublic static APEXMessage apexMessageFactory(MessageMSG message) throws APEXParsingException
Accepts an incoming org.beepcore.beep.core.MessageMSG
and
parses this object in order to extract a complete APEXMessage
.
This method either generates
APEXAttachMessage
,APEXBindMessage
,APEXTerminateMessage
, orAPEXDataMessage
which may contain either
APEXMessage.XMLCONTENT
)
APEXMessage.MIMECONTENT
)
message
- The MessageMSG message
APEXParsingException
- Thrown if the format of the message is not validAPEXAttachMessage
,
APEXBindMessage
,
APEXTerminateMessage
,
APEXDataMessage
,
APEXDataMessage.getContentType()
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |