use of com.helger.phase4.model.pmode.PModeParty in project phase4 by phax.
the class CEFPMode method createCEFPMode.
/**
* One-Way Version of the CEF pmode uses one-way push
*
* @param sInitiatorID
* Initiator ID
* @param sResponderID
* Responder ID
* @param sResponderAddress
* Responder URL
* @param aPModeIDProvider
* PMode ID provider
* @param bPersist
* <code>true</code> to persist the PMode in the PModeManager,
* <code>false</code> to have it only in memory.
* @return New PMode
*/
@Nonnull
public static PMode createCEFPMode(@Nonnull @Nonempty final String sInitiatorID, @Nonnull @Nonempty final String sResponderID, @Nullable final String sResponderAddress, @Nonnull final IPModeIDProvider aPModeIDProvider, final boolean bPersist) {
final PModeParty aInitiator = PModeParty.createSimple(sInitiatorID, CAS4.DEFAULT_INITIATOR_URL);
final PModeParty aResponder = PModeParty.createSimple(sResponderID, CAS4.DEFAULT_RESPONDER_URL);
final PMode aPMode = new PMode(aPModeIDProvider.getPModeID(sInitiatorID, sResponderID), aInitiator, aResponder, DEFAULT_AGREEMENT_ID, EMEP.ONE_WAY, EMEPBinding.PUSH, generatePModeLeg(sResponderAddress), (PModeLeg) null, (PModePayloadService) null, generatePModeReceptionAwareness());
if (bPersist) {
// Ensure it is stored
MetaAS4Manager.getPModeMgr().createOrUpdatePMode(aPMode);
}
return aPMode;
}
use of com.helger.phase4.model.pmode.PModeParty in project phase4 by phax.
the class MockPModeGenerator method getTestPMode.
@Nonnull
public static PMode getTestPMode(@Nonnull final ESoapVersion eSOAPVersion) {
final PModeParty aInitiator = _createInitiatorOrResponder(true, eSOAPVersion);
final PModeParty aResponder = _createInitiatorOrResponder(false, eSOAPVersion);
final PMode aConfig = new PMode(IPModeIDProvider.DEFAULT_DYNAMIC.getPModeID(aInitiator.getID(), aResponder.getID()), aInitiator, aResponder, DEFAULT_AGREEMENT, EMEP.ONE_WAY, EMEPBinding.PUSH, _createPModeLeg(eSOAPVersion), null, null, null);
// Leg 2 stays null, because we only use one-way
return aConfig;
}
Aggregations