Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ public interface IOutboundTransactionManager
* @param sPayloadMimeType
* MIME type for binary payloads (e.g. {@code application/pdf}). May be <code>null</code>
* for XML payloads.
* @param sCustom1
* First optional custom field (max 255 characters). May be <code>null</code>.
* @param sCustom2
* Second optional custom field (max 255 characters). May be <code>null</code>.
* @param sCustom3
* Third optional custom field (max 255 characters). May be <code>null</code>.
* @return The ID of the created transaction. Only <code>null</code> if insertion fails.
*/
@Nullable
Expand All @@ -103,7 +109,10 @@ String create (@NonNull ETransactionType eTransactionType,
@Nullable String sSbdhStandard,
@Nullable String sSbdhTypeVersion,
@Nullable String sSbdhType,
@Nullable String sPayloadMimeType);
@Nullable String sPayloadMimeType,
@Nullable String sCustom1,
@Nullable String sCustom2,
@Nullable String sCustom3);

/**
* Look up a transaction by its unique ID.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ public class OutboundS3SubmitRequest
example = "application/pdf")
private String payloadMimeType;

@Schema (description = "Optional custom field 1 (max 255 characters). Stored with the transaction and returned by the status APIs.")
private String custom1;

@Schema (description = "Optional custom field 2 (max 255 characters). Stored with the transaction and returned by the status APIs.")
private String custom2;

@Schema (description = "Optional custom field 3 (max 255 characters). Stored with the transaction and returned by the status APIs.")
private String custom3;

/** @return the sender participant ID */
public String getSenderID ()
{
Expand Down Expand Up @@ -278,4 +287,49 @@ public void setPayloadMimeType (final String s)
{
payloadMimeType = s;
}

/** @return the optional custom field 1 */
public String getCustom1 ()
{
return custom1;
}

/**
* @param s
* The custom field 1 to set.
*/
public void setCustom1 (final String s)
{
custom1 = s;
}

/** @return the optional custom field 2 */
public String getCustom2 ()
{
return custom2;
}

/**
* @param s
* The custom field 2 to set.
*/
public void setCustom2 (final String s)
{
custom2 = s;
}

/** @return the optional custom field 3 */
public String getCustom3 ()
{
return custom3;
}

/**
* @param s
* The custom field 3 to set.
*/
public void setCustom3 (final String s)
{
custom3 = s;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ public class OutboundTransactionResponse
nullable = true)
private String mlsStatus;

@Schema (description = "First optional custom field (max 255 characters); null if not set", nullable = true)
private String custom1;

@Schema (description = "Second optional custom field (max 255 characters); null if not set", nullable = true)
private String custom2;

@Schema (description = "Third optional custom field (max 255 characters); null if not set", nullable = true)
private String custom3;

/**
* Default constructor for JSON deserialization.
*/
Expand Down Expand Up @@ -119,6 +128,9 @@ public static OutboundTransactionResponse fromDomain (@NonNull final IOutboundTr
aResp.nextRetryDT = aTx.getNextRetryDT () != null ? aTx.getNextRetryDT ().toString () : null;
aResp.errorDetails = aTx.getErrorDetails ();
aResp.mlsStatus = aTx.getMlsStatus () != null ? aTx.getMlsStatus ().getID () : null;
aResp.custom1 = aTx.getCustom1 ();
aResp.custom2 = aTx.getCustom2 ();
aResp.custom3 = aTx.getCustom3 ();
return aResp;
}

Expand Down Expand Up @@ -346,4 +358,49 @@ public void setMlsStatus (final String s)
{
mlsStatus = s;
}

/** @return the first custom field */
public String getCustom1 ()
{
return custom1;
}

/**
* @param s
* The first custom field to set.
*/
public void setCustom1 (final String s)
{
custom1 = s;
}

/** @return the second custom field */
public String getCustom2 ()
{
return custom2;
}

/**
* @param s
* The second custom field to set.
*/
public void setCustom2 (final String s)
{
custom2 = s;
}

/** @return the third custom field */
public String getCustom3 ()
{
return custom3;
}

/**
* @param s
* The third custom field to set.
*/
public void setCustom3 (final String s)
{
custom3 = s;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,22 @@ public interface IOutboundTransaction extends IHasID <String>
*/
@Nullable
String getPayloadMimeType ();

/**
* @return The first optional custom field (max 255 characters), or <code>null</code> if not set.
*/
@Nullable
String getCustom1 ();

/**
* @return The second optional custom field (max 255 characters), or <code>null</code> if not set.
*/
@Nullable
String getCustom2 ();

/**
* @return The third optional custom field (max 255 characters), or <code>null</code> if not set.
*/
@Nullable
String getCustom3 ();
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public void testDefaultConstructor ()
assertNull (a.getSbdhTypeVersion ());
assertNull (a.getSbdhType ());
assertNull (a.getPayloadMimeType ());
assertNull (a.getCustom1 ());
assertNull (a.getCustom2 ());
assertNull (a.getCustom3 ());
}

@Test
Expand All @@ -64,6 +67,9 @@ public void testSetters ()
a.setSbdhTypeVersion ("1.0");
a.setSbdhType ("type1");
a.setPayloadMimeType ("application/pdf");
a.setCustom1 ("c1");
a.setCustom2 ("c2");
a.setCustom3 ("c3");

assertEquals ("sender1", a.getSenderID ());
assertEquals ("receiver1", a.getReceiverID ());
Expand All @@ -78,5 +84,8 @@ public void testSetters ()
assertEquals ("1.0", a.getSbdhTypeVersion ());
assertEquals ("type1", a.getSbdhType ());
assertEquals ("application/pdf", a.getPayloadMimeType ());
assertEquals ("c1", a.getCustom1 ());
assertEquals ("c2", a.getCustom2 ());
assertEquals ("c3", a.getCustom3 ());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public void testDefaultConstructor ()
assertNull (a.getNextRetryDT ());
assertNull (a.getErrorDetails ());
assertNull (a.getMlsStatus ());
assertNull (a.getCustom1 ());
assertNull (a.getCustom2 ());
assertNull (a.getCustom3 ());
}

