Search in sources :

Example 6 with AS2InvalidParameterException

use of com.helger.as2lib.params.AS2InvalidParameterException in project as2-lib by phax.

the class AS2SenderModule method checkRequired.

protected void checkRequired(@Nonnull final AS2Message aMsg) throws AS2InvalidParameterException {
    final Partnership aPartnership = aMsg.partnership();
    try {
        AS2InvalidParameterException.checkValue(aMsg, "ContentType", aMsg.getContentType());
        AS2InvalidParameterException.checkValue(aMsg, "Attribute: " + CPartnershipIDs.PA_AS2_URL, aPartnership.getAS2URL());
        AS2InvalidParameterException.checkValue(aMsg, "Receiver: " + CPartnershipIDs.PID_AS2, aPartnership.getReceiverAS2ID());
        AS2InvalidParameterException.checkValue(aMsg, "Sender: " + CPartnershipIDs.PID_AS2, aPartnership.getSenderAS2ID());
        AS2InvalidParameterException.checkValue(aMsg, "Subject", aMsg.getSubject());
        AS2InvalidParameterException.checkValue(aMsg, "Sender: " + CPartnershipIDs.PID_EMAIL, aPartnership.getSenderEmail());
        AS2InvalidParameterException.checkValue(aMsg, "Message Data", aMsg.getData());
    } catch (final AS2InvalidParameterException ex) {
        ex.setSourceMsg(aMsg);
        throw ex;
    }
}
Also used : Partnership(com.helger.as2lib.partner.Partnership) AS2InvalidParameterException(com.helger.as2lib.params.AS2InvalidParameterException)

Aggregations

AS2InvalidParameterException (com.helger.as2lib.params.AS2InvalidParameterException)6 MessageParameters (com.helger.as2lib.params.MessageParameters)2 Partnership (com.helger.as2lib.partner.Partnership)2 File (java.io.File)2 Nonnull (javax.annotation.Nonnull)2 CompositeParameters (com.helger.as2lib.params.CompositeParameters)1 DateParameters (com.helger.as2lib.params.DateParameters)1 RandomParameters (com.helger.as2lib.params.RandomParameters)1 Nonempty (com.helger.commons.annotation.Nonempty)1 ReturnsMutableCopy (com.helger.commons.annotation.ReturnsMutableCopy)1 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)1 ByteArrayDataSource (com.helger.mail.datasource.ByteArrayDataSource)1 MessagingException (javax.mail.MessagingException)1 MimeBodyPart (javax.mail.internet.MimeBodyPart)1