Skip to content

Commit

Permalink
Version update
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed May 26, 2020
1 parent 3868111 commit c37b79f
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 298 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -16,5 +16,6 @@ target/
*.iml
.settings/
.project
.classpath
.classpath
zz
peppol-commons/doctypes.csv
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -265,6 +265,10 @@ They depend on several other libraries so I suggest you are going for the Maven

# News and noteworthy

* v8.1.0 - work in progress
* Updated to ph-web 9.2.1 (using ph-dns)
* Deprecated class `NAPTRResolver` in favour of the new `NaptrResolver`
* `IBDXLURLProvider` takes custom DNS server names now as `InetAddress` instead of as String
* v8.0.7 - 2020-05-06
* Extended predefined document type ID API
* Updated Peppol codelists to contain deprecation status on process identifiers
Expand Down
2 changes: 1 addition & 1 deletion peppol-commons/pom.xml
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.helger</groupId>
<artifactId>peppol-commons-parent-pom</artifactId>
<version>8.0.8-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
</parent>
<artifactId>peppol-commons</artifactId>
<packaging>bundle</packaging>
Expand Down
10 changes: 5 additions & 5 deletions peppol-id/pom.xml
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.helger</groupId>
<artifactId>peppol-commons-parent-pom</artifactId>
<version>8.0.8-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
</parent>
<artifactId>peppol-id</artifactId>
<packaging>bundle</packaging>
Expand Down Expand Up @@ -62,15 +62,15 @@
<artifactId>ph-xml</artifactId>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<groupId>com.helger.xsd</groupId>
<artifactId>ph-xsds-xmldsig</artifactId>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<groupId>com.helger.xsd</groupId>
<artifactId>ph-xsds-bdxr-smp1</artifactId>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<groupId>com.helger.xsd</groupId>
<artifactId>ph-xsds-bdxr-smp2</artifactId>
</dependency>

Expand Down Expand Up @@ -176,7 +176,7 @@ osgi.serviceloader; osgi.serviceloader=com.helger.xml.microdom.convert.IMicroTyp
</plugins>
<episodes>
<episode>
<groupId>com.helger</groupId>
<groupId>com.helger.xsd</groupId>
<artifactId>ph-xsds-xmldsig</artifactId>
</episode>
</episodes>
Expand Down
10 changes: 5 additions & 5 deletions peppol-id/src/main/jaxb/catalog.txt
@@ -1,5 +1,5 @@
PUBLIC "http://www.w3.org/2000/09/xmldsig#" "maven:com.helger:ph-xsds-xmldsig:jar::!/schemas/xmldsig-core-schema.xsd"
PUBLIC "http://www.w3.org/2009/xmldsig11#" "maven:com.helger:ph-xsds-xmldsig11:jar::!/schemas/xmldsig11-schema.xsd"
PUBLIC "http://uri.etsi.org/01903/v1.3.2#" "maven:com.helger:ph-xsds-xades132:jar::!/schemas/XAdES01903v132-201601.xsd"
PUBLIC "http://uri.etsi.org/01903/v1.4.1#" "maven:com.helger:ph-xsds-xades141:jar::!/schemas/XAdES01903v141-201601.xsd"
PUBLIC "urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2" "maven:com.helger:ph-xsds-ccts-cct-schemamodule:jar::!/schemas/CCTS_CCT_SchemaModule.xsd"
PUBLIC "http://www.w3.org/2000/09/xmldsig#" "maven:com.helger.xsd:ph-xsds-xmldsig:jar::!/schemas/xmldsig-core-schema.xsd"
PUBLIC "http://www.w3.org/2009/xmldsig11#" "maven:com.helger.xsd:ph-xsds-xmldsig11:jar::!/schemas/xmldsig11-schema.xsd"
PUBLIC "http://uri.etsi.org/01903/v1.3.2#" "maven:com.helger.xsd:ph-xsds-xades132:jar::!/schemas/XAdES01903v132-201601.xsd"
PUBLIC "http://uri.etsi.org/01903/v1.4.1#" "maven:com.helger.xsd:ph-xsds-xades141:jar::!/schemas/XAdES01903v141-201601.xsd"
PUBLIC "urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2" "maven:com.helger.xsd:ph-xsds-ccts-cct-schemamodule:jar::!/schemas/CCTS_CCT_SchemaModule.xsd"
2 changes: 1 addition & 1 deletion peppol-sbdh/pom.xml
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.helger</groupId>
<artifactId>peppol-commons-parent-pom</artifactId>
<version>8.0.8-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
</parent>
<artifactId>peppol-sbdh</artifactId>
<packaging>bundle</packaging>
Expand Down
6 changes: 3 additions & 3 deletions peppol-sml-client/pom.xml
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.helger</groupId>
<artifactId>peppol-commons-parent-pom</artifactId>
<version>8.0.8-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
</parent>
<artifactId>peppol-sml-client</artifactId>
<packaging>bundle</packaging>
Expand Down Expand Up @@ -85,13 +85,13 @@
</dependency>

