Search in sources :

Example 6 with PModeParty

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;
}
Also used : PModeParty(com.helger.phase4.model.pmode.PModeParty) PMode(com.helger.phase4.model.pmode.PMode) Nonnull(javax.annotation.Nonnull)

Example 7 with PModeParty

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;
}
Also used : PModeParty(com.helger.phase4.model.pmode.PModeParty) PMode(com.helger.phase4.model.pmode.PMode) DefaultPMode(com.helger.phase4.model.pmode.DefaultPMode) Nonnull(javax.annotation.Nonnull)

Aggregations

Nonnull (javax.annotation.Nonnull)7 PMode (com.helger.phase4.model.pmode.PMode)5 PModeParty (com.helger.phase4.model.pmode.PModeParty)5 EMEP (com.helger.phase4.model.EMEP)2 EMEPBinding (com.helger.phase4.model.EMEPBinding)2 PModeLeg (com.helger.phase4.model.pmode.leg.PModeLeg)2 IJsonObject (com.helger.json.IJsonObject)1 DefaultPMode (com.helger.phase4.model.pmode.DefaultPMode)1