Search in sources :

Example 1 with IPeppolURLProvider

use of com.helger.smpclient.url.IPeppolURLProvider in project phoss-smp by phax.

the class SMPRestDataProvider method _getDynamicParticipantURLHostName.

@Nonnull
private String _getDynamicParticipantURLHostName() {
    String ret = null;
    final ISMPURLProvider aURLProvider = SMPMetaManager.getSMPURLProvider();
    try {
        if (aURLProvider instanceof IPeppolURLProvider)
            ret = ((IPeppolURLProvider) aURLProvider).getDNSNameOfParticipant(m_aParticipantID, m_sSMLZoneName);
        else if (aURLProvider instanceof IBDXLURLProvider) {
            // Fallback by not resolving the NAPTR
            ret = ((IBDXLURLProvider) aURLProvider).getDNSNameOfParticipant(m_aParticipantID, m_sSMLZoneName);
        }
    } catch (final SMPDNSResolutionException ex) {
    // Ignore
    }
    if (ret == null)
        throw new IllegalStateException("Failed to resolve host name for '" + m_aParticipantID.getURIEncoded() + "' and SML zone name '" + m_sSMLZoneName + "'");
    return ret;
}
Also used : ISMPURLProvider(com.helger.smpclient.url.ISMPURLProvider) SMPDNSResolutionException(com.helger.smpclient.url.SMPDNSResolutionException) IPeppolURLProvider(com.helger.smpclient.url.IPeppolURLProvider) IBDXLURLProvider(com.helger.smpclient.url.IBDXLURLProvider) Nonnull(javax.annotation.Nonnull)

Aggregations

IBDXLURLProvider (com.helger.smpclient.url.IBDXLURLProvider)1 IPeppolURLProvider (com.helger.smpclient.url.IPeppolURLProvider)1 ISMPURLProvider (com.helger.smpclient.url.ISMPURLProvider)1 SMPDNSResolutionException (com.helger.smpclient.url.SMPDNSResolutionException)1 Nonnull (javax.annotation.Nonnull)1