Package com.helger.smpclient.bdxr1
Class BDXRClient
java.lang.Object
com.helger.smpclient.httpclient.AbstractGenericSMPClient<BDXRClientReadOnly>
com.helger.smpclient.bdxr1.BDXRClientReadOnly
com.helger.smpclient.bdxr1.BDXRClient
- All Implemented Interfaces:
com.helger.commons.traits.IGenericImplTrait<BDXRClientReadOnly>,IBDXRServiceGroupProvider,IBDXRServiceMetadataProvider
This class is used for calling the OASIS BDXR SMP v1 REST interface. This
particular class also contains the non-standard writing methods. It inherits
all reading methods from
BDXRClientReadOnly.
Note: this class is also licensed under Apache 2 license, as it was not part of the original implementation
- Author:
- Philip Helger
-
Field Summary
Fields inherited from class com.helger.smpclient.bdxr1.BDXRClientReadOnly
URL_PART_SERVICESFields inherited from class com.helger.smpclient.httpclient.AbstractGenericSMPClient
CONTENT_TYPE_TEXT_XML, DEFAULT_FOLLOW_REDIRECTS, DEFAULT_XML_SCHEMA_VALIDATION -
Constructor Summary
ConstructorsConstructorDescriptionBDXRClient(ISMPURLProvider aURLProvider, com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, com.helger.peppol.sml.ISMLInfo aSMLInfo) Constructor with SML lookupBDXRClient(ISMPURLProvider aURLProvider, com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, String sSMLZoneName) Constructor with SML lookupBDXRClient(URI aSMPHost) Constructor with a direct SMP URL.
Remember: must be HTTP and using port 80 only! -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteServiceGroup(com.helger.peppolid.IParticipantIdentifier aServiceGroupID, com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) Deletes a service group given by its service group id.voiddeleteServiceRegistration(com.helger.peppolid.IParticipantIdentifier aServiceGroupID, com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID, com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) Deletes a service meta data object given by its service group id and its document type.com.helger.xsds.bdxr.smp1.ServiceGroupTypesaveServiceGroup(com.helger.peppolid.IParticipantIdentifier aParticipantID, com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) Saves a service group.voidsaveServiceGroup(com.helger.xsds.bdxr.smp1.ServiceGroupType aServiceGroup, com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) Saves a service group.voidsaveServiceInformation(com.helger.xsds.bdxr.smp1.ServiceInformationType aServiceInformation, com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) Saves a service information data object.voidsaveServiceRedirect(com.helger.xsds.bdxr.smp1.ParticipantIdentifierType aServiceGroupID, com.helger.xsds.bdxr.smp1.DocumentIdentifierType aDocumentTypeID, com.helger.xsds.bdxr.smp1.RedirectType aRedirect, com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) Saves a redirect data object.Methods inherited from class com.helger.smpclient.bdxr1.BDXRClientReadOnly
getAllDocumentTypes, getEndpoint, getEndpoint, getEndpointAddress, getEndpointCertificate, getEndpointCertificateBytes, getEndpointCertificateOrNull, getServiceGroup, getServiceGroupByDNS, getServiceGroupOrNull, getServiceMetadata, getServiceMetadataOrNull, getServiceRegistrationByDNSMethods 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, withHttpClientSettingsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.smpclient.bdxr1.IBDXRServiceMetadataProvider
getEndpoint, getEndpointAddress, getEndpointCertificate, getEndpointCertificateBytesMethods inherited from interface com.helger.commons.traits.IGenericImplTrait
thisAsT
-
Constructor Details
-
BDXRClient
public BDXRClient(@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:
-
BDXRClient
public BDXRClient(@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 benullnor empty to build a correct URL. May not start with "http://". Example:sml.peppolcentral.org.- Throws:
SMPDNSResolutionException- if DNS resolution fails- See Also:
-
BDXRClient
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
-
saveServiceGroup
public void saveServiceGroup(@Nonnull com.helger.xsds.bdxr.smp1.ServiceGroupType aServiceGroup, @Nonnull com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) throws SMPClientException Saves a service group. The meta data references should not be set and are not used.- Parameters:
aServiceGroup- The service group to save. May not benull.aCredentials- The user name and password to use as credentials. May not benull.- Throws:
SMPClientException- in case something goes wrongSMPClientUnauthorizedException- The user name or password was not correct.SMPClientNotFoundException- A HTTP Not Found was received. This can happen if the service was not found.SMPClientBadRequestException- The request was not well formed.
-
saveServiceGroup
@Nonnull public com.helger.xsds.bdxr.smp1.ServiceGroupType saveServiceGroup(@Nonnull com.helger.peppolid.IParticipantIdentifier aParticipantID, @Nonnull com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) throws SMPClientException Saves a service group. The meta data references should not be set and are not used.- Parameters:
aParticipantID- The participant identifier for which the service group is to save.aCredentials- The user name and password to use as credentials.- Returns:
- The created
ServiceGroupTypeobject. - Throws:
SMPClientException- in case something goes wrongSMPClientUnauthorizedException- The user name or password was not correct.SMPClientNotFoundException- A HTTP Not Found was received. This can happen if the service was not found.SMPClientBadRequestException- The request was not well formed.
-
deleteServiceGroup
public void deleteServiceGroup(@Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID, @Nonnull com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) throws SMPClientException Deletes a service group given by its service group id.- Parameters:
aServiceGroupID- The service group id of the service group to delete. May not benull.aCredentials- The user name and password to use as credentials. May not benull.- Throws:
SMPClientException- in case something goes wrongSMPClientParticipantNotFoundException- The service group id does not exist in the network.SMPClientNotFoundException- The service group id or document types did not exist.SMPClientUnauthorizedException- The user name or password was not correct.SMPClientBadRequestException- The request was not well formed.
-
saveServiceInformation
public void saveServiceInformation(@Nonnull com.helger.xsds.bdxr.smp1.ServiceInformationType aServiceInformation, @Nonnull com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) throws SMPClientException Saves a service information data object.- Parameters:
aServiceInformation- The service information object to save. May not benull.aCredentials- The user name and password to use as credentials. May not benull.- Throws:
SMPClientException- in case something goes wrongSMPClientUnauthorizedException- The user name 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:
-
saveServiceRedirect
public void saveServiceRedirect(@Nonnull com.helger.xsds.bdxr.smp1.ParticipantIdentifierType aServiceGroupID, @Nonnull com.helger.xsds.bdxr.smp1.DocumentIdentifierType aDocumentTypeID, @Nonnull com.helger.xsds.bdxr.smp1.RedirectType aRedirect, @Nonnull com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) throws SMPClientException Saves a redirect data object.- Parameters:
aServiceGroupID- The service group ID to use. May not benull.aDocumentTypeID- The document type ID to use. May not benull.aRedirect- The redirect to be saved. May not benull.aCredentials- The user name and password to use as credentials. May not benull.- Throws:
SMPClientException- in case something goes wrongSMPClientUnauthorizedException- The user name 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:
-
deleteServiceRegistration
public void deleteServiceRegistration(@Nonnull com.helger.peppolid.IParticipantIdentifier aServiceGroupID, @Nonnull com.helger.peppolid.IDocumentTypeIdentifier aDocumentTypeID, @Nonnull com.helger.http.basicauth.BasicAuthClientCredentials aCredentials) throws SMPClientException Deletes a service meta data object given by its service group id and its document type.- Parameters:
aServiceGroupID- The service group id of the service meta data to delete. May not benull.aDocumentTypeID- The document type of the service meta data to delete. May not benull.aCredentials- The user name and password to use as credentials. May not benull.- Throws:
SMPClientException- in case something goes wrongSMPClientUnauthorizedException- The user name 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.
-