@Test
Expand All @@ -81,6 +84,9 @@ public void testSettersAndGetters ()
a.setNextRetryDT ("2026-03-29T11:00:00Z");
a.setErrorDetails ("some error");
a.setMlsStatus ("received_ap");
a.setCustom1 ("c1");
a.setCustom2 ("c2");
a.setCustom3 ("c3");

assertEquals ("id1", a.getID ());
assertEquals ("business_document", a.getTransactionType ());
Expand All @@ -97,6 +103,9 @@ public void testSettersAndGetters ()
assertEquals ("2026-03-29T11:00:00Z", a.getNextRetryDT ());
assertEquals ("some error", a.getErrorDetails ());
assertEquals ("received_ap", a.getMlsStatus ());
assertEquals ("c1", a.getCustom1 ());
assertEquals ("c2", a.getCustom2 ());
assertEquals ("c3", a.getCustom3 ());
}

@Test
Expand Down Expand Up @@ -133,7 +142,10 @@ public void testFromDomainAllFieldsPopulated ()
null,
null,
null,
null);
null,
"custom-a",
"custom-b",
"custom-c");

final OutboundTransactionResponse aResp = OutboundTransactionResponse.fromDomain (aTx);
assertNotNull (aResp);
Expand All @@ -152,6 +164,9 @@ public void testFromDomainAllFieldsPopulated ()
assertNotNull (aResp.getNextRetryDT ());
assertEquals ("err details", aResp.getErrorDetails ());
assertEquals ("received_ap", aResp.getMlsStatus ());
assertEquals ("custom-a", aResp.getCustom1 ());
assertEquals ("custom-b", aResp.getCustom2 ());
assertEquals ("custom-c", aResp.getCustom3 ());
}

@Test
Expand Down Expand Up @@ -186,6 +201,9 @@ public void testFromDomainNullableFieldsNull ()
null,
null,
null,
null,
null,
null,
null);

