Skip to content

Commit

Permalink
Merge pull request #251 from koreiffer/master
Browse files Browse the repository at this point in the history
added action and service as parameter to createBDEWPMode
  • Loading branch information
phax authored Jul 29, 2024
2 parents a17024d + 952585a commit d73aa5e
Showing 1 changed file with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ public static PModeLegBusinessInformation generatePModeLegBusinessInformation ()
return PModeLegBusinessInformation.create (sService, sAction, nPayloadProfileMaxKB, sMPCID);
}

@Nonnull
public static PModeLegBusinessInformation generatePModeLegBusinessInformation (final String sService, final String sAction)
{
final Long nPayloadProfileMaxKB = null;
final String sMPCID = CAS4.DEFAULT_MPC_ID;
return PModeLegBusinessInformation.create (sService, sAction, nPayloadProfileMaxKB, sMPCID);
}

@Nonnull
public static PModeLegErrorHandling generatePModeLegErrorHandling ()
{
Expand Down Expand Up @@ -153,6 +161,16 @@ public static PModeLeg generatePModeLeg (@Nullable final String sResponderAddres
generatePModeLegSecurity ());
}

@Nonnull
public static PModeLeg generatePModeLeg (@Nullable final String sResponderAddress, final String sService, final String sAction)
{
return new PModeLeg (generatePModeLegProtocol (sResponderAddress),
generatePModeLegBusinessInformation (sService, sAction),
generatePModeLegErrorHandling (),
null,
generatePModeLegSecurity ());
}

@Nonnull
public static PModePayloadService generatePModePayloadSevice ()
{
Expand Down Expand Up @@ -226,6 +244,40 @@ public static PMode createBDEWPMode (@Nonnull @Nonempty final String sInitiatorI
}
return aPMode;
}
@Nonnull
public static PMode createBDEWPMode (@Nonnull @Nonempty final String sInitiatorID,
@Nonnull @Nonempty final String sInitiatorType,
@Nonnull @Nonempty final String sResponderID,
@Nonnull @Nonempty final String sResponderType,
@Nonnull @Nonempty final String sService,
@Nonnull @Nonempty final String sAction,
@Nullable final String sResponderAddress,
@Nonnull final IPModeIDProvider aPModeIDProvider,
final boolean bPersist)
{
final PModeParty aInitiator = new PModeParty (sInitiatorType, sInitiatorID, CAS4.DEFAULT_INITIATOR_URL, null, null);
final PModeParty aResponder = new PModeParty (sResponderType, sResponderID, CAS4.DEFAULT_RESPONDER_URL, null, null);

final PMode aPMode = new PMode (aPModeIDProvider.getPModeID (aInitiator, aResponder),
aInitiator,
aResponder,
DEFAULT_AGREEMENT_ID,
EMEP.ONE_WAY,
EMEPBinding.PUSH,
generatePModeLeg (sResponderAddress, sService, sAction),
null,
generatePModePayloadSevice (),
generatePModeReceptionAwareness ());

// Leg 2 stays null, because we only use one-way

if (bPersist)
{
// Ensure it is stored
MetaAS4Manager.getPModeMgr ().createOrUpdatePMode (aPMode);
}
return aPMode;
}

public static boolean containsService (@Nonnull final String sService)
{
Expand Down

0 comments on commit d73aa5e

Please sign in to comment.