AS2Message¶
-
public class
AS2Message
¶ AS2Message represents an AS2 message.
Author: Hugo Y. K. Lam
Constructors¶
AS2Message¶
-
public
AS2Message
(InputStream message)¶ Creates a new instance of AS2Message.
Parameters: - message – the message as input stream.
Throws: - AS2MessageException – if unable to construct from the given input stream.
AS2Message¶
-
public
AS2Message
(InternetHeaders headers, InputStream content)¶ Creates a new instance of AS2Message.
Parameters: - headers – the headers of this message.
- content – the content stream.
Throws: - AS2MessageException – if unable to construct from the given content stream.
Methods¶
addHeader¶
generateID¶
getBodyPart¶
-
public MimeBodyPart
getBodyPart
()¶ Gets the MIME body part of this message.
Returns: the MIME body part.
getContent¶
-
public Object
getContent
()¶ Gets the content of this message.
Throws: - AS2MessageException – if unable to get the content.
Returns: the content part.
getContentStream¶
-
public InputStream
getContentStream
()¶ Gets the content stream of this message.
Throws: - AS2MessageException – if unable to retrieve the stream.
Returns: the content stream of this message.
getContentType¶
-
public String
getContentType
()¶ Gets the content type.
Throws: - AS2MessageException – if unable to get the content type.
Returns: the content type.
getDispositionNotification¶
-
public DispositionNotification
getDispositionNotification
()¶ Gets the MDN of this message.
Throws: - AS2MessageException – if unable to construct the MDN.
Returns: the MDN.
getDispositionNotificationOptions¶
-
public DispositionNotificationOptions
getDispositionNotificationOptions
()¶ Gets the disposition notification options.
Returns: the disposition notification options.
getFromPartyID¶
getHeader¶
getHeader¶
getHeaders¶
-
public InternetHeaders
getHeaders
()¶ Gets the headers of this message.
Returns: a copy of the headers of this message.
getInputStream¶
-
public InputStream
getInputStream
()¶ Gets the input stream of this message’s content. Any transfer encodings will be decoded before the input stream is provided.
Throws: - AS2MessageException – if unable to retrieve the stream.
Returns: the input stream of this message’s content.
isDispositionNotification¶
-
public boolean
isDispositionNotification
()¶ Checks if this message is an MDN.
Returns: true if this message is an MDN.
isReceiptRequested¶
-
public boolean
isReceiptRequested
()¶ Checks if receipt of message is requested.
Returns: true if receipt of message is requested.
isReceiptSynchronous¶
-
public boolean
isReceiptSynchronous
()¶ Checks if the receipt of message should be sent synchronously.
Returns: true if the receipt of message should be sent synchronously.
removeHeader¶
reply¶
-
public AS2Message
reply
()¶ Replies this message.
Throws: - AS2MessageException – if unable to construct the message.
Returns: the reply message.
setBodyPart¶
-
public void
setBodyPart
(MimeBodyPart bp)¶ Sets the MIME body part of this message.
setContent¶
-
public void
setContent
(Object content, String contentType)¶ Sets a content to this message.
Parameters: - content – the content part.
- contentType – the content type.
Throws: - AS2MessageException – if unable to set the content.
setHeader¶
toByteArray¶
-
public byte[]
toByteArray
()¶ Returns a byte array which represents this message.
Throws: - AS2MessageException – if unable to convert this message into bytes.
Returns: a byte array which represents this message.
toString¶
-
public String
toString
()¶ Returns a string representation of this message.
Returns: a string representation of this message. See also:
java.lang.Object.toString()
writeTo¶
-
public void
writeTo
(OutputStream outs)¶ Writes the message to the given output stream.
Parameters: - outs – the output stream to be written.
Throws: - AS2MessageException – if unable to write the message.