Class AsicSCompositeContainer

All Implemented Interfaces:
Serializable, CompositeContainer, Container, org.digidoc4j.impl.ValidatableContainer

public class AsicSCompositeContainer extends AsicSContainer implements CompositeContainer
A special case of ASiC-S container with timestamp tokens, when the datafile of the container is a nested container.
See Also:
  • Constructor Details

    • AsicSCompositeContainer

      public AsicSCompositeContainer(DataFile serializedNestedContainer, Container nestedContainer)
    • AsicSCompositeContainer

      public AsicSCompositeContainer(DataFile serializedNestedContainer, Container nestedContainer, Configuration configuration)
    • AsicSCompositeContainer

      public AsicSCompositeContainer(AsicParseResult containerParseResult, Container nestedContainer, Configuration configuration)
  • Method Details

    • addDataFile

      public DataFile addDataFile(String path, String mimeType)
      Description copied from interface: Container
      Adds a data file from the file system to the container.

      Note: Data files can be added to a container only after all signatures have been removed.

      Specified by:
      addDataFile in interface Container
      Overrides:
      addDataFile in class AsicContainer
      Parameters:
      path - data file to be added to the container
      mimeType - MIME type of the data file, for example 'text/plain' or 'application/msword'
      Returns:
      data file
    • addDataFile

      public DataFile addDataFile(InputStream inputStream, String fileName, String mimeType)
      Description copied from interface: Container
      Adds a data file from the input stream (i.e. the date file content can be read from the internal memory buffer).

      Note: Data files can be added to a container only after all signatures have been removed.

      Specified by:
      addDataFile in interface Container
      Overrides:
      addDataFile in class AsicContainer
      Parameters:
      inputStream - input stream from where data is read
      fileName - data file name in the container
      mimeType - MIME type of the data file, for example 'text/plain' or 'application/msword'
      Returns:
      data file
    • addDataFile

      public DataFile addDataFile(File file, String mimeType)
      Description copied from interface: Container
      Adds a data file from the file system to the container.

      Note: Data files can be added to a container only after all signatures have been removed.

      Specified by:
      addDataFile in interface Container
      Overrides:
      addDataFile in class AsicContainer
      Parameters:
      file - data file to be added to the container
      mimeType - MIME type of the data file, for example 'text/plain' or 'application/msword'
      Returns:
      data file
    • addDataFile

      public void addDataFile(DataFile dataFile)
      Description copied from interface: Container
      Adds the specified data file to the container.

      Note: Data files can be added to a container only after all signatures have been removed.

      Specified by:
      addDataFile in interface Container
      Overrides:
      addDataFile in class AsicContainer
      Parameters:
      dataFile - data file to be added to the container
    • removeDataFile

      public void removeDataFile(DataFile file)
      Description copied from interface: Container
      Removes the data file from the container.

      Note: Data files can be removed from a container only after all signatures have been removed.

      Specified by:
      removeDataFile in interface Container
      Overrides:
      removeDataFile in class AsicContainer
      Parameters:
      file - data file to be removed from the container.
    • getNestingContainerDataFiles

      public List<DataFile> getNestingContainerDataFiles()
      Description copied from interface: CompositeContainer
      Returns the list of data files in the nesting outer container.
      Specified by:
      getNestingContainerDataFiles in interface CompositeContainer
      Returns:
      list of data files in the nesting outer container
    • getNestedContainerDataFiles

      public List<DataFile> getNestedContainerDataFiles()
      Description copied from interface: CompositeContainer
      Returns the list of data files in the nested inner container.
      Specified by:
      getNestedContainerDataFiles in interface CompositeContainer
      Returns:
      list of data files in the nested inner container
    • getNestingContainerSignatures

      public List<Signature> getNestingContainerSignatures()
      Description copied from interface: CompositeContainer
      Returns the list of signatures in the nesting outer container.
      Specified by:
      getNestingContainerSignatures in interface CompositeContainer
      Returns:
      list of signatures in the nesting outer container
    • getNestedContainerSignatures

      public List<Signature> getNestedContainerSignatures()
      Description copied from interface: CompositeContainer
      Returns the list of signatures in the nested inner container.
      Specified by:
      getNestedContainerSignatures in interface CompositeContainer
      Returns:
      list of signatures in the nested inner container
    • getNestingContainerTimestamps

      public List<Timestamp> getNestingContainerTimestamps()
      Description copied from interface: CompositeContainer
      Returns the list of timestamp tokens that cover the contents of the nesting outer container.
      Specified by:
      getNestingContainerTimestamps in interface CompositeContainer
      Returns:
      list of timestamp tokens in the nesting outer container
    • getNestedContainerTimestamps

      public List<Timestamp> getNestedContainerTimestamps()
      Description copied from interface: CompositeContainer
      Returns the list of timestamp tokens that cover the contents of the nested inner container.
      Specified by:
      getNestedContainerTimestamps in interface CompositeContainer
      Returns:
      list of timestamp tokens in the nested inner container
    • getNestedContainerType

      public String getNestedContainerType()
      Description copied from interface: CompositeContainer
      Returns the type of the nested container.
      Specified by:
      getNestedContainerType in interface CompositeContainer
      Returns:
      type of the nested container
      See Also:
    • validate

      public ContainerValidationResult validate()
      Description copied from interface: Container
      Validate container
      Specified by:
      validate in interface Container
      Overrides:
      validate in class AsicContainer
      Returns:
      validation result
    • validateAt

      public ContainerValidationResult validateAt(Date validationTime)
      Description copied from interface: org.digidoc4j.impl.ValidatableContainer
      Validate container against the specified validation time.
      Specified by:
      validateAt in interface org.digidoc4j.impl.ValidatableContainer
      Overrides:
      validateAt in class AsicContainer
      Parameters:
      validationTime - validation time
      Returns:
      container validation result