Interface ElementInspectorService

All Known Implementing Classes:
SuperUserElementInspectorService

public interface ElementInspectorService
Inspects an Element distribution (ELM file) and returns structural metadata describing its contents. The returned ElementPathRecordMetadata describes the paths to all jars and classpath entries found within the distribution, along with the element's manifest and attributes.

All three methods inspect the same logical artifact — an ELM file — sourced from different locations: a raw stream, a Maven artifact repository, or the large-object store.

  • Method Details

    • inspectElement

      List<ElementPathRecordMetadata> inspectElement(InputStream inputStream) throws IOException
      Inspects an ELM distribution read from the supplied InputStream. The stream is expected to contain a valid ELM file (a zip-format archive). The stream is consumed but not closed by this method; the caller retains responsibility for closing it.
      Parameters:
      inputStream - the stream containing the ELM file contents; must not be null
      Returns:
      a ElementPathRecordMetadata describing the first element found within the distribution
      Throws:
      IOException - if there was an error reading from the supplied stream or writing to the temporary file
      SdkElementNotFoundException - if the archive contains no recognisable element directories
    • inspectElementArtifact

      List<ElementPathRecordMetadata> inspectElementArtifact(String coordinates)
      Inspects an ELM distribution resolved from Maven artifact coordinates. The coordinates must be in standard Maven format (groupId:artifactId:version or groupId:artifactId:packaging:version). The artifact is resolved against the default repositories (Maven Central) and must be an ELM file.
      Parameters:
      coordinates - the Maven artifact coordinates identifying the ELM distribution; must not be null
      Returns:
      a ElementPathRecordMetadata describing the first element found within the distribution
      Throws:
      SdkArtifactNotFoundException - if the artifact cannot be resolved
      SdkElementNotFoundException - if the artifact contains no recognisable element directories
    • inspectElementLargeObject

      List<ElementPathRecordMetadata> inspectElementLargeObject(String largeObjectId)
      Inspects an ELM distribution previously stored in the large-object store. The largeObjectId must refer to an existing large object whose content is a valid ELM file.
      Parameters:
      largeObjectId - the id of the large object containing the ELM file; must not be null
      Returns:
      a ElementPathRecordMetadata describing the first element found within the distribution
      Throws:
      SdkElementNotFoundException - if the large object contains no recognisable element directories
      LargeObjectContentNotFoundException - if no content has been uploaded for the given large object id