Class AS4Configuration

java.lang.Object
com.helger.phase4.config.AS4Configuration

public final class AS4Configuration extends Object
This class contains the central phase4 configuration.
Note: this class should not depend on any other phase4 class to avoid startup issues, and cyclic dependencies.
Since:
0.11.0
Author:
Philip Helger
  • Field Details

    • PROPERTY_PHASE4_MANAGER_INMEMORY

      public static final String PROPERTY_PHASE4_MANAGER_INMEMORY
      The boolean property to enable in-memory managers.
      See Also:
    • DEFAULT_PHASE4_MANAGER_INMEMORY

      public static final boolean DEFAULT_PHASE4_MANAGER_INMEMORY
      See Also:
    • PROPERTY_PHASE4_WSS4J_SYNCSECURITY

      public static final String PROPERTY_PHASE4_WSS4J_SYNCSECURITY
      The boolean property to enable synchronization of sign/verify and encrypt/decrypt.
      See Also:
    • DEFAULT_PHASE4_WSS4J_SYNCSECURITY

      public static final boolean DEFAULT_PHASE4_WSS4J_SYNCSECURITY
      See Also:
    • PROPERTY_PHASE4_INCOMING_DUPLICATEDISPOSAL

      public static final String PROPERTY_PHASE4_INCOMING_DUPLICATEDISPOSAL
      The duration property for the incoming message duplicate disposal time. Supports the unit-less form (e.g. 10m, 1h 30m) since v4.5.0.
      See Also:
    • PROPERTY_PHASE4_INCOMING_DUPLICATEDISPOSAL_MINUTES

      public static final String PROPERTY_PHASE4_INCOMING_DUPLICATEDISPOSAL_MINUTES
      The legacy property for the incoming message duplicate disposal time, expressed in minutes. Use PROPERTY_PHASE4_INCOMING_DUPLICATEDISPOSAL with the unit-less form instead.
      See Also:
    • DEFAULT_PHASE4_INCOMING_DUPLICATEDISPOSAL_MINUTES

      @Deprecated(forRemoval=true, since="4.5.0") public static final long DEFAULT_PHASE4_INCOMING_DUPLICATEDISPOSAL_MINUTES
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • DEFAULT_PHASE4_INCOMING_DUPLICATEDISPOSAL_DURATION

      public static final Duration DEFAULT_PHASE4_INCOMING_DUPLICATEDISPOSAL_DURATION
  • Method Details

    • createPhase4ValueProvider

      @Deprecated(forRemoval=true, since="4.0.1") public static @NonNull com.helger.config.source.MultiConfigurationValueProvider createPhase4ValueProvider()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use ConfigFactory.createDefaultValueProvider() instead
      The configuration value provider created in here uses the default lookup scheme defined by ConfigFactory.createDefaultValueProvider() but adds support for AS4 specific files. For a sustainable solution use one of the following files that have higher precedence than application.properties:
      • private-phase4.properties - priority 204
      • phase4.properties - priority 203

      This is deprecated since v4.0.1 because it creates confusion with other objects that also rely on a centralized configuration. Put all your properties in application.properties or private-application.properties instead.

      Returns:
      The configuration value provider for phase4 that contains backward compatibility support.
    • getConfig

      public static @NonNull com.helger.config.fallback.IConfigWithFallback getConfig()
      Returns:
      The current global configuration. Never null.
    • setConfig

      public static @NonNull com.helger.config.fallback.IConfigWithFallback setConfig(@NonNull com.helger.config.fallback.IConfigWithFallback aNewConfig)
      Overwrite the global configuration. This is only needed for testing.
      Parameters:
      aNewConfig - The configuration to use globally. May not be null.
      Returns:
      The old value of IConfig. Never null.
    • isGlobalDebug

      public static boolean isGlobalDebug()
      Returns:
      true to enable the global debugging mode.
    • isGlobalProduction

      public static boolean isGlobalProduction()
      Returns:
      true to enable the global production mode.
    • isNoStartupInfo

      public static boolean isNoStartupInfo()
      Returns:
      true if no startup info should be logged.
    • getDataPath

      public static @NonNull String getDataPath()
    • isUseInMemoryManagers

      public static boolean isUseInMemoryManagers()
      Returns:
      Use in-memory managers, taken from the configuration item phase4.manager.inmemory. Defaults to true since 0.11.0.
    • isWSS4JSynchronizedSecurity

      public static boolean isWSS4JSynchronizedSecurity()
      Returns:
      true if all WSS4J actions should be explicitly synchronized. This is needed if multiple workers sending/receiving AS4 messages from the same JVM. The configuration item is phase4.wss4j.syncsecurity.
    • getDefaultAS4ProfileID

      public static @Nullable String getDefaultAS4ProfileID()
      Returns:
      The AS4 profile to use, taken from the configuration item phase4.default.profile (changed in 3.0.0; was phase4.profile before). May be null.
    • getIncomingDuplicateDisposal

      public static @NonNull Duration getIncomingDuplicateDisposal()
      Returns:
      the duration the message IDs of incoming messages are stored for duplication check. Taken from the configuration item "phase4.incoming.duplicatedisposal" (using the unit-less form like 10m or 1h 30m) with fallback to the legacy item "phase4.incoming.duplicatedisposal.minutes" (a plain number of minutes). By default this is 10L minutes. Never null.
      Since:
      4.5.0
    • getIncomingDuplicateDisposalMinutes

      @Deprecated(forRemoval=true, since="4.5.0") public static long getIncomingDuplicateDisposalMinutes()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      the number of minutes, the message IDs of incoming messages are stored for duplication check. By default this is 10L minutes.
    • getDumpBasePath

      public static @NonNull String getDumpBasePath()
      Returns:
      The dumping base path. Taken from the configuration item phase4.dump.path.
      See Also:
    • getDumpBasePathFile

      public static @NonNull File getDumpBasePathFile()
      Returns:
      The dumping base path as a File. Taken from the configuration item phase4.dump.path.
      See Also:
    • getThisEndpointAddress

      public static @Nullable String getThisEndpointAddress()
      Returns:
      The endpoint address of "our" AP for comparison. Taken from the configuration item phase4.endpoint.address. For Peppol this is e.g. required to have the `https` protocol in production mode.
    • isIncludeStackTraceInErrorMessages

      public static boolean isIncludeStackTraceInErrorMessages()
      Returns:
      true if stack traces should be contained in error messages, false if not. Defaults to true.
      Since:
      2.7.5
    • isCompatibilityModeDomibus

      public static boolean isCompatibilityModeDomibus()
      Check if special Domibus compatibility is needed or not. This is e.g. needed in environments where there are multiple Domibus nodes.
      Returns:
      true if advanced Domibus compatibility is needed, false if not.
      Since:
      4.0.1
    • isHttpResponseAcceptAllStatusCodes

      public static boolean isHttpResponseAcceptAllStatusCodes()
      Check if all HTTP response status codes should be handled by phase4. Up to and including phase4 4.1.0 only HTTP status codes < 300 were accepted. By setting this configuration property to false this behaviour is recreated.
      Returns:
      true if all HTTP status codes should be accepted, false if not.
      Since:
      4.1.1