Skip to content

Commit

Permalink
Merge pull request #181 from problemzebra2/180_no_payload
Browse files Browse the repository at this point in the history
Not possible to send BDEW path switch messages because a payload is a…
  • Loading branch information
phax authored Oct 23, 2023
2 parents 40d53f8 + d4bab8b commit f4259e5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ public boolean isEveryRequiredFieldSet ()
LOGGER.warn ("The field 'endpointDetailProvider' is not set");
return false;
}
if (m_aPayload == null)
{
LOGGER.warn ("The field 'payload' is not set");
return false;
}
// m_aCertificateConsumer is optional
// m_aAPEndointURLConsumer is optional

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ public boolean isEveryRequiredFieldSet ()
LOGGER.warn ("The field 'conversationID' must not be changed");
return false;
}
if (m_aPayload == null)
{
LOGGER.warn ("The field 'payload' is not set");
return false;
}

// All valid
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ public boolean isEveryRequiredFieldSet ()
LOGGER.warn ("The field 'endpointDetailProvider' is not set");
return false;
}
if (m_aPayload == null)
{
LOGGER.warn ("The field 'payload' is not set");
return false;
}
// m_aCertificateConsumer is optional
// m_aAPEndointURLConsumer is optional

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static BuilderPullRequest builderPullRequest ()
public static class BuilderUserMessage extends AbstractAS4UserMessageBuilderMIMEPayload <BuilderUserMessage>
{
/**
* Create a new builder, with the some fields already set as outlined in
* Create a new builder, with some fields already set as outlined in
* {@link AbstractAS4UserMessageBuilderMIMEPayload#AbstractAS4UserMessageBuilderMIMEPayload()}
*/
public BuilderUserMessage ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ public abstract class AbstractAS4UserMessageBuilderMIMEPayload <IMPLTYPE extends
{
private static final Logger LOGGER = LoggerFactory.getLogger (AbstractAS4UserMessageBuilderMIMEPayload.class);

private AS4OutgoingAttachment m_aPayload;
protected AS4OutgoingAttachment m_aPayload;

/**
* Create a new builder, with the some fields already set as outlined in
* Create a new builder, with some fields already set as outlined in
* {@link AbstractAS4UserMessageBuilder#AbstractAS4UserMessageBuilder()}
*/
protected AbstractAS4UserMessageBuilderMIMEPayload ()
Expand Down Expand Up @@ -91,17 +91,7 @@ public final IMPLTYPE payload (@Nullable final AS4OutgoingAttachment aPayload)
@OverridingMethodsMustInvokeSuper
public boolean isEveryRequiredFieldSet ()
{
if (!super.isEveryRequiredFieldSet ())
return false;

if (m_aPayload == null)
{
LOGGER.warn ("The field 'payload' is not set");
return false;
}

// All valid
return true;
return super.isEveryRequiredFieldSet();
}

/**
Expand Down Expand Up @@ -182,9 +172,11 @@ protected final void mainSendMessage () throws Phase4Exception

// Add main attachment
{
final WSS4JAttachment aMainAttachment = createMainAttachment (m_aPayload, aResHelper);
if (aMainAttachment != null)
aUserMsg.addAttachment (aMainAttachment);
if (m_aPayload != null) {
final WSS4JAttachment aMainAttachment = createMainAttachment (m_aPayload, aResHelper);
if (aMainAttachment != null)
aUserMsg.addAttachment (aMainAttachment);
}
}

// Add other attachments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,11 @@ public boolean isEveryRequiredFieldSet ()
LOGGER.warn ("The field 'processID' is not set");
return false;
}
if (m_aPayload == null)
{
LOGGER.warn ("The field 'payload' is not set");
return false;
}

// m_sCountryC1 may be null, before 1.1.2024
if (PDTFactory.getCurrentLocalDateUTC ().compareTo (DATE_COUNTRY_C1_BECOMES_MANDATORY) >= 0)
Expand Down

0 comments on commit f4259e5

Please sign in to comment.