public class Metadata
extends java.lang.Object
Metadata
is a collection of Artifact
s 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.
Repository
Modifier and Type | Class and Description |
---|---|
static class |
Metadata.MatchAllMetadata
A
Metadata class that matches all any search criteria. |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
artifactId |
protected java.util.List<Artifact> |
artifacts |
protected java.lang.String |
groupId |
protected java.util.Map<java.lang.String,License> |
licenses |
Constructor and Description |
---|
Metadata() |
Modifier and Type | Method and Description |
---|---|
void |
addArtifact(Artifact artifact)
Adds one artifact for the metadata.
|
void |
addLicense(License license)
Adds one
License . |
Application |
getApplication()
Returns the
Application . |
java.lang.String |
getApplicationName()
Returns the
Application name. |
java.lang.String |
getArtifactId()
Returns the artifactId.
|
java.util.List<Artifact> |
getArtifacts()
Returns all the artifacts in the metadata.
|
java.lang.String |
getDescription()
Returns the description.
|
java.lang.String |
getGroupId()
Returns the groupId.
|
java.util.Date |
getLastUpdated()
Returns the last update date for the metadata.
|
java.util.Map<java.lang.String,License> |
getLicenses()
Returns the
License . |
java.lang.String |
getMetadataVersion()
Returns the metadata format version.
|
java.lang.String |
getName()
Returns the metadata-level name.
|
java.net.URI |
getRepositoryUri()
Returns the URI to the repository storing the metadata.
|
java.lang.String |
getResourceType()
Returns the resource type.
|
java.lang.String |
getWebsite()
Returns the website.
|
void |
init()
Restores artifacts state.
|
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.
|
void |
setApplication(Application application)
Sets the
Application . |
void |
setArtifactId(java.lang.String artifactId)
Sets the artifactId.
|
void |
setArtifacts(java.util.List<Artifact> artifacts)
Sets the artifacts for the metadata.
|
void |
setDescription(java.lang.String description)
Sets the description.
|
void |
setGroupId(java.lang.String groupId)
Sets the groupId.
|
void |
setLastUpdated(java.util.Date lastUpdated)
Sets the last update date for the metadata.
|
void |
setLicense(java.util.Map<java.lang.String,License> licenses)
Sets the
License . |
void |
setMetadataVersion(java.lang.String metadataVersion)
Sets the metadata format version.
|
void |
setName(java.lang.String name)
Sets the metadata-level name.
|
void |
setRepositoryUri(java.net.URI repositoryUri)
Sets the repository URI.
|
void |
setResourceType(java.lang.String resourceType)
Returns the resource type.
|
void |
setWebsite(java.lang.String website)
Sets the website.
|
protected java.lang.String groupId
protected java.lang.String artifactId
protected java.util.Map<java.lang.String,License> licenses
protected java.util.List<Artifact> artifacts
public java.util.List<Artifact> search(VersionRange versionRange, java.util.Map<java.lang.String,java.lang.String> filter)
versionRange
- the version range for the artifactfilter
- the property filterpublic java.lang.String getMetadataVersion()
public void setMetadataVersion(java.lang.String metadataVersion)
metadataVersion
- the new versionpublic java.lang.String getResourceType()
public void setResourceType(java.lang.String resourceType)
resourceType
- the resource typepublic java.lang.String getGroupId()
public void setGroupId(java.lang.String groupId)
groupId
- the new groupIdpublic java.lang.String getArtifactId()
public void setArtifactId(java.lang.String artifactId)
artifactId
- the new artifactIdpublic java.lang.String getName()
public void setName(java.lang.String name)
name
- the new metadata-level namepublic java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- the descriptionpublic java.lang.String getWebsite()
public void setWebsite(java.lang.String website)
website
- the websitepublic Application getApplication()
Application
.Application
public void setApplication(Application application)
Application
.application
- Application
public java.lang.String getApplicationName()
Application
name.Application
namepublic java.util.Map<java.lang.String,License> getLicenses()
License
.public void setLicense(java.util.Map<java.lang.String,License> licenses)
License
.licenses
- License
public java.util.List<Artifact> getArtifacts()
public void setArtifacts(java.util.List<Artifact> artifacts)
artifacts
- the new artifactspublic void addArtifact(Artifact artifact)
artifact
- the new artifactpublic java.util.Date getLastUpdated()
public void setLastUpdated(java.util.Date lastUpdated)
lastUpdated
- the new last update datepublic java.net.URI getRepositoryUri()
public void setRepositoryUri(java.net.URI repositoryUri)
repositoryUri
- the new URIpublic final void init()
This call is required after the metadata is restored back from JSON.