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

com.helger.phase4.cef.IPhase4CEFEndpointDetailProvider Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (C) 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.cef;

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.15
 */
public interface IPhase4CEFEndpointDetailProvider
{
  /**
   * 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 Phase4CEFException
   *         in case of error
   */
  void init (@Nonnull IDocumentTypeIdentifier aDocTypeID,
             @Nonnull IProcessIdentifier aProcID,
             @Nonnull IParticipantIdentifier aReceiverID) throws Phase4CEFException;

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy