Class Metadata

  • Direct Known Subclasses:
    Metadata.MatchAllMetadata

    public class Metadata
    extends java.lang.Object
    A Metadata is a collection of Artifacts with unified metadata (including MRL) that are stored in the same "metadata.json" file.

    All of the artifacts located within the metadata share the data defined at the metadata level such as name, description, and website. The key difference between the artifacts within the same metadata are the properties.

    See Also:
    Repository
    • Field Detail

      • groupId

        protected java.lang.String groupId
      • artifactId

        protected java.lang.String artifactId
      • licenses

        protected java.util.Map<java.lang.String,​License> licenses
      • artifacts

        protected java.util.List<Artifact> artifacts
    • Constructor Detail

      • Metadata

        public Metadata()
    • Method Detail

      • search

        public java.util.List<Artifact> search​(VersionRange versionRange,
                                               java.util.Map<java.lang.String,​java.lang.String> filter)
        Returns the artifacts matching the version and property requirements.
        Parameters:
        versionRange - the version range for the artifact
        filter - the property filter
        Returns:
        the matching artifacts
      • getMetadataVersion

        public java.lang.String getMetadataVersion()
        Returns the metadata format version.
        Returns:
        the metadata format version
      • setMetadataVersion

        public void setMetadataVersion​(java.lang.String metadataVersion)
        Sets the metadata format version.
        Parameters:
        metadataVersion - the new version
      • getResourceType

        public java.lang.String getResourceType()
        Returns the resource type.
        Returns:
        the resource type
      • setResourceType

        public void setResourceType​(java.lang.String resourceType)
        Returns the resource type.
        Parameters:
        resourceType - the resource type
      • getGroupId

        public java.lang.String getGroupId()
        Returns the groupId.
        Returns:
        the groupId
      • setGroupId

        public void setGroupId​(java.lang.String groupId)
        Sets the groupId.
        Parameters:
        groupId - the new groupId
      • getArtifactId

        public java.lang.String getArtifactId()
        Returns the artifactId.
        Returns:
        the artifactId
      • setArtifactId

        public void setArtifactId​(java.lang.String artifactId)
        Sets the artifactId.
        Parameters:
        artifactId - the new artifactId
      • getName

        public java.lang.String getName()
        Returns the metadata-level name.
        Returns:
        the metadata-level name
      • setName

        public void setName​(java.lang.String name)
        Sets the metadata-level name.
        Parameters:
        name - the new metadata-level name
      • getDescription

        public java.lang.String getDescription()
        Returns the description.
        Returns:
        the description
      • setDescription

        public void setDescription​(java.lang.String description)
        Sets the description.
        Parameters:
        description - the description
      • getWebsite

        public java.lang.String getWebsite()
        Returns the website.
        Returns:
        the website
      • setWebsite

        public void setWebsite​(java.lang.String website)
        Sets the website.
        Parameters:
        website - the website
      • getLicenses

        public java.util.Map<java.lang.String,​License> getLicenses()
        Returns the License.
        Returns:
        licenses in this metadata
      • setLicense

        public void setLicense​(java.util.Map<java.lang.String,​License> licenses)
        Sets the License.
        Parameters:
        licenses - License
      • addLicense

        public void addLicense​(License license)
        Adds one License.
        Parameters:
        license - License
      • getArtifacts

        public java.util.List<Artifact> getArtifacts()
        Returns all the artifacts in the metadata.
        Returns:
        the artifacts in the metadata
      • setArtifacts

        public void setArtifacts​(java.util.List<Artifact> artifacts)
        Sets the artifacts for the metadata.
        Parameters:
        artifacts - the new artifacts
      • addArtifact

        public void addArtifact​(Artifact artifact)
        Adds one artifact for the metadata.
        Parameters:
        artifact - the new artifact
      • getLastUpdated

        public java.util.Date getLastUpdated()
        Returns the last update date for the metadata.
        Returns:
        the last update date
      • setLastUpdated

        public void setLastUpdated​(java.util.Date lastUpdated)
        Sets the last update date for the metadata.
        Parameters:
        lastUpdated - the new last update date
      • getRepositoryUri

        public java.net.URI getRepositoryUri()
        Returns the URI to the repository storing the metadata.
        Returns:
        the URI to the repository storing the metadata
      • setRepositoryUri

        public void setRepositoryUri​(java.net.URI repositoryUri)
        Sets the repository URI.
        Parameters:
        repositoryUri - the new URI
      • init

        public final void init​(java.util.Map<java.lang.String,​java.lang.String> arguments)
        Restores artifacts state.

        This call is required after the metadata is restored back from JSON.

        Parameters:
        arguments - the override arguments