Search in sources :

Example 1 with InvalidParameterException

use of com.helger.as2lib.params.InvalidParameterException in project as2-server by phax.

the class MainTestClient method checkRequired.

protected static void checkRequired(final IMessage aMsg) {
    final Partnership aPartnership = aMsg.partnership();
    try {
        InvalidParameterException.checkValue(aMsg, "ContentType", aMsg.getContentType());
        InvalidParameterException.checkValue(aMsg, "Attribute: " + CPartnershipIDs.PA_AS2_URL, aPartnership.getAS2URL());
        InvalidParameterException.checkValue(aMsg, "Receiver: " + CPartnershipIDs.PID_AS2, aPartnership.getReceiverAS2ID());
        InvalidParameterException.checkValue(aMsg, "Sender: " + CPartnershipIDs.PID_AS2, aPartnership.getSenderAS2ID());
        InvalidParameterException.checkValue(aMsg, "Subject", aMsg.getSubject());
        InvalidParameterException.checkValue(aMsg, "Sender: " + CPartnershipIDs.PID_EMAIL, aPartnership.getSenderEmail());
        InvalidParameterException.checkValue(aMsg, "Message Data", aMsg.getData());
    } catch (final InvalidParameterException rpe) {
        rpe.addSource(OpenAS2Exception.SOURCE_MESSAGE, aMsg);
    }
}
Also used : InvalidParameterException(com.helger.as2lib.params.InvalidParameterException) Partnership(com.helger.as2lib.partner.Partnership)

Aggregations

InvalidParameterException (com.helger.as2lib.params.InvalidParameterException)1 Partnership (com.helger.as2lib.partner.Partnership)1