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

org.digidoc4j.impl.AbstractSignatureValidationResult Maven / Gradle / Ivy

Go to download

DigiDoc4j is a Java library for digitally signing documents and creating digital signature containers of signed documents

The newest version!
/* DigiDoc4J library
 *
 * This software is released under either the GNU Library General Public
 * License (see LICENSE.LGPL).
 *
 * Note that the only valid version of the LGPL license as far as this
 * project is concerned is the original GNU Library General Public License
 * Version 2.1, February 1999
 */

package org.digidoc4j.impl;

import eu.europa.esig.dss.enumerations.Indication;
import eu.europa.esig.dss.enumerations.SignatureQualification;
import eu.europa.esig.dss.enumerations.SubIndication;
import eu.europa.esig.dss.simplereport.SimpleReport;
import org.digidoc4j.SignatureValidationResult;
import org.digidoc4j.impl.asic.report.SignatureValidationReport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Janar Rahumeel (CGI Estonia)
 */
public abstract class AbstractSignatureValidationResult extends AbstractValidationResult implements
    SignatureValidationResult {

  private static final Logger LOGGER = LoggerFactory.getLogger(AbstractSignatureValidationResult.class);
  protected List signatureReports = new ArrayList<>();
  protected List simpleReports = new ArrayList<>();
  protected String report;

  /*
   * ACCESSORS
   */

  @Override
  public List getSignatureReports() { //TODO ASIC specific
    return signatureReports;
  }

  @Override
  public Indication getIndication(String signatureId) {
    LOGGER.info(this.getNotSupportedMessage());
    return null;
  }

  @Override
  public SubIndication getSubIndication(String signatureId) {
    LOGGER.info(this.getNotSupportedMessage());
    return null;
  }

  @Override
  public SignatureQualification getSignatureQualification(String signatureId) {
    LOGGER.info(this.getNotSupportedMessage());
    return null;
  }

  @Override
  public void saveXmlReports(Path directory) {
    LOGGER.info(this.getNotSupportedMessage());
  }

  /*
   * RESTRICTED METHODS
   */

  protected String getNotSupportedMessage() {
    return String.format("Not supported for <%s>", this.getResultName());
  }

  /*
   * ACCESSORS
   */

  @Override
  public List getSimpleReports() {
    return this.simpleReports;
  }

  @Override
  public String getReport() {
    return report;
  }

  public void setReport(String report) {
    this.report = report;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy