Package com.helger.phase4.peppol.servlet
Class Phase4PeppolReceiverConfiguration
java.lang.Object
com.helger.phase4.peppol.servlet.Phase4PeppolReceiverConfiguration
This class contains the "per-request" data of
Old name before v3:
Phase4PeppolDefaultReceiverConfiguration.Old name before v3:
Phase4PeppolReceiverCheckData- Since:
- 0.9.13
- Author:
- Philip Helger
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for classPhase4PeppolReceiverConfiguration. -
Constructor Summary
ConstructorsConstructorDescriptionPhase4PeppolReceiverConfiguration(boolean bReceiverCheckEnabled, @Nullable com.helger.smpclient.peppol.ISMPExtendedServiceMetadataProvider aSMPClient, @Nullable com.helger.peppol.sml.ISMLInfo aSMLInfo, @Nullable com.helger.smpclient.url.ISMPURLProvider aSMPURLProvider, @Nullable com.helger.security.revocation.ERevocationCheckMode eSMPRevocationCheckMode, boolean bSMPRevocationSoftFail, @Nullable String sAS4EndpointURL, @Nullable X509Certificate aAPCertificate, @NonNull com.helger.peppolid.factory.IIdentifierFactory aSBDHIdentifierFactory, boolean bPerformSBDHValueChecks, boolean bCheckSBDHForMandatoryCountryC1, boolean bCheckAPSigningCertificateRevocation, @NonNull com.helger.security.certificate.TrustedCAChecker aAPCAChecker, boolean bAPRevocationSoftFail, @NonNull com.helger.base.state.ETriState eAPCacheRevocationCheckResult, @Nullable com.helger.security.revocation.ERevocationCheckMode eAPRevocationCheckMode) Constructor -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder(@NonNull Phase4PeppolReceiverConfiguration aSrc) Create a builder instance with the data of the provided object already filled in.@NonNull com.helger.security.certificate.TrustedCAChecker@NonNull com.helger.base.state.ETriState@NonNull X509Certificate@Nullable com.helger.security.revocation.ERevocationCheckMode@Nullable String@Nullable com.helger.smpclient.peppol.ISMPExtendedServiceMetadataProvidergetOrCreateSMPClientForRecipient(@NonNull com.helger.peppolid.IParticipantIdentifier aRecipientID) Get the existing SMP client or create a new one dynamically for the provided recipient participant ID using the configured SML info and URL provider.@NonNull com.helger.peppolid.factory.IIdentifierFactory@Nullable com.helger.peppol.sml.ISMLInfo@Nullable com.helger.smpclient.peppol.ISMPExtendedServiceMetadataProvider@Nullable com.helger.security.revocation.ERevocationCheckMode@NonNull com.helger.smpclient.url.ISMPURLProviderbooleanbooleanbooleanDeprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanbooleanbooleantoString()
-
Constructor Details
-
Phase4PeppolReceiverConfiguration
public Phase4PeppolReceiverConfiguration(boolean bReceiverCheckEnabled, @Nullable com.helger.smpclient.peppol.ISMPExtendedServiceMetadataProvider aSMPClient, @Nullable com.helger.peppol.sml.ISMLInfo aSMLInfo, @Nullable com.helger.smpclient.url.ISMPURLProvider aSMPURLProvider, @Nullable com.helger.security.revocation.ERevocationCheckMode eSMPRevocationCheckMode, boolean bSMPRevocationSoftFail, @Nullable String sAS4EndpointURL, @Nullable X509Certificate aAPCertificate, @NonNull com.helger.peppolid.factory.IIdentifierFactory aSBDHIdentifierFactory, boolean bPerformSBDHValueChecks, boolean bCheckSBDHForMandatoryCountryC1, boolean bCheckAPSigningCertificateRevocation, @NonNull com.helger.security.certificate.TrustedCAChecker aAPCAChecker, boolean bAPRevocationSoftFail, @NonNull com.helger.base.state.ETriState eAPCacheRevocationCheckResult, @Nullable com.helger.security.revocation.ERevocationCheckMode eAPRevocationCheckMode) Constructor- Parameters:
bReceiverCheckEnabled-trueif the receiver checks are enabled,falseotherwiseaSMPClient- The SMP metadata provider to be used. May benullifaSMLInfois provided instead.aSMLInfo- The SML information for dynamic SMP client resolution per participant ID. May benullifaSMPClientis provided instead.aSMPURLProvider- The SMP URL provider to be used for dynamic SMP client resolution. May benullto use the default (PeppolNaptrURLProvider.INSTANCE).eSMPRevocationCheckMode- The revocation check mode to apply when verifying SMP response certificates.nullmeans "use the JVM-wide default fromCertificateRevocationCheckerDefaults". Only applied to SMP clients created internally viagetOrCreateSMPClientForRecipient(com.helger.peppolid.IParticipantIdentifier). Pre-built SMP clients passed viaaSMPClientmust be configured by the caller.bSMPRevocationSoftFail-trueto accept an indeterminable revocation status of an SMP response certificate (soft-fail),falseto reject. Defaults toCertificateRevocationCheckerDefaults.isAllowSoftFail(). Only applied to SMP clients created internally viagetOrCreateSMPClientForRecipient(com.helger.peppolid.IParticipantIdentifier).sAS4EndpointURL- The endpoint URL to check against. May neither benullnor empty if receiver checks are enabled.aAPCertificate- The AP certificate to be used for compatibility. May not benullif receiver checks are enabled.aSBDHIdentifierFactory- The identifier factory to be used for SBDH parsing. May not benull.bPerformSBDHValueChecks-trueif SBDH value checks should be performed.bCheckSBDHForMandatoryCountryC1-trueif SBDH value checks should be performed for mandatory C1 country code.bCheckAPSigningCertificateRevocation-trueif signing certificate revocation checks should be performed.aAPCAChecker- The Peppol AP CA checker. May not benull.bAPRevocationSoftFail-trueto acceptECertificateCheckResult.REVOCATION_STATUS_UNKNOWNfrom the AP CA checker as valid,falseto treat it as invalid. Defaults toCertificateRevocationCheckerDefaults.isAllowSoftFail(). Applies to the inbound signing certificate check.eAPCacheRevocationCheckResult- Override for the revocation result caching flag of the inbound signing certificate check.ETriState.UNDEFINED(the default) means "use the JVM-wide default fromCertificateRevocationCheckerDefaults". Must not benull.eAPRevocationCheckMode- Override for the revocation check mode of the inbound signing certificate check.null(the default) means "use the JVM-wide default fromCertificateRevocationCheckerDefaults".- Since:
- 3.0.3
-
-
Method Details
-
isReceiverCheckEnabled
public boolean isReceiverCheckEnabled() -
getSMPClient
public @Nullable com.helger.smpclient.peppol.ISMPExtendedServiceMetadataProvider getSMPClient()- Returns:
- The SMP client object that should be used for the SMP lookup. It is customizable
because it depends either on the SML or a direct URL to the SMP may be provided. May be
nullif SML info is configured for dynamic resolution instead. - See Also:
-
getSMLInfo
public @Nullable com.helger.peppol.sml.ISMLInfo getSMLInfo()- Returns:
- The SML information for dynamic SMP client resolution. May be
nullif a fixed SMP client is configured instead. - Since:
- v4.4.2
- See Also:
-
getSMPURLProvider
public @NonNull com.helger.smpclient.url.ISMPURLProvider getSMPURLProvider()- Returns:
- The SMP URL provider to be used for dynamic SMP client resolution. Never
null. Defaults toPeppolNaptrURLProvider.INSTANCE. - Since:
- v4.4.2
-
getSMPRevocationCheckMode
public @Nullable com.helger.security.revocation.ERevocationCheckMode getSMPRevocationCheckMode()- Returns:
- The revocation check mode to apply when verifying SMP response certificates.
nullmeans "use the JVM-wide default fromCertificateRevocationCheckerDefaults". Only applied to SMP clients created internally viagetOrCreateSMPClientForRecipient(IParticipantIdentifier). - Since:
- 4.5.0
-
isSMPRevocationSoftFail
public boolean isSMPRevocationSoftFail()- Returns:
trueto accept an indeterminable revocation status of an SMP response certificate (soft-fail),falseto reject. Defaults toCertificateRevocationCheckerDefaults.isAllowSoftFail(). Only applied to SMP clients created internally viagetOrCreateSMPClientForRecipient(IParticipantIdentifier).- Since:
- 4.5.0
-
getOrCreateSMPClientForRecipient
public @Nullable com.helger.smpclient.peppol.ISMPExtendedServiceMetadataProvider getOrCreateSMPClientForRecipient(@NonNull com.helger.peppolid.IParticipantIdentifier aRecipientID) throws com.helger.smpclient.url.SMPDNSResolutionException Get the existing SMP client or create a new one dynamically for the provided recipient participant ID using the configured SML info and URL provider.- Parameters:
aRecipientID- The recipient participant identifier. May not benull.- Returns:
- The SMP client. May be
nullif neither a fixed SMP client nor SML info is configured. - Throws:
com.helger.smpclient.url.SMPDNSResolutionException- If DNS resolution of the SMP address fails.- Since:
- v4.4.2
-
getAS4EndpointURL
- Returns:
- The URL of this AP to compare to against the SMP lookup result upon retrieval. Neither
nullnor empty if receiver checks are enabled. - See Also:
-
getAPCertificate
- Returns:
- The certificate of this AP to compare to against the SMP lookup result upon retrieval.
Never
nullif receiver checks are enabled. - See Also:
-
getSBDHIdentifierFactory
public @NonNull com.helger.peppolid.factory.IIdentifierFactory getSBDHIdentifierFactory()- Returns:
- The identifier factory to be used for SBDH parsing.
- Since:
- 3.0.1
-
isPerformSBDHValueChecks
public boolean isPerformSBDHValueChecks() -
isCheckSBDHForMandatoryCountryC1
Deprecated, for removal: This API element is subject to removal in a future version. -
isCheckSigningCertificateRevocation
Deprecated, for removal: This API element is subject to removal in a future version.UseisCheckAPSigningCertificateRevocation()instead- Returns:
trueif the AP signing certificate should be used.
-
isCheckAPSigningCertificateRevocation
public boolean isCheckAPSigningCertificateRevocation()- Returns:
trueif the AP signing certificate should be used.
-
getAPCAChecker
public @NonNull com.helger.security.certificate.TrustedCAChecker getAPCAChecker()- Returns:
- The Peppol CA checker to be used. Must not be
null. - Since:
- 3.0.3
-
isAPRevocationSoftFail
public boolean isAPRevocationSoftFail()- Returns:
trueto acceptECertificateCheckResult.REVOCATION_STATUS_UNKNOWNfrom the AP CA checker as valid (soft-fail),falseto treat it as invalid. Applies to the inbound signing certificate check.- Since:
- 4.5.0
-
getAPCacheRevocationCheckResult
public @NonNull com.helger.base.state.ETriState getAPCacheRevocationCheckResult()- Returns:
- The revocation result caching override applied during the inbound signing certificate
check.
ETriState.UNDEFINEDmeans "use the JVM-wide default fromCertificateRevocationCheckerDefaults". Nevernull. - Since:
- 4.5.0
-
getAPRevocationCheckMode
public @Nullable com.helger.security.revocation.ERevocationCheckMode getAPRevocationCheckMode()- Returns:
- The revocation check mode override applied during the inbound signing certificate
check.
nullmeans "use the JVM-wide default fromCertificateRevocationCheckerDefaults". - Since:
- 4.5.0
-
toString
-
builder
public static @NonNull Phase4PeppolReceiverConfiguration.Phase4PeppolReceiverConfigurationBuilder builder()- Returns:
- An empty builder instance. Never
null.
-
builder
public static @NonNull Phase4PeppolReceiverConfiguration.Phase4PeppolReceiverConfigurationBuilder builder(@NonNull Phase4PeppolReceiverConfiguration aSrc) Create a builder instance with the data of the provided object already filled in.- Parameters:
aSrc- The sourcePhase4PeppolReceiverConfigurationto take the data from. May not benull.- Returns:
- A non-
nullfilled builder instance.
-
isCheckAPSigningCertificateRevocation()instead