final OutboundTransactionResponse aResp = OutboundTransactionResponse.fromDomain (aTx);
Expand Down Expand Up @@ -228,7 +246,10 @@ private static IOutboundTransaction _createMock (@NonNull final String sID,
@Nullable final String sSbdhStandard,
@Nullable final String sSbdhTypeVersion,
@Nullable final String sSbdhType,
@Nullable final String sPayloadMimeType)
@Nullable final String sPayloadMimeType,
@Nullable final String sCustom1,
@Nullable final String sCustom2,
@Nullable final String sCustom3)
{
return new IOutboundTransaction ()
{
Expand Down Expand Up @@ -260,6 +281,9 @@ private static IOutboundTransaction _createMock (@NonNull final String sID,
public String getSbdhTypeVersion () { return sSbdhTypeVersion; }
public String getSbdhType () { return sSbdhType; }
public String getPayloadMimeType () { return sPayloadMimeType; }
public String getCustom1 () { return sCustom1; }
public String getCustom2 () { return sCustom2; }
public String getCustom3 () { return sCustom3; }
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ public static ESuccess triggerSendingInboundResultMls (@NonNull final IInboundTr
final String sSbdhType = null;
final String sPayloadMimeType = null;

// Custom fields do not apply to system-generated MLS responses
final String sCustom1 = null;
final String sCustom2 = null;
final String sCustom3 = null;

// Create outbound transaction
final String sMlsTxID = aOutboundMgr.create (ETransactionType.MLS_RESPONSE,
aMLSSenderPID.getURIEncoded (),
Expand All @@ -231,7 +236,10 @@ public static ESuccess triggerSendingInboundResultMls (@NonNull final IInboundTr
sSbdhStandard,
sSbdhTypeVersion,
sSbdhType,
sPayloadMimeType);
sPayloadMimeType,
sCustom1,
sCustom2,
sCustom3);
final var aMlsTx = aOutboundMgr.getByID (sMlsTxID);
if (aMlsTx == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ private OutboundOrchestrator ()
* @param sPayloadMimeType
* Optional payload MIME type (e.g. "application/pdf"). May be <code>null</code> for XML
* payloads.
* @param sCustom1
* First optional custom field (max 255 characters). May be <code>null</code>.
* @param sCustom2
* Second optional custom field (max 255 characters). May be <code>null</code>.
* @param sCustom3
* Third optional custom field (max 255 characters). May be <code>null</code>.
* @return The created {@link IOutboundTransaction} or <code>null</code> if the document could not
* be stored or verification failed.
*/
Expand All @@ -157,7 +163,10 @@ public static IOutboundTransaction submitRawDocument (@NonNull final String sLog
@Nullable final String sSbdhStandard,
@Nullable final String sSbdhTypeVersion,
@Nullable final String sSbdhType,
@Nullable final String sPayloadMimeType)
@Nullable final String sPayloadMimeType,
@Nullable final String sCustom1,
@Nullable final String sCustom2,
@Nullable final String sCustom3)
{
LOGGER.info (sLogPrefix + "Submitting raw document with SBDH Instance ID '" + sSbdhInstanceID + "'");

Expand Down Expand Up @@ -263,7 +272,10 @@ public static IOutboundTransaction submitRawDocument (@NonNull final String sLog
sSbdhStandard,
sSbdhTypeVersion,
sSbdhType,
sPayloadMimeType);
sPayloadMimeType,
sCustom1,
sCustom2,
sCustom3);
for (final var aHandler : APCoreMetaManager.getAllLifecycleHandlers ())
aHandler.onOutboundDocumentAccepted (sTransactionID,
aSenderID.getURIEncoded (),
Expand All @@ -285,13 +297,22 @@ public static IOutboundTransaction submitRawDocument (@NonNull final String sLog
* The input stream containing the complete pre-built SBD. May not be <code>null</code>.
* @param sMlsTo
* Optional MLS "To" address. May be <code>null</code>.
* @param sCustom1
* First optional custom field (max 255 characters). May be <code>null</code>.
* @param sCustom2
* Second optional custom field (max 255 characters). May be <code>null</code>.
* @param sCustom3
* Third optional custom field (max 255 characters). May be <code>null</code>.
* @return The created {@link IOutboundTransaction} or <code>null</code> if the SBD could not be
* parsed.
*/
@Nullable
public static IOutboundTransaction submitPrebuiltSBD (@NonNull final String sLogPrefix,
@NonNull final InputStream aSbdIS,
@Nullable final String sMlsTo)
@Nullable final String sMlsTo,
@Nullable final String sCustom1,
@Nullable final String sCustom2,
@Nullable final String sCustom3)
{
LOGGER.info (sLogPrefix + "Submitting pre-built SBD");

Expand Down Expand Up @@ -403,7 +424,10 @@ public static IOutboundTransaction submitPrebuiltSBD (@NonNull final String sLog
sSbdhStandard,
sSbdhTypeVersion,
sSbdhType,
sPayloadMimeType);
sPayloadMimeType,
sCustom1,
sCustom2,
sCustom3);
for (final var aHandler : APCoreMetaManager.getAllLifecycleHandlers ())
aHandler.onOutboundDocumentAccepted (sTransactionID,
aSbdData.getSenderURIEncoded (),
Expand Down
Loading
Loading