Package network.oxalis.as2.util
Class MdnMimeMessageInspector
- java.lang.Object
-
- network.oxalis.as2.util.MdnMimeMessageInspector
-
public class MdnMimeMessageInspector extends Object
Inspects the various properties and parts of an MDN wrapped in a S/MIME message.This class is typically used by the sender of the business message, which will receive an MDN from the receiving party.
Part 0 : multipart/report; report-type=disposition-notification; 0 : Sub part 0 : text/plain 0 : Sub part 1 : message/disposition-notification 0 : Sub part x : will not be used by Oxalis Part 1 : application/pkcs7-signature; name=smime.p7s; smime-type=signed-data
- Since:
- 5.0.0
- Author:
- steinar, thore, aaron-kumar
-
-
Constructor Summary
Constructors Constructor Description MdnMimeMessageInspector(javax.mail.internet.MimeMessage mdnMimeMessage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>getMdnFields()javax.mail.BodyPartgetMessageDispositionNotificationPart()We search for the first message/disposition-notification part.javax.mail.internet.MimeMultipartgetMultipartReport()The multipart/report should contain both a text/plain part with textual information and a message/disposition-notification part that should be examined for error/failure/warning.javax.mail.BodyPartgetPlainTextBodyPart()We assume that the first text/plain part is the one containing any textual information.StringgetPlainTextPartAsText()javax.mail.internet.MimeMultipartgetSignedMultiPart()booleanisOkOrWarning(Mic outboundMic)Decode MDN and make sure the message was processed (allow for warnings)
-
-
-
Method Detail
-
getSignedMultiPart
public javax.mail.internet.MimeMultipart getSignedMultiPart()
-
getMultipartReport
public javax.mail.internet.MimeMultipart getMultipartReport()
The multipart/report should contain both a text/plain part with textual information and a message/disposition-notification part that should be examined for error/failure/warning.
-
getPlainTextBodyPart
public javax.mail.BodyPart getPlainTextBodyPart()
We assume that the first text/plain part is the one containing any textual information.
-
getMessageDispositionNotificationPart
public javax.mail.BodyPart getMessageDispositionNotificationPart()
We search for the first message/disposition-notification part. If we don't find one of that type we assume that part 2 is the right one.
-
getPlainTextPartAsText
public String getPlainTextPartAsText()
-
isOkOrWarning
public boolean isOkOrWarning(Mic outboundMic) throws NoSuchAlgorithmException
Decode MDN and make sure the message was processed (allow for warnings)- Parameters:
outboundMic- the outbound mic to verify against- Throws:
NoSuchAlgorithmException
-
-