Search in sources :

Example 26 with ETriState

use of com.helger.commons.state.ETriState in project phase4 by phax.

the class PModeLegErrorHandlingMicroTypeConverter method convertToNative.

@Nonnull
public PModeLegErrorHandling convertToNative(@Nonnull final IMicroElement aElement) {
    final PModeAddressList aReceiverAddresses = MicroTypeConverter.convertToNative(aElement.getFirstChildElement(ELEMENT_REPORT_RECEIVER_ERRORS_TO), PModeAddressList.class);
    final PModeAddressList aSenderAddresses = MicroTypeConverter.convertToNative(aElement.getFirstChildElement(ELEMENT_REPORT_SENDER_ERRORS_TO), PModeAddressList.class);
    final ETriState eReportAsResponse = getTriState(aElement.getAttributeValue(ATTR_REPORT_AS_RESPONSE), PModeLegSecurity.DEFAULT_PMODE_AUTHORIZE);
    final ETriState eReportProcessErrorNotifyConsumer = getTriState(aElement.getAttributeValue(ATTR_REPORT_PROCESS_ERROR_NOTFIY_CONSUMER), PModeLegSecurity.DEFAULT_USERNAME_TOKEN_CREATED);
    final ETriState eReportProcessErrorNotifyProducer = getTriState(aElement.getAttributeValue(ATTR_REPORT_PROCESS_ERROR_NOTFIY_PRODUCER), PModeLegSecurity.DEFAULT_USERNAME_TOKEN_DIGEST);
    final ETriState eReportDeliveryFailuresNotifyProducer = getTriState(aElement.getAttributeValue(ATTR_REPORT_DELIVERY_FAILURE_NOTFIY_PRODUCER), PModeLegSecurity.DEFAULT_SEND_RECEIPT);
    return new PModeLegErrorHandling(aReceiverAddresses, aSenderAddresses, eReportAsResponse, eReportProcessErrorNotifyConsumer, eReportProcessErrorNotifyProducer, eReportDeliveryFailuresNotifyProducer);
}
Also used : ETriState(com.helger.commons.state.ETriState) Nonnull(javax.annotation.Nonnull)

Example 27 with ETriState

use of com.helger.commons.state.ETriState in project phase4 by phax.

the class PModeLegReliabilityJsonConverter method convertToNative.

@Nonnull
public static PModeLegReliability convertToNative(@Nonnull final IJsonObject aElement) {
    final ETriState eAtLeastOnceContract = AbstractPModeMicroTypeConverter.getTriState(aElement.getAsString(AT_LEAST_ONCE_CONTRACT), PModeLegReliability.DEFAULT_AT_LEAST_ONCE_CONTRACT);
    final ETriState eAtLeastOnceAckOnDelivery = AbstractPModeMicroTypeConverter.getTriState(aElement.getAsString(AT_LEAST_ONCE_ACK_ON_DELIVERY), PModeLegReliability.DEFAULT_AT_LEAST_ONCE_ACK_ON_DELIVERY);
    final String sAtLeastOnceContractAcksTo = aElement.getAsString(AT_LEAST_ONCE_CONTRACT_ACK_TO);
    final ETriState eAtLeastOnceContractAckResponse = AbstractPModeMicroTypeConverter.getTriState(aElement.getAsString(AT_LEAST_ONCE_CONTRACT_ACK_RESPONSE), PModeLegReliability.DEFAULT_AT_LEAST_ONCE_CONTRACT_ACK_RESPONSE);
    final String sAtLeastOnceReplyPattern = aElement.getAsString(AT_LEAST_ONCE_REPLY_PATTERN);
    final ETriState eAtMostOnceContract = AbstractPModeMicroTypeConverter.getTriState(aElement.getAsString(AT_MOST_ONCE_CONTRACT), PModeLegReliability.DEFAULT_AT_MOST_ONCE_CONTRACT);
    final ETriState eInOrderContract = AbstractPModeMicroTypeConverter.getTriState(aElement.getAsString(IN_ORDER_CONTRACT), PModeLegReliability.DEFAULT_IN_ORDER_CONTACT);
    final ETriState eStartGroup = AbstractPModeMicroTypeConverter.getTriState(aElement.getAsString(START_GROUP), PModeLegReliability.DEFAULT_START_GROUP);
    final ICommonsList<String> aCorrelationStrings = new CommonsArrayList<>();
    final IJsonArray aCorrelation = aElement.getAsArray(CORRELATION);
    if (aCorrelation != null)
        for (final IJsonValue aCorrelationElement : aCorrelation.iteratorValues()) aCorrelationStrings.add(aCorrelationElement.getAsString());
    final ETriState eTerminateGroup = AbstractPModeMicroTypeConverter.getTriState(aElement.getAsString(TERMINATE_GROUP), PModeLegReliability.DEFAULT_TERMINATE_GROUP);
    return new PModeLegReliability(eAtLeastOnceContract, eAtLeastOnceAckOnDelivery, sAtLeastOnceContractAcksTo, eAtLeastOnceContractAckResponse, sAtLeastOnceReplyPattern, eAtMostOnceContract, eInOrderContract, eStartGroup, aCorrelationStrings, eTerminateGroup);
}
Also used : IJsonValue(com.helger.json.IJsonValue) ETriState(com.helger.commons.state.ETriState) IJsonArray(com.helger.json.IJsonArray) CommonsArrayList(com.helger.commons.collection.impl.CommonsArrayList) Nonnull(javax.annotation.Nonnull)

