-
Notifications
You must be signed in to change notification settings - Fork 58
Migrations
This page contains everything necessary related to migrating phase4 versions
- The usage of the configuration file
phase4.propertiesandprivate-phase4.propertieswas removed. Useapplication.propertiesorprivate-application.properties, environment variables or system properties instead.
- The SPI interface for receiving was slightly changed for error handling:
- Instead of
ICommonsList <Ebms3Error>the error list is now of typeAS4ErrorList - Each individual error is now of type
AS4Errorinstead ofEbms3Error
- Instead of
- The
@NonNulland@Nullableannotations are now taken from JSpecify and no longer from Jakarta-Annotations
- It requires at least Java 17 for building and execution
- It was updated to the JakartaEE 10 specifications
- Uses Servlet Specification 6.0.x
- The minimum requirements for application servers are
- Tomcat 10.1.x
- Jetty 12.x
- Make sure that all dependent libraries are updated to the required versions (see the release for details)
- All interfaces that declared their methods are throwing
Phase4PeppolExceptionare now throwingPhase4Exceptioninstead - [Peppol] The support for Peppol Policy for use of Identifiers v4.2.0 was dropped
- Make sure that all dependent libraries are updated to the required versions (see the release for details)
- Class
PeppolCACheckerwas replaced with classTrustedCAChecker - The predefined trusted CAs of Peppol were moved from
PeppolCertificateCheckertoPeppolTrustedCA - Enum
EPeppolCertificateCheckResultwas replaced withECertificateCheckResult - Some methods were moved from class
PeppolCertificateHelperto classCertificateHelper - [DBNAlliance] Moved class
Phase4DBNAllianceHttpClientSettingsto modulephase4-profile-dbnalliance - The method
AbstractAS4MessageBuilder.finishFields(and in all derived classes) now have anAS4ResourceHelperparameter
- Due to a change to peppol-commons v10 some classes were moved. See https://github.com/phax/peppol-commons/releases/tag/peppol-commons-parent-pom-10.0.0 for details
-
The
phase4-profile-bpcsubmodule was removed in favour ofphase4-profile-dbnalliance -
The
phase4-spring-boot-demosubmodule was removed in favour of https://github.com/phax/phase4-peppol-standalone -
All deprecated methods marked for removal have been removed
-
Configuration related changes
- The configuration files
private-crypto.propertiesandcrypto.propertiesare deprecated. Please move the properties toapplication.properties, environment variables or Java system properties instead. - The configuration property
phase4.profilewas renamed tophase4.default.profile- the old property is still evaluated as a secondary option - In case you are using
AS4CryptoFactoryPropertiesand- read the configuration from a file: use
AS4CryptoFactoryConfigurationinstead (as a drop-in replacement) - provide the properties manually: use
AS4CryptoFactoryInMemoryKeyStoreinstead (and see below)
- read the configuration from a file: use
- The configuration files
-
Here are the main coding related changes
- Renamed packages
- Renamed package
com.helger.phase4.errortocom.helger.phase4.model.error - Renamed package
com.helger.phase4.httptocom.helger.phase4.messaging.http - Renamed package
com.helger.phase4.messaging.domaintocom.helger.phase4.model.message
- Renamed package
- Moved classes
- Moved classes from
com.helger.phase4.servlettocom.helger.phase4.incoming - Moved classes from
com.helger.phase4.servlet.mgrtocom.helger.phase4.incoming.mgr - Moved classes from
com.helger.phase4.servlet.soaptocom.helger.phase4.incoming.soap - Moved classes from
com.helger.phase4.servlet.spitocom.helger.phase4.incoming.spi - Moved class
AbstractAS4RawResponseConsumertocom.helger.phase4.sender - Moved class
AS4IncomingDumperFileBased.IFileProvidertoIAS4IncomingDumperFileProvider - Moved class
AS4OutgoingDumperFileBased.IFileProvidertoIAS4OutgoingDumperFileProvider - Moved class
AS4RequestHandler.ISoapProcessingFinalizedCallbacktoIAS4SoapProcessingFinalizedCallback - Moved class
ESoapVersionto com.helger.phase4.model` - Moved classes
IAS4IncomingSecurityConfigurationandAS4IncomingSecurityConfigurationtocom.helger.phase4.incoming.crypto - Moved class
IAS4IncomingMessageMetadatatocom.helger.phase4.incoming - Moved class
IAS4RawResponseConsumertocom.helger.phase4.sender - Moved class
IAS4SignalMessageConsumertocom.helger.phase4.incoming - Moved class
IAS4UserMessageConsumertocom.helger.phase4.incoming
- Moved classes from
- Renamed classes
- Renamed class
AbstractAS4UserMessageBuilder.ESimpleUserMessageSendResulttoEAS4UserMessageSendResult - Renamed class
AS4DuplicateManagertoAS4DuplicateManagerXML - Renamed class
AS4MessageStatetoAS4IncomingMessageState - Renamed class
AS4MessagingHelpertoAS4IncomingHelper- And moved to
com.helger.phase4.incoming
- And moved to
- Renamed class
AS4ServletMessageProcessorManagertoAS4IncomingMessageProcessorManager - Renamed class
AS4ServletPullRequestProcessorManagertoAS4IncomingPullRequestProcessorManager - Renamed class
AS4SingleSOAPHeadertoAS4SingleSoapHeader(casing only) - Renamed class
AS4XServletHandler.IHandlerCustomizertoIAS4ServletRequestHandlerCustomizer- Made method
customizeAfterHandlingnon-default
- Made method
- Renamed class
DefaultPModeResolvertoAS4DefaultPModeResolver - Renamed SPI class
IAS4ServletMessageProcessorSPItoIAS4IncomingMessageProcessorSPI- Was also moved to a different package - see above
- Made method
IAS4IncomingMessageProcessorSPInon-default
- Renamed SPI class
IAS4ServletPullRequestProcessorSPItoIAS4IncomingPullRequestProcessorSPI- Was also moved to a different package - see above
- Renamed class
IAS4MessageStatetoIAS4IncomingMessageState - Renamed class
IPModeResolvertoIAS4PModeResolver - Renamed class
ISOAPHeaderElementProcessortoISoapHeaderElementProcessor(casing only) - Renamed class
MimeMessageCreatortoAS4MimeMessageHelper - Renamed class
MPCManagertoMPCManagerXML - Renamed class
Phase4PeppolServletConfigurationtoPhase4PeppolDefaultReceiverConfiguration - Renamed class
Phase4PeppolReceiverCheckDatatoPhase4PeppolReceiverConfiguration - Renamed class
Phase4PeppolSender.BuildertoPhase4PeppolSender.PeppolUserMessageBuilder - Renamed class
Phase4PeppolSender.SBDHBuildertoPhase4PeppolSender.PeppolUserMessageSBDHBuilder - Renamed class
PModeManagertoPModeManagerXML - Renamed class
SoapMimeMultiparttoAS4SoapMimeMultipart - Renamed class
SOAPHeaderElementProcessorExtractEbms3MessagingtoSoapHeaderElementProcessorExtractEbms3Messaging(casing only) - Renamed class
SOAPHeaderElementProcessorRegistrytoSoapHeaderElementProcessorRegistry(casing only) - Renamed class
SOAPHeaderElementProcessorWSS4JtoSoapHeaderElementProcessorWSS4J(casing only)
- Renamed class
- Removed classes
- Removed class
Phase4PeppolClientException
- Removed class
- Altered classes
- Added template parameter to class
AbstractAS4IncomingDumperWithHeaders - Added template parameter to class
AbstractAS4OutgoingDumperWithHeaders - Removed constant
DefaultPModeResolver.DEFAULT_PMODE_RESOLVERin favour of new instances with an AS4 profile ID
- Added template parameter to class
- Moved methods
- Moved methods
AS4ReceiptMessage.getAllDSigReferenceNodesandAS4ReceiptMessage.getAllDSigReferencesto classMessageHelperMethods - Moved all setters from
AS4XServletHandlertoAS4RequestHandler - Moved method
IAS4ResponseAbstraction.wraptoAS4XServletHandler.createResponseAbstraction - Moved methods
MessageHelperMethods.forEachHeaderAndRemoveAfterwardsandMessageHelperMethods.getAndRemoveAllHeadersto classAS4MimeMessageHelper
- Moved methods
- Renamed methods
- Renamed methods
AbstractAS4Client.(get|set)AS4CryptoFactory*to(get|set)CryptoFactory... - Renamed methods
AS4ClientBuiltMessage.getCustomHeaderstogetAllCustomHttpHeaders - Renamed method
AS4ClientErrorMessage.isReceiptShouldBeSignedtoisErrorShouldBeSigned - Renamed method
AS4ClientSentMessage.getResponsetogetResponseContent - Renamed method
AS4ClientSentMessage.hasResponsetohasResponseContent - Renamed method
AS4Configuration.getAS4ProfileIDtogetDefaultAS4ProfileID - Renamed method
AS4ProfileSelector.getAS4ProfileIDtogetDefaultAS4ProfileID - Renamed methods
AS4ProfileSelector.(get|set)CustomAS4ProfileIDto(get|set)CustomDefaultAS4ProfileID - Renamed methods
AS4XServletHandler.(get|set)HandlerCustomizerto(get|set)RequestHandlerCustomizer - Renamed method
IAS4IncomingDumperFileProvider.getFilenametogetDefaultDirectoryAndFilename - Renamed method
IAS4OutgoingDumperFileProvider.getFilenametogetDefaultDirectoryAndFilename - Renamed method
IPModeResolver.getPModeOfIDtofindPMode
- Renamed methods
- Altered methods
- Extended method
AS4DumpReader.decryptAS4Into include an AS4 profile ID parameter - Made method
IAS4CryptoFactory.getKeyPasswordPerAlias(String)non-default - Made method
IAS4IncomingDumper.onEndRequestnon-default and added optional "caughtException" parameter - Made method
IAS4OutgoingDumper.onEndRequestnon-default and added optional "caughtException" parameter - Extended method
IAS4ProfileValidator.validatePModewith an additional parameter to differentiate UserMessage and SignalMessage
- Extended method
- Removed methods
- Removed method
IAS4ProfileManager.hasDefaultProfile - Removed method
IAS4ProfileManager.getDefaultProfileOrNull - Removed method
IAS4ProfileManager.getDefaultProfile - Removed method
IAS4ProfileManager.setDefaultProfileID - Removed method
IAS4ProfileRegistrar.setDefaultProfile
- Removed method
- Renamed packages
-
The most common form of CryptoFactory creation got reworked.
Instead of
final AS4CryptoProperties aCP = new AS4CryptoProperties ().setKeyStoreType (EKeyStoreType.PKCS12)
.setKeyStorePath ("path.p12")
.setKeyStorePassword ("pw")
.setKeyAlias ("cert")
.setKeyPassword ("pw")
.setTrustStoreType (EKeyStoreType.JKS)
.setTrustStorePath ("truststore/complete-truststore.jks")
.setTrustStorePassword ("peppol");
new AS4CryptoFactoryProperties (aCP);use this code now:
new AS4CryptoFactoryInMemoryKeyStore (KeyStoreAndKeyDescriptor.builder ()
.type (EKeyStoreType.PKCS12)
.path ("path.p12")
.password ("pw")
.keyAlias ("cert")
.keyPassword ("pw")
.build (),
TrustStoreDescriptor.builder ()
.type (EKeyStoreType.JKS)
.path ("truststore/complete-truststore.jks")
.password ("peppol")
.build ());In case of problems of PMode resolution, most likely you are missing a default AS4 profiles. Use the following code snippet in your global initialization to pick the correct AS4 profile.
// Example on how to globally use the AS4 Peppol profile
AS4ProfileSelector.setCustomDefaultAS4ProfileID (AS4PeppolProfileRegistarSPI.AS4_PROFILE_ID);The major change in v2.x is the new software baseline.
- It requires at least Java 11 for building and execution
- It was updated to the JakartaEE 9 specifications
- Uses Servlet Specification 5.0.x
- All the namespaces
javax.servletwhere changed tojakarta.servlet - Uses Eclipse Angus instead of Jakarta Mail
- The minimum requirements for application servers are
- Tomcat 10.0.x or Tomcat 10.1.x
- Jetty 11.x
All other potentially breaking changes are listed in News and noteworthy.
My personal Coding Styleguide | It is appreciated if you star the GitHub project if you like it.
