All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.helger.phase4.peppol.IPhase4PeppolEndpointDetailProvider Maven / Gradle / Ivy

There is a newer version: 0.9.16
Show newest version
/**
 * Copyright (C) 2015-2020 Philip Helger (www.helger.com)
 * philip[at]helger[dot]com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.helger.phase4.peppol;

import java.security.cert.X509Certificate;

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

import com.helger.commons.annotation.Nonempty;
import com.helger.peppolid.IDocumentTypeIdentifier;
import com.helger.peppolid.IParticipantIdentifier;
import com.helger.peppolid.IProcessIdentifier;

/**
 * An abstraction for receiving the AP certificate and the destination URL of
 * the receiver. The default case is to use an SMP lookup for this.
 *
 * @author Philip Helger
 * @since 0.9.7
 */
public interface IPhase4PeppolEndpointDetailProvider
{
  /**
   * The initialization method is always called, before the details are queried.
   * This method may be called multiple times, so you may cache internally.
   *
   * @param aDocTypeID
   *        document type ID. May not be null.
   * @param aProcID
   *        Process ID. May not be null.
   * @param aReceiverID
   *        Participant ID of the receiver. May not be null.
   * @throws Phase4PeppolException
   *         in case of error
   */
  void init (@Nonnull IDocumentTypeIdentifier aDocTypeID,
             @Nonnull IProcessIdentifier aProcID,
             @Nonnull IParticipantIdentifier aReceiverID) throws Phase4PeppolException;

  /**
   * @return The X509 Peppol AP Certificate of the receiver. May be
   *         null if it could not be acquired.
   * @throws Phase4PeppolException
   *         In case of an error in determining the certificate.
   */
  @Nullable
  X509Certificate getReceiverAPCertificate () throws Phase4PeppolException;

  /**
   * @return The AS4 endpoint URL of the receiver. May neither be
   *         null nor empty.
   * @throws Phase4PeppolException
   *         In case of an error in determining the endpoint URL.
   */
  @Nonnull
  @Nonempty
  String getReceiverAPEndpointURL () throws Phase4PeppolException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy