use of com.helger.phase4.model.MessageProperty in project phase4 by phax.
the class AbstractAS4UserMessageBuilder method applyToUserMessage.
/**
* This method applies all builder parameters onto the user message, except
* the attachments.
*
* @param aUserMsg
* The user message the parameters should be applied to. May not be
* <code>null</code>.
*/
@OverridingMethodsMustInvokeSuper
protected void applyToUserMessage(@Nonnull final AS4ClientUserMessage aUserMsg) {
if (m_aHttpRetrySettings != null)
aUserMsg.httpRetrySettings().assignFrom(m_aHttpRetrySettings);
aUserMsg.getHttpPoster().setHttpClientFactory(m_aHttpClientFactory);
// Otherwise Oxalis dies
aUserMsg.getHttpPoster().setQuoteHttpHeaders(false);
aUserMsg.setSoapVersion(m_eSoapVersion);
aUserMsg.setSendingDateTimeOrNow(m_aSendingDateTime);
// Set the keystore/truststore parameters
aUserMsg.setAS4CryptoFactory(m_aCryptoFactory);
aUserMsg.setPMode(m_aPMode, true);
// Set after PMode
if (m_aReceiverCertificate != null)
aUserMsg.cryptParams().setCertificate(m_aReceiverCertificate);
aUserMsg.setAgreementRefValue(m_sAgreementRef);
if (StringHelper.hasText(m_sPModeID))
aUserMsg.setPModeID(m_sPModeID);
else
aUserMsg.setPModeIDFactory(x -> null);
aUserMsg.setServiceType(m_sServiceType);
aUserMsg.setServiceValue(m_sService);
aUserMsg.setAction(m_sAction);
if (StringHelper.hasText(m_sMessageID))
aUserMsg.setMessageID(m_sMessageID);
if (StringHelper.hasText(m_sRefToMessageID))
aUserMsg.setRefToMessageID(m_sRefToMessageID);
// Empty conversation ID is okay
aUserMsg.setConversationID(m_sConversationID != null ? m_sConversationID : MessageHelperMethods.createRandomConversationID());
aUserMsg.setFromPartyIDType(m_sFromPartyIDType);
aUserMsg.setFromPartyID(m_sFromPartyID);
aUserMsg.setFromRole(m_sFromRole);
aUserMsg.setToPartyIDType(m_sToPartyIDType);
aUserMsg.setToPartyID(m_sToPartyID);
aUserMsg.setToRole(m_sToRole);
for (final MessageProperty aItem : m_aMessageProperties) aUserMsg.ebms3Properties().add(aItem.getAsEbms3Property());
}
Aggregations