<dependency>
<groupId>com.helger</groupId>
<groupId>com.helger.web</groupId>
<artifactId>ph-http</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.helger</groupId>
<groupId>com.helger.web</groupId>
<artifactId>ph-web</artifactId>
<scope>test</scope>
</dependency>
Expand Down
8 changes: 6 additions & 2 deletions peppol-smp-client/pom.xml
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.helger</groupId>
<artifactId>peppol-commons-parent-pom</artifactId>
<version>8.0.8-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
</parent>
<artifactId>peppol-smp-client</artifactId>
<packaging>bundle</packaging>
Expand Down Expand Up @@ -92,7 +92,11 @@
<artifactId>ph-settings</artifactId>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<groupId>com.helger.web</groupId>
<artifactId>ph-dns</artifactId>
</dependency>
<dependency>
<groupId>com.helger.web</groupId>
<artifactId>ph-httpclient</artifactId>
</dependency>
<dependency>
Expand Down
Expand Up @@ -16,8 +16,10 @@
*/
package com.helger.smpclient.url;

import java.net.InetAddress;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Locale;
import java.util.Map;

Expand All @@ -34,6 +36,7 @@
import com.helger.commons.collection.impl.ICommonsMap;
import com.helger.commons.concurrent.SimpleReadWriteLock;
import com.helger.commons.string.StringHelper;
import com.helger.dns.naptr.NaptrResolver;
import com.helger.peppolid.IParticipantIdentifier;
import com.helger.security.messagedigest.EMessageDigestAlgorithm;
import com.helger.security.messagedigest.MessageDigestValue;
Expand All @@ -49,6 +52,9 @@
@ThreadSafe
public class BDXLURLProvider implements IBDXLURLProvider
{
/** U NAPTR service name for e-SENS/PEPPOL */
public static final String DNS_UNAPTR_SERVICE_NAME_META_SMP = "Meta:SMP";

public static final BDXLURLProvider MUTABLE_INSTANCE = new BDXLURLProvider ();
public static final IBDXLURLProvider INSTANCE = MUTABLE_INSTANCE;
public static final Charset URL_CHARSET = StandardCharsets.UTF_8;
Expand Down Expand Up @@ -131,8 +137,7 @@ public void addCacheEntries (@Nullable final Map <String, String> aEntries)
@Nonnull
public static String getHashValueStringRepresentation (@Nonnull final String sValueToHash)
{
final byte [] aMessageDigest = MessageDigestValue.create (sValueToHash.getBytes (URL_CHARSET),
EMessageDigestAlgorithm.SHA_256)
final byte [] aMessageDigest = MessageDigestValue.create (sValueToHash.getBytes (URL_CHARSET), EMessageDigestAlgorithm.SHA_256)
.bytes ();
return new Base32Codec ().setAddPaddding (false).getEncodedAsString (aMessageDigest, StandardCharsets.ISO_8859_1);
}
Expand All @@ -141,14 +146,13 @@ public static String getHashValueStringRepresentation (@Nonnull final String sVa
public String getDNSNameOfParticipant (@Nonnull final IParticipantIdentifier aParticipantIdentifier,
@Nullable final String sSMLZoneName,
final boolean bDoNAPTRResolving,
@Nullable final String sPrimaryDNSServer) throws PeppolDNSResolutionException
@Nullable final List <InetAddress> aCustomDNSServers) throws PeppolDNSResolutionException
{
ValueEnforcer.notNull (aParticipantIdentifier, "ParticipantIdentifier");

// Ensure the DNS zone name ends with a dot!
if (StringHelper.hasText (sSMLZoneName) && !StringHelper.endsWith (sSMLZoneName, '.'))
throw new PeppolDNSResolutionException ("if an SML zone name is specified, it must end with a dot (.). Value is: " +
sSMLZoneName);
throw new PeppolDNSResolutionException ("if an SML zone name is specified, it must end with a dot (.). Value is: " + sSMLZoneName);

final StringBuilder ret = new StringBuilder ();

Expand Down Expand Up @@ -194,9 +198,7 @@ public String getDNSNameOfParticipant (@Nonnull final IParticipantIdentifier aPa
if (sResolvedNAPTR == null)
{
// Now do the NAPTR resolving
sResolvedNAPTR = NAPTRResolver.resolveFromNAPTR (sBuildName,
sPrimaryDNSServer,
NAPTRResolver.DNS_UNAPTR_SERVICE_NAME_META_SMP);
sResolvedNAPTR = NaptrResolver.resolveFromUNAPTR (sBuildName, aCustomDNSServers, DNS_UNAPTR_SERVICE_NAME_META_SMP);
if (sResolvedNAPTR == null)
{
// Since 6.2.0 this a checked exception
Expand Down
Expand Up @@ -16,6 +16,9 @@
*/
package com.helger.smpclient.url;

import java.net.InetAddress;
import java.util.List;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

Expand Down Expand Up @@ -71,5 +74,5 @@ default String getDNSNameOfParticipant (@Nonnull final IParticipantIdentifier aP
String getDNSNameOfParticipant (@Nonnull IParticipantIdentifier aParticipantIdentifier,
@Nullable String sSMLZoneName,
boolean bDoNAPTRResolving,
@Nullable String sPrimaryDNSServer) throws PeppolDNSResolutionException;
@Nullable List <InetAddress> aCustomDNSServers) throws PeppolDNSResolutionException;
}
Expand Up @@ -141,7 +141,7 @@ default URI getSMPURIOfParticipant (@Nonnull final IParticipantIdentifier aParti
}
catch (final URISyntaxException ex)
{
throw new IllegalArgumentException ("Error building SMP URI from string '" + sURIString + "'", ex);
throw new PeppolDNSResolutionException ("Error building SMP URI from string '" + sURIString + "'", ex);
}
}

Expand Down

0 comments on commit c37b79f

Please sign in to comment.