Package com.helger.smpclient.peppol
Class SMPClientReadOnly
java.lang.Object
com.helger.smpclient.httpclient.AbstractGenericSMPClient<SMPClientReadOnly>
com.helger.smpclient.peppol.SMPClientReadOnly
- All Implemented Interfaces:
com.helger.commons.traits.IGenericImplTrait<SMPClientReadOnly>
,ISMPExtendedServiceMetadataProvider
,ISMPServiceGroupProvider
,ISMPServiceMetadataProvider
- Direct Known Subclasses:
SMPClient
public class SMPClientReadOnly
extends AbstractGenericSMPClient<SMPClientReadOnly>
implements ISMPServiceGroupProvider, ISMPExtendedServiceMetadataProvider
This class is used for calling the Peppol SMP REST interface. This particular
class only contains the read-only methods including the ones defined in the
Peppol SMP specification!
- Author:
- Philip Helger
-
Field Summary
FieldsFields inherited from class com.helger.smpclient.httpclient.AbstractGenericSMPClient
CONTENT_TYPE_TEXT_XML, DEFAULT_FOLLOW_REDIRECTS, DEFAULT_XML_SCHEMA_VALIDATION
-
Constructor Summary
ConstructorsConstructorDescriptionSMPClientReadOnly
(ISMPURLProvider aURLProvider, com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, com.helger.peppol.sml.ISMLInfo aSMLInfo) Constructor with SML lookupSMPClientReadOnly
(ISMPURLProvider aURLProvider, com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, String sSMLZoneName) Constructor with SML lookupSMPClientReadOnly
(URI aSMPHost) Constructor with a direct SMP URL.
Remember: must be HTTP and using port 80 only! -
Method Summary
Modifier and TypeMethodDescriptionstatic void
forEachMatchingWildcardDocumentType
(com.helger.commons.collection.impl.ICommonsList<? extends com.helger.peppolid.IDocumentTypeIdentifier> aBaseDocTypes, String sDocTypeValue, Function<? super com.helger.peppolid.IDocumentTypeIdentifier, com.helger.commons.state.EContinue> aMatchingDocTypeConsumer) Deprecated, for removal: This API element is subject to removal in a future version.static com.helger.commons.collection.impl.ICommonsList
<com.helger.peppolid.IDocumentTypeIdentifier> getAllDocumentTypes
(com.helger.xsds.peppol.smp1.ServiceGroupType aSG) Extract all parsable document types from the passed Service group.static com.helger.commons.collection.impl.ICommonsList
<com.helger.peppolid.IDocumentTypeIdentifier> getAllDocumentTypes
(com.helger.xsds.peppol.smp1.ServiceGroupType aSG, com.helger.peppolid.factory.IIdentifierFactory aIdentifierFactory, Consumer<String> aUnhandledHrefHandler) Extract all parsable document types from the passed Service group.com.helger.xsds.peppol.smp1.CompleteServiceGroupType
getCompleteServiceGroup
(com.helger.peppolid.IParticipantIdentifier aServiceGroupID) Deprecated, for removal: This API element is subject to removal in a future version.Because this API is non-standard for the Peppol SMPcom.helger.xsds.peppol.smp1.CompleteServiceGroupType
getCompleteServiceGroup
(String sCompleteURI) Deprecated, for removal: This API element is subject to removal in a future version.Because this API is non-standard for the Peppol SMPstatic com.helger.xsds.peppol.smp1.CompleteServiceGroupType
getCompleteServiceGroupByDNS
(ISMPURLProvider aURLProvider, com.helger.peppol.sml.ISMLInfo aSMLInfo, com.helger.peppolid.IParticipantIdentifier aServiceGroupID) Deprecated, for removal: This API element is subject to removal in a future version.com.helger.xsds.peppol.smp1.CompleteServiceGroupType
getCompleteServiceGroupOrNull
(com.helger.peppolid.IParticipantIdentifier aServiceGroupID) Deprecated, for removal: This API element is subject to removal in a future version.Because this API is non-standard for the Peppol SMPstatic com.helger.xsds.peppol.smp1.EndpointType
getEndpoint
(com.helger.xsds.peppol.smp1.ServiceMetadataType aServiceMetadata, com.helger.peppolid.IProcessIdentifier aProcessID, com.helger.peppol.smp.ISMPTransportProfile aTransportProfile) Extract the Endpoint from the ServiceMetadata that matches the passed process ID and the optional required transport profile.static com.helger.xsds.peppol.smp1.EndpointType
getEndpoint
(com.helger.xsds.peppol.smp1.SignedServiceMetadataType aSignedServiceMetadata, com.helger.peppolid.IProcessIdentifier aProcessID, com.helger.peppol.smp.ISMPTransportProfile aTransportProfile) Extract the Endpoint from the signedServiceMetadata that matches the passed process ID and the optional required transport profile.static String
getEndpointAddress
(com.helger.xsds.peppol.smp1.EndpointType aEndpoint) Get the endpoint address URI from the provided SMP endpoint.static com.helger.xsds.peppol.smp1.EndpointType
getEndpointAt
(com.helger.xsds.peppol.smp1.ServiceMetadataType aServiceMetadata, com.helger.peppolid.IProcessIdentifier aProcessID, com.helger.peppol.smp.ISMPTransportProfile aTransportProfile, LocalDateTime aCheckDT) Extract the Endpoint from the ServiceMetadata that matches the passed process ID and the optional required transport profile.static com.helger.xsds.peppol.smp1.EndpointType
getEndpointAt
(com.helger.xsds.peppol.smp1.SignedServiceMetadataType aSignedServiceMetadata, com.helger.peppolid.IProcessIdentifier aProcessID, com.helger.peppol.smp.ISMPTransportProfile aTransportProfile, LocalDateTime aCheckDT) Extract the Endpoint from the signedServiceMetadata that matches the passed process ID and the optional required transport profile.static X509Certificate
getEndpointCertificate
(com.helger.xsds.peppol.smp1.EndpointType aEndpoint) Get the certificate bytes from the specified endpoint.static String
getEndpointCertificateString
(com.helger.xsds.peppol.smp1.EndpointType aEndpoint) Get the certificate string from the provided SMP endpoint.com.helger.xsds.peppol.smp1.SignedServiceMetadataType
getSchemeSpecificServiceMetadata
(com.helger.peppolid.IParticipantIdentifier aServiceGroupID, com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) com.helger.xsds.peppol.smp1.SignedServiceMetadataType
getSchemeSpecificServiceMetadataOrNull
(com.helger.peppolid.IParticipantIdentifier aServiceGroupID, com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) This API is to resolve the Service Metadata based on the provided Document Type ID following the Peppol Policy for use of Identifiers 4.3.0.
Forbusdox-docid-qns
only exact match is supported.com.helger.xsds.peppol.smp1.ServiceGroupType
getServiceGroup
(com.helger.peppolid.IParticipantIdentifier aServiceGroupID) Returns a service group.static com.helger.xsds.peppol.smp1.ServiceGroupType
getServiceGroupByDNS
(ISMPURLProvider aURLProvider, com.helger.peppol.sml.ISMLInfo aSMLInfo, com.helger.peppolid.IParticipantIdentifier aServiceGroupID) Returns a service group.com.helger.xsds.peppol.smp1.ServiceGroupType
getServiceGroupOrNull
(com.helger.peppolid.IParticipantIdentifier aServiceGroupID) Returns a service group.com.helger.xsds.peppol.smp1.ServiceGroupReferenceListType
getServiceGroupReferenceList
(String sUserID, com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) Deprecated, for removal: This API element is subject to removal in a future version.com.helger.xsds.peppol.smp1.ServiceGroupReferenceListType
getServiceGroupReferenceListOrNull
(String sUserID, com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) Deprecated, for removal: This API element is subject to removal in a future version.com.helger.xsds.peppol.smp1.SignedServiceMetadataType
getServiceMetadata
(com.helger.peppolid.IParticipantIdentifier aServiceGroupID, com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) Gets a signed service metadata object given by its service group id and its document type.com.helger.xsds.peppol.smp1.SignedServiceMetadataType
getServiceMetadataOrNull
(com.helger.peppolid.IParticipantIdentifier aServiceGroupID, com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) Gets a signed service metadata object given by its service group id and its document type.
This is a specification compliant method.static com.helger.xsds.peppol.smp1.SignedServiceMetadataType
getServiceRegistrationByDNS
(ISMPURLProvider aURLProvider, com.helger.peppol.sml.ISMLInfo aSMLInfo, com.helger.peppolid.IParticipantIdentifier aServiceGroupID, com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) Gets a signed service metadata object given by its service group id and its document type.com.helger.xsds.peppol.smp1.SignedServiceMetadataType
getWildcardServiceMetadataOrNull
(com.helger.peppolid.IParticipantIdentifier aServiceGroupID, com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) Deprecated, for removal: This API element is subject to removal in a future version.com.helger.xsds.peppol.smp1.SignedServiceMetadataType
getWildcardServiceMetadataOrNull
(com.helger.peppolid.IParticipantIdentifier aServiceGroupID, com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID, PeppolWildcardSelector.EMode eSelectionMode) Wildcard aware SMP lookup for PFUOI 4.2.com.helger.xsds.peppol.smp1.SignedServiceMetadataType
getWildcardServiceMetadataOrNull
(com.helger.xsds.peppol.smp1.ServiceGroupType aServiceGroup, com.helger.peppolid.IParticipantIdentifier aServiceGroupID, com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) Deprecated, for removal: This API element is subject to removal in a future version.com.helger.xsds.peppol.smp1.SignedServiceMetadataType
getWildcardServiceMetadataOrNull
(com.helger.xsds.peppol.smp1.ServiceGroupType aServiceGroup, com.helger.peppolid.IParticipantIdentifier aServiceGroupID, com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID, PeppolWildcardSelector.EMode eSelectionMode) Wildcard aware SMP lookup for PFUOI 4.2.static boolean
isEndpointValidAt
(com.helger.xsds.peppol.smp1.EndpointType aEndpoint, LocalDateTime aCheckDT) Check if the provided SMP endpoint is valid at the provided date and time.Methods inherited from class com.helger.smpclient.httpclient.AbstractGenericSMPClient
containsRedirectSubject, createHttpContext, customizeMarshaller, executeGenericRequest, executeRequest, getConvertedException, getMarshallerCustomizer, getSMPHostURI, getTrustStore, httpClientSettings, isFollowSMPRedirects, isSecureValidation, isVerifySignature, isXMLSchemaValidation, setFollowSMPRedirects, setMarshallerCustomizer, setSecureValidation, setTrustStore, setVerifySignature, setXMLSchemaValidation, toString, withHttpClientSettings
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.helger.commons.traits.IGenericImplTrait
thisAsT
Methods inherited from interface com.helger.smpclient.peppol.ISMPExtendedServiceMetadataProvider
getEndpoint, getEndpointAddress, getEndpointAddressAt, getEndpointAt, getEndpointCertificate, getEndpointCertificateAt, getEndpointCertificateString, getEndpointCertificateStringAt
-
Field Details
-
URL_PART_COMPLETE
- See Also:
-
URL_PART_LIST
- See Also:
-
URL_PART_SERVICES
- See Also:
-
-
Constructor Details
-
SMPClientReadOnly
public SMPClientReadOnly(@Nonnull ISMPURLProvider aURLProvider, @Nonnull com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, @Nonnull com.helger.peppol.sml.ISMLInfo aSMLInfo) throws SMPDNSResolutionException Constructor with SML lookup- Parameters:
aURLProvider
- The URL provider to be used. May not benull
.aParticipantIdentifier
- The participant identifier to be used. Required to build the SMP access URI.aSMLInfo
- The SML to be used. Required to build the SMP access URI.- Throws:
SMPDNSResolutionException
- if DNS resolution fails- See Also:
-
SMPClientReadOnly
public SMPClientReadOnly(@Nonnull ISMPURLProvider aURLProvider, @Nonnull com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, @Nonnull @Nonempty String sSMLZoneName) throws SMPDNSResolutionException Constructor with SML lookup- Parameters:
aURLProvider
- The URL provider to be used. May not benull
.aParticipantIdentifier
- The participant identifier to be used. Required to build the SMP access URI.sSMLZoneName
- The SML DNS zone name to be used. Required to build the SMP access URI. Must end with a trailing dot (".") and may neither benull
nor empty to build a correct URL. May not start with "http://". Example:sml.peppolcentral.org.
- Throws:
SMPDNSResolutionException
- if DNS resolution fails- See Also:
-
SMPClientReadOnly
Constructor with a direct SMP URL.
Remember: must be HTTP and using port 80 only!- Parameters:
aSMPHost
- The address of the SMP service. Must be port 80 and basic http only (no https!). Example: http://smpcompany.company.org
-
-
Method Details
-
getServiceGroupReferenceList
@Nonnull @Deprecated(forRemoval=true, since="9.6.0") public com.helger.xsds.peppol.smp1.ServiceGroupReferenceListType getServiceGroupReferenceList(@Nonnull String sUserID, @Nonnull com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) throws SMPClientException Deprecated, for removal: This API element is subject to removal in a future version.Gets a list of references to the CompleteServiceGroup's owned by the specified userId.
NOTE: this API is NOT supported by all SMP implementations. It is based on a proprietary API provided by the Peppol reference implementation and now supported by phoss SMP but not all other SMPs.- Parameters:
sUserID
- The username for which to retrieve service groups.aCredentials
- The user name and password to use as credentials.- Returns:
- A list of references to complete service groups and never
null
. - Throws:
SMPClientException
- in case something goes wrongSMPClientUnauthorizedException
- The username or password was not correct.SMPClientParticipantNotFoundException
- The service group id does not exist in the network.SMPClientNotFoundException
- The service group id or document types did not exist.SMPClientBadRequestException
- The request was not well formed.- See Also:
-
getServiceGroupReferenceListOrNull
@Nullable @Deprecated(forRemoval=true, since="9.6.0") public com.helger.xsds.peppol.smp1.ServiceGroupReferenceListType getServiceGroupReferenceListOrNull(@Nonnull String sUserID, @Nonnull com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) throws SMPClientException Deprecated, for removal: This API element is subject to removal in a future version.Gets a list of references to the CompleteServiceGroup's owned by the specified userId.
NOTE: this API is NOT supported by all SMP implementations. It is based on a proprietary API provided by the Peppol reference implementation and now supported by phoss SMP but not all other SMPs.- Parameters:
sUserID
- The username for which to retrieve service groups.aCredentials
- The user name and password to use as credentials.- Returns:
- A list of references to complete service groups or
null
if no such user exists. - Throws:
SMPClientException
- in case something goes wrongSMPClientUnauthorizedException
- The username or password was not correct.SMPClientBadRequestException
- The request was not well formed.- See Also:
-
getCompleteServiceGroup
@Nonnull @Deprecated(forRemoval=true, since="9.6.0") public com.helger.xsds.peppol.smp1.CompleteServiceGroupType getCompleteServiceGroup(@Nonnull String sCompleteURI) throws SMPClientException Deprecated, for removal: This API element is subject to removal in a future version.Because this API is non-standard for the Peppol SMPReturns a complete service group. A complete service group contains both the service group and the service metadata. This is a non-specification compliant method.
NOTE: this API is NOT supported by all SMP implementations. It is based on a proprietary API provided by the Peppol reference implementation and now supported by phoss SMP but not all other SMPs.- Parameters:
sCompleteURI
- The complete URL for the full service group to query.- Returns:
- The complete service group containing service group and service
metadata. Never
null
. - Throws:
SMPClientException
- in case something goes wrongSMPClientUnauthorizedException
- A HTTP Forbidden was received, should not happen.SMPClientParticipantNotFoundException
- The service group id does not exist in the network.SMPClientNotFoundException
- The service group id or document types did not exist.SMPClientBadRequestException
- The request was not well formed.- See Also:
-
getCompleteServiceGroup
@Nonnull @Deprecated(forRemoval=true, since="9.6.0") public com.helger.xsds.peppol.smp1.CompleteServiceGroupType getCompleteServiceGroup(@Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID) throws SMPClientException Deprecated, for removal: This API element is subject to removal in a future version.Because this API is non-standard for the Peppol SMPReturns a complete service group. A complete service group contains both the service group and the service metadata. This is a non-specification compliant method.
NOTE: this API is NOT supported by all SMP implementations. It is based on a proprietary API provided by the Peppol reference implementation and now supported by phoss SMP but not all other SMPs.- Parameters:
aServiceGroupID
- The service group id corresponding to the service group which one wants to get.- Returns:
- The complete service group containing service group and service
metadata. Never
null
. - Throws:
SMPClientException
- in case something goes wrongSMPClientUnauthorizedException
- A HTTP Forbidden was received, should not happen.SMPClientParticipantNotFoundException
- The service group id does not exist in the network.SMPClientNotFoundException
- The service group id or document types did not exist.SMPClientBadRequestException
- The request was not well formed.- See Also:
-
getCompleteServiceGroupOrNull
@Nullable @Deprecated(forRemoval=true, since="9.6.0") public com.helger.xsds.peppol.smp1.CompleteServiceGroupType getCompleteServiceGroupOrNull(@Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID) throws SMPClientException Deprecated, for removal: This API element is subject to removal in a future version.Because this API is non-standard for the Peppol SMPReturns a complete service group. A complete service group contains both the service group and the service metadata. This is a non-specification compliant method.
NOTE: this API is NOT supported by all SMP implementations. It is based on a proprietary API provided by the Peppol reference implementation and now supported by phoss SMP but not all other SMPs.- Parameters:
aServiceGroupID
- The service group id corresponding to the service group which one wants to get.- Returns:
- The complete service group containing service group and service
metadata or
null
if no such service group exists. - Throws:
SMPClientException
- in case something goes wrongSMPClientUnauthorizedException
- A HTTP Forbidden was received, should not happen.SMPClientBadRequestException
- The request was not well formed.- See Also:
-
getServiceGroup
@Nonnull public com.helger.xsds.peppol.smp1.ServiceGroupType getServiceGroup(@Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID) throws SMPClientException Description copied from interface:ISMPServiceGroupProvider
Returns a service group. A service group references to the service metadata. This is a specification compliant method.- Specified by:
getServiceGroup
in interfaceISMPServiceGroupProvider
- Parameters:
aServiceGroupID
- The ID of the service group to retrieve. May not benull
.- Returns:
- The service group. Maybe
null
. - Throws:
SMPClientException
- in case something goes wrong- See Also:
-
getServiceGroupOrNull
@Nullable public com.helger.xsds.peppol.smp1.ServiceGroupType getServiceGroupOrNull(@Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID) throws SMPClientException Description copied from interface:ISMPServiceGroupProvider
Returns a service group. A service group references to the service metadata. This is a specification compliant method.- Specified by:
getServiceGroupOrNull
in interfaceISMPServiceGroupProvider
- Parameters:
aServiceGroupID
- The ID of the service group to retrieve. May not benull
.- Returns:
- The service group. Maybe
null
. - Throws:
SMPClientException
- in case something goes wrong- See Also:
-
getAllDocumentTypes
@Nonnull public static com.helger.commons.collection.impl.ICommonsList<com.helger.peppolid.IDocumentTypeIdentifier> getAllDocumentTypes(@Nullable com.helger.xsds.peppol.smp1.ServiceGroupType aSG) Extract all parsable document types from the passed Service group. This method always usesPeppolIdentifierFactory
to parse the document type identifiers.- Parameters:
aSG
- The service group to parse. May benull
.- Returns:
- Never
null
but a maybe empty list. - Since:
- 8.0.4
- See Also:
-
getAllDocumentTypes
@Nonnull public static com.helger.commons.collection.impl.ICommonsList<com.helger.peppolid.IDocumentTypeIdentifier> getAllDocumentTypes(@Nullable com.helger.xsds.peppol.smp1.ServiceGroupType aSG, @Nonnull com.helger.peppolid.factory.IIdentifierFactory aIdentifierFactory, @Nullable Consumer<String> aUnhandledHrefHandler) Extract all parsable document types from the passed Service group. This method uses the providedIIdentifierFactory
to parse the document type identifiers.- Parameters:
aSG
- The service group to parse. May benull
.aIdentifierFactory
- The identifier factory to be used. May not benull
.aUnhandledHrefHandler
- An optional consumer for Hrefs that could not be parsed into a document type identifier. May benull
.- Returns:
- Never
null
but a maybe empty list. - Since:
- 8.0.4
-
getServiceMetadata
@Nonnull public com.helger.xsds.peppol.smp1.SignedServiceMetadataType getServiceMetadata(@Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID, @Nonnull com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) throws SMPClientException Gets a signed service metadata object given by its service group id and its document type. This method does not do anything specific with wildcards or so. It simply queries the SMP with the provided data.
This is a specification compliant method.- Specified by:
getServiceMetadata
in interfaceISMPServiceMetadataProvider
- Parameters:
aServiceGroupID
- The service group id of the service metadata to get. May not benull
.aDocumentTypeID
- The document type of the service metadata to get. May not benull
.- Returns:
- A signed service metadata object. Never
null
. - Throws:
SMPClientException
- in case something goes wrongSMPClientUnauthorizedException
- A HTTP Forbidden was received, should not happen.SMPClientParticipantNotFoundException
- The service group id does not exist in the network.SMPClientNotFoundException
- The service group id or document types did not exist.SMPClientBadRequestException
- The request was not well formed.- Since:
- v8.0.0
- See Also:
-
getServiceMetadataOrNull
@Nullable public com.helger.xsds.peppol.smp1.SignedServiceMetadataType getServiceMetadataOrNull(@Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID, @Nonnull com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) throws SMPClientException Gets a signed service metadata object given by its service group id and its document type.
This is a specification compliant method.- Specified by:
getServiceMetadataOrNull
in interfaceISMPServiceMetadataProvider
- Parameters:
aServiceGroupID
- The service group id of the service metadata to get. May not benull
.aDocumentTypeID
- The document type of the service metadata to get. May not benull
.- Returns:
- A signed service metadata object or
null
if no such registration is present. - Throws:
SMPClientException
- in case something goes wrongSMPClientUnauthorizedException
- A HTTP Forbidden was received, should not happen.SMPClientBadRequestException
- The request was not well formed.- Since:
- v8.0.0
- See Also:
-
getEndpoint
@Nullable public static com.helger.xsds.peppol.smp1.EndpointType getEndpoint(@Nonnull com.helger.xsds.peppol.smp1.SignedServiceMetadataType aSignedServiceMetadata, @Nonnull com.helger.peppolid.IProcessIdentifier aProcessID, @Nonnull com.helger.peppol.smp.ISMPTransportProfile aTransportProfile) Extract the Endpoint from the signedServiceMetadata that matches the passed process ID and the optional required transport profile. This method checks the validity of the endpoint at the current point in time.- Parameters:
aSignedServiceMetadata
- The signed service meta data object (e.g. from a call togetServiceMetadataOrNull(IParticipantIdentifier, IDocumentTypeIdentifier)
. May not benull
.aProcessID
- The process identifier to be looked up. May not benull
.aTransportProfile
- The required transport profile to be used. May not benull
.- Returns:
null
if no matching endpoint was found- See Also:
-
getEndpointAt
@Nullable public static com.helger.xsds.peppol.smp1.EndpointType getEndpointAt(@Nonnull com.helger.xsds.peppol.smp1.SignedServiceMetadataType aSignedServiceMetadata, @Nonnull com.helger.peppolid.IProcessIdentifier aProcessID, @Nonnull com.helger.peppol.smp.ISMPTransportProfile aTransportProfile, @Nonnull LocalDateTime aCheckDT) Extract the Endpoint from the signedServiceMetadata that matches the passed process ID and the optional required transport profile.- Parameters:
aSignedServiceMetadata
- The signed service meta data object (e.g. from a call togetServiceMetadataOrNull(IParticipantIdentifier, IDocumentTypeIdentifier)
. May not benull
.aProcessID
- The process identifier to be looked up. May not benull
.aTransportProfile
- The required transport profile to be used. May not benull
.aCheckDT
- The date and time for when the endpoint is meant to be valid if the end point contains a ServiceActivationDate and/or a ServiceExpirationDate. May not benull
.- Returns:
null
if no matching endpoint was found- Since:
- 8.7.3
-
getEndpoint
@Nullable public static com.helger.xsds.peppol.smp1.EndpointType getEndpoint(@Nonnull com.helger.xsds.peppol.smp1.ServiceMetadataType aServiceMetadata, @Nonnull com.helger.peppolid.IProcessIdentifier aProcessID, @Nonnull com.helger.peppol.smp.ISMPTransportProfile aTransportProfile) Extract the Endpoint from the ServiceMetadata that matches the passed process ID and the optional required transport profile. This method checks the validity of the endpoint at the current point in time.- Parameters:
aServiceMetadata
- The unsigned service meta data object. May not benull
.aProcessID
- The process identifier to be looked up. May not benull
.aTransportProfile
- The required transport profile to be used. May not benull
.- Returns:
null
if no matching endpoint was found- Since:
- 8.2.6
-
isEndpointValidAt
public static boolean isEndpointValidAt(@Nonnull com.helger.xsds.peppol.smp1.EndpointType aEndpoint, @Nonnull LocalDateTime aCheckDT) Check if the provided SMP endpoint is valid at the provided date and time. This is to ensure the ServiceActionDate and ServiceExpirationDate values are honoured according to the changes in the Peppol SMP 1.2.0 specification.- Parameters:
aEndpoint
- The SMP endpoint to check. May not benull
.aCheckDT
- The date and time at which the check is performed. May not benull
.- Returns:
true
if the endpoint is valid,false
if not.- Since:
- 8.7.3
-
getEndpointAt
@Nullable public static com.helger.xsds.peppol.smp1.EndpointType getEndpointAt(@Nonnull com.helger.xsds.peppol.smp1.ServiceMetadataType aServiceMetadata, @Nonnull com.helger.peppolid.IProcessIdentifier aProcessID, @Nonnull com.helger.peppol.smp.ISMPTransportProfile aTransportProfile, @Nonnull LocalDateTime aCheckDT) Extract the Endpoint from the ServiceMetadata that matches the passed process ID and the optional required transport profile.- Parameters:
aServiceMetadata
- The unsigned service meta data object. May not benull
.aProcessID
- The process identifier to be looked up. May not benull
.aTransportProfile
- The required transport profile to be used. May not benull
.aCheckDT
- The date and time for when the endpoint is meant to be valid if the end point contains a ServiceActivationDate and/or a ServiceExpirationDate. May not benull
.- Returns:
null
if no matching endpoint was found- Since:
- 8.7.3
-
getEndpointAddress
@Nullable public static String getEndpointAddress(@Nullable com.helger.xsds.peppol.smp1.EndpointType aEndpoint) Get the endpoint address URI from the provided SMP endpoint.- Parameters:
aEndpoint
- The endpoint to be used. May benull
.- Returns:
null
if the endpoint isnull
if the endpoint has no address URI.
-
getEndpointCertificateString
@Nullable public static String getEndpointCertificateString(@Nullable com.helger.xsds.peppol.smp1.EndpointType aEndpoint) Get the certificate string from the provided SMP endpoint.- Parameters:
aEndpoint
- The endpoint to be used. May benull
.- Returns:
null
if the endpoint isnull
if the endpoint has no certificate.
-
getEndpointCertificate
@Nullable public static X509Certificate getEndpointCertificate(@Nullable com.helger.xsds.peppol.smp1.EndpointType aEndpoint) throws CertificateException Get the certificate bytes from the specified endpoint.- Parameters:
aEndpoint
- The endpoint to be used. May benull
.- Returns:
null
if no such endpoint exists, or if the endpoint has no certificate- Throws:
CertificateException
- In case the conversion from byte to X509 certificate failed
-
getSchemeSpecificServiceMetadata
@Nullable public com.helger.xsds.peppol.smp1.SignedServiceMetadataType getSchemeSpecificServiceMetadata(@Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID, @Nonnull com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) throws SMPClientException - Throws:
SMPClientException
-
getSchemeSpecificServiceMetadataOrNull
@Nullable public com.helger.xsds.peppol.smp1.SignedServiceMetadataType getSchemeSpecificServiceMetadataOrNull(@Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID, @Nonnull com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) throws SMPClientException Description copied from interface:ISMPExtendedServiceMetadataProvider
This API is to resolve the Service Metadata based on the provided Document Type ID following the Peppol Policy for use of Identifiers 4.3.0.
- For
busdox-docid-qns
only exact match is supported. Here it will directly query the Service Metadata. (1 SMP query in total) - For
peppol-doctype
both exact match and best match are supported. The wildcard indicator may or may not be present. Here it will first query the SMP for list of all document types, find the best match document type and finally do the SMP query Service Metadata. (2 SMP queries in total)
- Specified by:
getSchemeSpecificServiceMetadataOrNull
in interfaceISMPExtendedServiceMetadataProvider
- Parameters:
aServiceGroupID
- The participant ID to lookup. May not benull
.aDocumentTypeID
- The document type to lookup. May not benull
.- Returns:
null
if no such service metadata could be found.- Throws:
SMPClientException
- In case of error- See Also:
- For
-
forEachMatchingWildcardDocumentType
@Deprecated(forRemoval=true, since="9.2.0") public static void forEachMatchingWildcardDocumentType(@Nonnull com.helger.commons.collection.impl.ICommonsList<? extends com.helger.peppolid.IDocumentTypeIdentifier> aBaseDocTypes, @Nonnull @Nonempty String sDocTypeValue, @Nonnull Function<? super com.helger.peppolid.IDocumentTypeIdentifier, com.helger.commons.state.EContinue> aMatchingDocTypeConsumer) Deprecated, for removal: This API element is subject to removal in a future version.UsePeppolWildcardSelector
insteadHelper method to iterate all matching document type identifiers. This method prefers direct matches ("busdox-docid-qns") over wildcard matches ("peppol-doctype-wildcard").- Parameters:
aBaseDocTypes
- The list of document types to filter. Usually this list was obtained from an SMP query "get all receiving capabilities of participant". May not benull
, but maybe empty.sDocTypeValue
- The document type identifier value (!) without the scheme to search. The schemes are added internally automatically.aMatchingDocTypeConsumer
- The consumer to be invoked for each match. May not benull
.- Since:
- 8.8.1
-
getWildcardServiceMetadataOrNull
@Nullable @Deprecated(forRemoval=true, since="9.2.0") public com.helger.xsds.peppol.smp1.SignedServiceMetadataType getWildcardServiceMetadataOrNull(@Nonnull com.helger.xsds.peppol.smp1.ServiceGroupType aServiceGroup, @Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID, @Nonnull com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) throws SMPClientException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
SMPClientException
-
getWildcardServiceMetadataOrNull
@Nullable @Deprecated(forRemoval=true, since="9.2.0") public com.helger.xsds.peppol.smp1.SignedServiceMetadataType getWildcardServiceMetadataOrNull(@Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID, @Nonnull com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) throws SMPClientException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
SMPClientException
-
getWildcardServiceMetadataOrNull
public com.helger.xsds.peppol.smp1.SignedServiceMetadataType getWildcardServiceMetadataOrNull(@Nonnull com.helger.xsds.peppol.smp1.ServiceGroupType aServiceGroup, @Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID, @Nonnull com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID, @Nonnull PeppolWildcardSelector.EMode eSelectionMode) throws SMPClientException Description copied from interface:ISMPExtendedServiceMetadataProvider
Wildcard aware SMP lookup for PFUOI 4.2. It interprets the wildcard character (*
) appropriately and tries all possibilities. Internally it searches the closest possible match using the provided selection algorithm (mode).- Specified by:
getWildcardServiceMetadataOrNull
in interfaceISMPExtendedServiceMetadataProvider
- Parameters:
aServiceGroup
- The service group previously queried. May not benull
.aServiceGroupID
- Receiver ID. May not benull
.aDocumentTypeID
- Source document type ID. May not benull
. The document type may use any document type identifier scheme.eSelectionMode
- The Wildcard selection mode to use. Must not benull
.- Returns:
null
if no matching SMP entry was found- Throws:
SMPClientException
- In case of error- See Also:
-
getWildcardServiceMetadataOrNull
public com.helger.xsds.peppol.smp1.SignedServiceMetadataType getWildcardServiceMetadataOrNull(@Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID, @Nonnull com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID, @Nonnull PeppolWildcardSelector.EMode eSelectionMode) throws SMPClientException Description copied from interface:ISMPExtendedServiceMetadataProvider
Wildcard aware SMP lookup for PFUOI 4.2. It interprets the wildcard character (*
) appropriately and tries all possibilities. Internally it works by first querying all the document types viaISMPServiceGroupProvider.getServiceGroupOrNull(IParticipantIdentifier)
and afterwards find the closest possible match using the provided selection algorithm (mode). So this method calls each SMP twice.- Specified by:
getWildcardServiceMetadataOrNull
in interfaceISMPExtendedServiceMetadataProvider
- Parameters:
aServiceGroupID
- Receiver ID. May not benull
.aDocumentTypeID
- Source document type ID. May not benull
. The document type may use any document type identifier scheme.eSelectionMode
- The Wildcard selection mode to use. Must not benull
.- Returns:
null
if no matching SMP entry was found- Throws:
SMPClientException
- In case of error- See Also:
-
getCompleteServiceGroupByDNS
@Nonnull @Deprecated(forRemoval=true, since="9.6.0") public static com.helger.xsds.peppol.smp1.CompleteServiceGroupType getCompleteServiceGroupByDNS(@Nonnull ISMPURLProvider aURLProvider, @Nonnull com.helger.peppol.sml.ISMLInfo aSMLInfo, @Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID) throws SMPClientException, SMPDNSResolutionException Deprecated, for removal: This API element is subject to removal in a future version.Returns a complete service group. A complete service group contains both the service group and the service metadata.
NOTE: this API is NOT supported by all SMP implementations. It is based on a proprietary API provided by the Peppol reference implementation and now supported by phoss SMP but not all other SMPs.- Parameters:
aURLProvider
- The URL provider to be used. May not benull
.aSMLInfo
- The SML object to be usedaServiceGroupID
- The service group id corresponding to the service group which one wants to get.- Returns:
- The complete service group containing service group and service metadata
- Throws:
SMPClientException
- in case something goes wrongSMPDNSResolutionException
- if DNS resolution failsSMPClientUnauthorizedException
- A HTTP Forbidden was received, should not happen.SMPClientParticipantNotFoundException
- The service group id does not exist in the network.SMPClientNotFoundException
- The service group id or document types did not exist.SMPClientBadRequestException
- The request was not well formed.
-
getServiceGroupByDNS
@Nonnull public static com.helger.xsds.peppol.smp1.ServiceGroupType getServiceGroupByDNS(@Nonnull ISMPURLProvider aURLProvider, @Nonnull com.helger.peppol.sml.ISMLInfo aSMLInfo, @Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID) throws SMPClientException, SMPDNSResolutionException Returns a service group. A service group references to the service metadata.- Parameters:
aURLProvider
- The URL provider to be used. May not benull
.aSMLInfo
- The SML object to be usedaServiceGroupID
- The service group id corresponding to the service group which one wants to get.- Returns:
- The service group
- Throws:
SMPClientException
- in case something goes wrongSMPDNSResolutionException
- If DNS resolution failsSMPClientUnauthorizedException
- A HTTP Forbidden was received, should not happen.SMPClientParticipantNotFoundException
- The service group id does not exist in the network.SMPClientNotFoundException
- The service group id or document types did not exist.SMPClientBadRequestException
- The request was not well formed.
-
getServiceRegistrationByDNS
@Nonnull public static com.helger.xsds.peppol.smp1.SignedServiceMetadataType getServiceRegistrationByDNS(@Nonnull ISMPURLProvider aURLProvider, @Nonnull com.helger.peppol.sml.ISMLInfo aSMLInfo, @Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID, @Nonnull com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID) throws SMPClientException, SMPDNSResolutionException Gets a signed service metadata object given by its service group id and its document type.- Parameters:
aURLProvider
- The URL provider to be used. May not benull
.aSMLInfo
- The SML object to be usedaServiceGroupID
- The service group id of the service metadata to get.aDocumentTypeID
- The document type of the service metadata to get.- Returns:
- A signed service metadata object.
- Throws:
SMPClientException
- in case something goes wrongSMPDNSResolutionException
- if DNS resolution failsSMPClientUnauthorizedException
- A HTTP Forbidden was received, should not happen.SMPClientParticipantNotFoundException
- The service group id does not exist in the network.SMPClientNotFoundException
- The service group id or document types did not exist.SMPClientBadRequestException
- The request was not well formed.
-
PeppolWildcardSelector
instead