Example 28 with ETriState

use of com.helger.commons.state.ETriState in project phase4 by phax.

the class PeppolPMode method generatePModeReceptionAwareness.

@Nonnull
public static PModeReceptionAwareness generatePModeReceptionAwareness() {
    final ETriState eReceptionAwareness = ETriState.TRUE;
    final ETriState eRetry = ETriState.TRUE;
    final int nMaxRetries = 1;
    final int nRetryIntervalMS = 10_000;
    final ETriState eDuplicateDetection = ETriState.TRUE;
    return new PModeReceptionAwareness(eReceptionAwareness, eRetry, nMaxRetries, nRetryIntervalMS, eDuplicateDetection);
}
Also used : ETriState(com.helger.commons.state.ETriState) PModeReceptionAwareness(com.helger.phase4.model.pmode.PModeReceptionAwareness) Nonnull(javax.annotation.Nonnull)

Example 29 with ETriState

use of com.helger.commons.state.ETriState in project phase4 by phax.

the class PeppolPMode method generatePModeLegErrorHandling.

@Nonnull
public static PModeLegErrorHandling generatePModeLegErrorHandling() {
    final PModeAddressList aReportSenderErrorsTo = null;
    final PModeAddressList aReportReceiverErrorsTo = null;
    final ETriState eReportAsResponse = ETriState.TRUE;
    final ETriState eReportProcessErrorNotifyConsumer = ETriState.TRUE;
    final ETriState eReportProcessErrorNotifyProducer = ETriState.TRUE;
    final ETriState eReportDeliveryFailuresNotifyProducer = ETriState.TRUE;
    return new PModeLegErrorHandling(aReportSenderErrorsTo, aReportReceiverErrorsTo, eReportAsResponse, eReportProcessErrorNotifyConsumer, eReportProcessErrorNotifyProducer, eReportDeliveryFailuresNotifyProducer);
}
Also used : ETriState(com.helger.commons.state.ETriState) PModeLegErrorHandling(com.helger.phase4.model.pmode.leg.PModeLegErrorHandling) PModeAddressList(com.helger.phase4.model.pmode.leg.PModeAddressList) Nonnull(javax.annotation.Nonnull)

Example 30 with ETriState

use of com.helger.commons.state.ETriState in project phase4 by phax.

the class CEFPMode method generatePModeReceptionAwareness.

@Nonnull
public static PModeReceptionAwareness generatePModeReceptionAwareness() {
    final ETriState eReceptionAwareness = ETriState.TRUE;
    final ETriState eRetry = ETriState.TRUE;
    final int nMaxRetries = 1;
    final int nRetryIntervalMS = 10_000;
    final ETriState eDuplicateDetection = ETriState.TRUE;
    return new PModeReceptionAwareness(eReceptionAwareness, eRetry, nMaxRetries, nRetryIntervalMS, eDuplicateDetection);
}
Also used : ETriState(com.helger.commons.state.ETriState) PModeReceptionAwareness(com.helger.phase4.model.pmode.PModeReceptionAwareness) Nonnull(javax.annotation.Nonnull)

Aggregations

ETriState (com.helger.commons.state.ETriState)32 Nonnull (javax.annotation.Nonnull)24 Nullable (javax.annotation.Nullable)10 ValueEnforcer (com.helger.commons.ValueEnforcer)7 ErrorList (com.helger.commons.error.list.ErrorList)7 Consumer (java.util.function.Consumer)7 AmountType (un.unece.uncefact.data.standard.unqualifieddatatype._100.AmountType)7 CGlobal (com.helger.commons.CGlobal)6 CollectionHelper (com.helger.commons.collection.CollectionHelper)6 EqualsHelper (com.helger.commons.equals.EqualsHelper)6 IErrorList (com.helger.commons.error.list.IErrorList)6 MathHelper (com.helger.commons.math.MathHelper)6 StringHelper (com.helger.commons.string.StringHelper)6 Serializable (java.io.Serializable)6 BigDecimal (java.math.BigDecimal)6 LocalDate (java.time.LocalDate)6 CrossIndustryInvoiceType (un.unece.uncefact.data.standard.crossindustryinvoice._100.CrossIndustryInvoiceType)6 FormattedDateTimeType (un.unece.uncefact.data.standard.qualifieddatatype._100.FormattedDateTimeType)6 un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._100 (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._100)6 BinaryObjectType (un.unece.uncefact.data.standard.unqualifieddatatype._100.BinaryObjectType)6