@ParametersAreNonnullByDefault public class CassandraMetadataRepository extends AbstractMetadataRepository implements MetadataRepository
metadataService
Constructor and Description |
---|
CassandraMetadataRepository(MetadataService metadataService,
ArchivaConfiguration configuration,
CassandraArchivaManager cassandraArchivaManager) |
Modifier and Type | Method and Description |
---|---|
void |
addMetadataFacet(RepositorySession session,
String repositoryId,
MetadataFacet metadataFacet)
Adds a facet to the repository level.
|
void |
close()
Closes the repository.
|
Stream<ArtifactMetadata> |
getArtifactByDateRangeStream(RepositorySession session,
String repositoryId,
ZonedDateTime startTime,
ZonedDateTime endTime,
QueryParameter queryParameter)
For documentation see
MetadataRepository.getArtifactByDateRangeStream(RepositorySession, String, ZonedDateTime, ZonedDateTime, QueryParameter)
This implementation orders the stream. |
List<ArtifactMetadata> |
getArtifacts(RepositorySession session,
String repositoryId)
Returns the metadata for all artifacts of the given repository.
|
List<ArtifactMetadata> |
getArtifacts(RepositorySession session,
String repoId,
String namespace,
String projectId,
String projectVersion)
Returns the metadata of all artifacts stored for the given project version.
|
List<ArtifactMetadata> |
getArtifactsByAttribute(RepositorySession session,
String key,
String value,
String repositoryId)
Get artifacts with an artifact metadata key that matches the passed value.
|
List<ArtifactMetadata> |
getArtifactsByChecksum(RepositorySession session,
String repositoryId,
String checksum)
Returns the artifacts that match the given checksum.
|
List<ArtifactMetadata> |
getArtifactsByDateRange(RepositorySession session,
String repositoryId,
ZonedDateTime startTime,
ZonedDateTime endTime,
QueryParameter queryParameter)
Searches for artifacts where the 'whenGathered' attribute value is between the given start and end time.
|
List<ArtifactMetadata> |
getArtifactsByProjectVersionAttribute(RepositorySession session,
String key,
String value,
String repositoryId)
Get artifacts with a attribute on project version level that matches the passed value.
|
List<ArtifactMetadata> |
getArtifactsByProjectVersionFacet(RepositorySession session,
String key,
String value,
String repositoryId)
Project version and artifact level metadata are stored in the same place, no distinctions in Cassandra
implementation, just calls
MetadataRepository.getArtifactsByAttribute(RepositorySession, String, String, String) |
Stream<ArtifactMetadata> |
getArtifactStream(RepositorySession session,
String repositoryId,
QueryParameter queryParameter)
Returns a stream of artifacts that are stored in the given repository.
|
Stream<ArtifactMetadata> |
getArtifactStream(RepositorySession session,
String repoId,
String namespace,
String projectId,
String projectVersion,
QueryParameter queryParameter)
Returns a stream of artifacts found for the given artifact coordinates and using the
queryParameter |
List<String> |
getArtifactVersions(RepositorySession session,
String repoId,
String namespace,
String projectId,
String projectVersion)
Returns all artifact version strings for a given project version.
|
protected Map<String,String> |
getChecksums(String artifactMetadataKey) |
List<String> |
getChildNamespaces(RepositorySession session,
String repoId,
String namespaceId)
Returns the list of namespace names that are children of the given namespace.
|
protected List<Dependency> |
getDependencies(String projectVersionMetadataKey) |
protected List<License> |
getLicenses(String projectVersionMetadataKey) |
protected List<MailingList> |
getMailingLists(String projectVersionMetadataKey) |
<T extends MetadataFacet> |
getMetadataFacet(RepositorySession session,
String repositoryId,
Class<T> facetClazz,
String name)
Returns the facet instance for the given class, which is stored on repository level for the given name.
|
MetadataFacet |
getMetadataFacet(RepositorySession session,
String repositoryId,
String facetId,
String name)
Returns the facet data stored on the repository level.
|
List<String> |
getMetadataFacets(RepositorySession session,
String repositoryId,
String facetId)
Return the facet names stored for the given facet id on the repository level.
|
<T extends MetadataFacet> |
getMetadataFacetStream(RepositorySession session,
String repositoryId,
Class<T> facetClazz,
QueryParameter queryParameter)
Implementation is not very performant, because sorting is part of the stream.
|
protected org.modelmapper.ModelMapper |
getModelMapper() |
protected Namespace |
getNamespace(String repositoryId,
String namespaceId) |
protected List<String> |
getNamespaces(String repoId) |
Repository |
getOrCreateRepository(String repositoryId)
if the repository doesn't exist it will be created
|
ProjectMetadata |
getProject(RepositorySession session,
String repoId,
String namespace,
String id)
Returns the metadata for the given project.
|
List<ProjectVersionReference> |
getProjectReferences(RepositorySession session,
String repoId,
String namespace,
String projectId,
String projectVersion)
Retrieve project references from the metadata repository.
|
List<String> |
getProjects(RepositorySession session,
String repoId,
String namespace)
Return the project names that of all projects stored under the given namespace.
|
ProjectVersionMetadata |
getProjectVersion(RepositorySession session,
String repoId,
String namespace,
String projectId,
String projectVersion)
Returns the metadata for the project version.
|
List<String> |
getProjectVersions(RepositorySession session,
String repoId,
String namespace,
String projectId)
Returns the names of all versions stored under the given project.
|
protected Repository |
getRepository(String repositoryId) |
List<String> |
getRootNamespaces(RepositorySession session,
String repoId)
Returns the names of the root namespaces stored for this repository.
|
boolean |
hasMetadataFacet(RepositorySession session,
String repositoryId,
String facetId)
Returns true, if there is facet data stored for the given facet id on the repository on repository level.
|
protected ArtifactMetadata |
mapArtifactMetadataLongColumnSlice(String key,
me.prettyprint.hector.api.beans.ColumnSlice<String,Long> columnSlice) |
protected ArtifactMetadata |
mapArtifactMetadataStringColumnSlice(String key,
me.prettyprint.hector.api.beans.ColumnSlice<String,String> columnSlice) |
protected ProjectVersionMetadataModel |
mapProjectVersionMetadataModel(me.prettyprint.hector.api.beans.ColumnSlice<String,String> columnSlice) |
protected void |
recordChecksums(String repositoryId,
String artifactMetadataKey,
Map<String,String> checksums) |
protected void |
recordDependencies(String projectVersionMetadataKey,
List<Dependency> dependencies,
String repositoryId) |
protected void |
recordLicenses(String projectVersionMetadataKey,
List<License> licenses) |
protected void |
recordMailingList(String projectVersionMetadataKey,
List<MailingList> mailingLists) |
void |
removeArtifact(RepositorySession session,
String repositoryId,
String namespace,
String project,
String version,
String id)
Removes the data for the artifact with the given coordinates from the metadata repository.
|
protected void |
removeChecksums(String artifactMetadataKey) |
protected void |
removeDependencies(String projectVersionMetadataKey) |
void |
removeFacetFromArtifact(RepositorySession session,
String repositoryId,
String namespace,
String project,
String version,
MetadataFacet metadataFacet)
FIXME need a unit test!!!
|
protected void |
removeLicenses(String projectVersionMetadataKey) |
protected void |
removeMailingList(String projectVersionMetadataKey) |
void |
removeMetadataFacet(RepositorySession session,
String repositoryId,
String facetId,
String name)
Removes the given facet from the repository level, if it exists.
|
void |
removeMetadataFacets(RepositorySession session,
String repositoryId,
String facetId)
Removes all facets with the given facetId from the repository level.
|
void |
removeNamespace(RepositorySession session,
String repositoryId,
String namespaceId)
Removes the given namespace and its contents from the metadata repository.
|
void |
removeProject(RepositorySession session,
String repositoryId,
String namespaceId,
String projectId)
Removes the project metadata and metadata for all stored versions, artifacts and facets of this project.
|
void |
removeProjectVersion(RepositorySession session,
String repoId,
String namespace,
String projectId,
String projectVersion)
Removes a project version and all its artifact and facet metadata under it.
|
void |
removeRepository(RepositorySession session,
String repositoryId)
Deletes all metadata of the given repository.
|
void |
removeTimestampedArtifact(RepositorySession session,
ArtifactMetadata artifactMetadata,
String baseVersion)
Remove timestamped version of artifact.
|
List<ArtifactMetadata> |
searchArtifacts(RepositorySession session,
String repositoryId,
String text,
boolean exact)
This implementation just calls getArtifactsByAttribute( null, text, repositoryId ).
|
List<ArtifactMetadata> |
searchArtifacts(RepositorySession session,
String repositoryId,
String key,
String text,
boolean exact)
The exact parameter is ignored as we can't do non exact searches in Cassandra
|
void |
updateArtifact(RepositorySession session,
String repositoryId,
String namespaceId,
String projectId,
String projectVersion,
ArtifactMetadata artifactMeta)
Update the metadata of a given artifact.
|
void |
updateNamespace(RepositorySession session,
String repositoryId,
String namespaceId)
Create the namespace in the repository, if it does not exist.
|
void |
updateProject(RepositorySession session,
String repositoryId,
ProjectMetadata projectMetadata)
Update metadata for a particular project in the metadata repository, or create it, if it does not already exist.
|
void |
updateProjectVersion(RepositorySession session,
String repositoryId,
String namespaceId,
String projectId,
ProjectVersionMetadata versionMetadata)
Updates the metadata for a specific version of a given project.
|
getArtifactByDateRangeStream, getArtifactMetadataComparator, getArtifactsByDateRange, getArtifactStream, getArtifactStream, getFacetFactory, getFacetFactory, getFactoryClassForId, getMetadataFacetStream, getSupportedFacets
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getArtifactByDateRangeStream, getArtifactsByDateRange, getArtifactStream, getArtifactStream, getMetadataFacetStream
public CassandraMetadataRepository(MetadataService metadataService, ArchivaConfiguration configuration, CassandraArchivaManager cassandraArchivaManager)
public Repository getOrCreateRepository(String repositoryId) throws MetadataRepositoryException
repositoryId
- MetadataRepositoryException
protected Repository getRepository(String repositoryId) throws MetadataRepositoryException
MetadataRepositoryException
public void updateNamespace(RepositorySession session, String repositoryId, String namespaceId) throws MetadataRepositoryException
MetadataRepository
updateNamespace
in interface MetadataRepository
updateNamespace
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The repository idnamespaceId
- The namespace ('.' separated)MetadataRepositoryException
- if something goes wrong during updateprotected Namespace getNamespace(String repositoryId, String namespaceId)
public void removeNamespace(RepositorySession session, String repositoryId, String namespaceId) throws MetadataRepositoryException
MetadataRepository
removeNamespace
in interface MetadataRepository
removeNamespace
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The repository idnamespaceId
- The namespace '.' separated ( it's the groupId for maven )MetadataRepositoryException
- if the removal failedpublic void removeRepository(RepositorySession session, String repositoryId) throws MetadataRepositoryException
MetadataRepository
removeRepository
in interface MetadataRepository
removeRepository
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- the repository to deleteMetadataRepositoryException
- if the removal failedpublic List<String> getRootNamespaces(RepositorySession session, String repoId) throws MetadataResolutionException
MetadataRepository
getRootNamespaces
in interface MetadataRepository
getRootNamespaces
in class AbstractMetadataRepository
session
- The repository session.repoId
- The repository id.MetadataResolutionException
- If the retrieval failed.public List<String> getChildNamespaces(RepositorySession session, String repoId, String namespaceId) throws MetadataResolutionException
MetadataRepository
getChildNamespaces
in interface MetadataRepository
getChildNamespaces
in class AbstractMetadataRepository
session
- The repository session.repoId
- The repository id.namespaceId
- The parent namespace '.'-separated.List
of child namespace names, or a empty list, if there are no children for the given parent namespace.MetadataResolutionException
- if the retrieval failed.protected List<String> getNamespaces(String repoId) throws MetadataResolutionException
MetadataResolutionException
public void updateProject(RepositorySession session, String repositoryId, ProjectMetadata projectMetadata) throws MetadataRepositoryException
MetadataRepository
updateProject
in interface MetadataRepository
updateProject
in class AbstractMetadataRepository
session
- The session used for updating.repositoryId
- the repository the project is inprojectMetadata
- the project metadata to create or updateMetadataRepositoryException
- if the update failspublic List<String> getProjects(RepositorySession session, String repoId, String namespace) throws MetadataResolutionException
MetadataRepository
getProjects
in interface MetadataRepository
getProjects
in class AbstractMetadataRepository
session
- The repository session.repoId
- The repository id.namespace
- The namespace '.'-separated.MetadataResolutionException
- if the retrieval failed.public void removeProject(RepositorySession session, String repositoryId, String namespaceId, String projectId) throws MetadataRepositoryException
MetadataRepository
removeProject
in interface MetadataRepository
removeProject
in class AbstractMetadataRepository
session
- The repository session.repositoryId
- The repository id.namespaceId
- The namespace '.'-separated.projectId
- The project name.MetadataRepositoryException
- if the removal failed.public List<String> getProjectVersions(RepositorySession session, String repoId, String namespace, String projectId) throws MetadataResolutionException
MetadataRepository
getProjectVersions
in interface MetadataRepository
getProjectVersions
in class AbstractMetadataRepository
session
- The repository session.repoId
- The repository id.namespace
- The namespace '.'-separated.projectId
- The project name.MetadataResolutionException
- if the retrieval failed.public ProjectMetadata getProject(RepositorySession session, String repoId, String namespace, String id) throws MetadataResolutionException
MetadataRepository
ProjectMetadata
object with the data provided by parameters.getProject
in interface MetadataRepository
getProject
in class AbstractMetadataRepository
session
- The session idrepoId
- The repository idnamespace
- The namespace '.'-separated.id
- The project namenull
if not found.MetadataResolutionException
- if the metadata retrieval failedprotected ProjectVersionMetadataModel mapProjectVersionMetadataModel(me.prettyprint.hector.api.beans.ColumnSlice<String,String> columnSlice)
public void updateProjectVersion(RepositorySession session, String repositoryId, String namespaceId, String projectId, ProjectVersionMetadata versionMetadata) throws MetadataRepositoryException
MetadataRepository
updateProjectVersion
in interface MetadataRepository
updateProjectVersion
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The repository idnamespaceId
- The namespace ('.' separated)projectId
- The project idversionMetadata
- The metadata for the versionMetadataRepositoryException
- if something goes wrong during updatepublic ProjectVersionMetadata getProjectVersion(RepositorySession session, String repoId, String namespace, String projectId, String projectVersion) throws MetadataResolutionException
MetadataRepository
getProjectVersion
in interface MetadataRepository
getProjectVersion
in class AbstractMetadataRepository
session
- The repository session.repoId
- The repository id.namespace
- The namespace '.'-separatedprojectId
- The project nameprojectVersion
- The project versionnull
, if not found.MetadataResolutionException
- if the retrieval of the metadata failed.protected void recordChecksums(String repositoryId, String artifactMetadataKey, Map<String,String> checksums)
protected void removeChecksums(String artifactMetadataKey)
protected Map<String,String> getChecksums(String artifactMetadataKey)
protected void recordMailingList(String projectVersionMetadataKey, List<MailingList> mailingLists)
protected void removeMailingList(String projectVersionMetadataKey)
protected List<MailingList> getMailingLists(String projectVersionMetadataKey)
protected void recordLicenses(String projectVersionMetadataKey, List<License> licenses)
protected void removeLicenses(String projectVersionMetadataKey)
protected List<License> getLicenses(String projectVersionMetadataKey)
protected void recordDependencies(String projectVersionMetadataKey, List<Dependency> dependencies, String repositoryId)
protected void removeDependencies(String projectVersionMetadataKey)
protected List<Dependency> getDependencies(String projectVersionMetadataKey)
public void updateArtifact(RepositorySession session, String repositoryId, String namespaceId, String projectId, String projectVersion, ArtifactMetadata artifactMeta) throws MetadataRepositoryException
MetadataRepository
updateArtifact
in interface MetadataRepository
updateArtifact
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The repository idnamespaceId
- The namespace ('.' separated)projectId
- The project idprojectVersion
- The project versionartifactMeta
- Information about the artifact itself.MetadataRepositoryException
- if something goes wrong during update.public List<String> getArtifactVersions(RepositorySession session, String repoId, String namespace, String projectId, String projectVersion) throws MetadataResolutionException
MetadataRepository
getArtifactVersions
in interface MetadataRepository
getArtifactVersions
in class AbstractMetadataRepository
session
- The repository session.repoId
- The repository id.namespace
- The namespace '.'-separatedprojectId
- The project name.projectVersion
- The project version.MetadataResolutionException
- if the retrieval of the metadata failed.public List<String> getMetadataFacets(RepositorySession session, String repositoryId, String facetId) throws MetadataRepositoryException
MetadataRepository
getMetadataFacets
in interface MetadataRepository
getMetadataFacets
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The repository idfacetId
- The facet idMetadataRepositoryException
- if something goes wrongpublic <T extends MetadataFacet> Stream<T> getMetadataFacetStream(RepositorySession session, String repositoryId, Class<T> facetClazz, QueryParameter queryParameter) throws MetadataRepositoryException
getMetadataFacetStream
in interface MetadataRepository
getMetadataFacetStream
in class AbstractMetadataRepository
T
- session
- repositoryId
- facetClazz
- queryParameter
- MetadataRepositoryException
public boolean hasMetadataFacet(RepositorySession session, String repositoryId, String facetId) throws MetadataRepositoryException
MetadataRepository
hasMetadataFacet
in interface MetadataRepository
hasMetadataFacet
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The repository idfacetId
- The facet idMetadataRepositoryException
- if something goes wrongpublic <T extends MetadataFacet> T getMetadataFacet(RepositorySession session, String repositoryId, Class<T> facetClazz, String name) throws MetadataRepositoryException
MetadataRepository
null
will be returned.
If the facet is not found the method returns null
.getMetadataFacet
in interface MetadataRepository
getMetadataFacet
in class AbstractMetadataRepository
T
- The type of the facet objectsession
- The repository sessionrepositoryId
- The id of the repositoryfacetClazz
- The facet object classname
- The name of the facet (name or path)MetadataRepositoryException
- if the data cannot be retrieved from the backendpublic MetadataFacet getMetadataFacet(RepositorySession session, String repositoryId, String facetId, String name) throws MetadataRepositoryException
MetadataRepository
MetadataFacetFactory
.getMetadataFacet
in interface MetadataRepository
getMetadataFacet
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The repository idfacetId
- The facet idname
- The attribute nameMetadataRepositoryException
- if something goes wrong.public void addMetadataFacet(RepositorySession session, String repositoryId, MetadataFacet metadataFacet) throws MetadataRepositoryException
MetadataRepository
addMetadataFacet
in interface MetadataRepository
addMetadataFacet
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The id of the repositorymetadataFacet
- The facet to addMetadataRepositoryException
- if the facet cannot be stored.public void removeMetadataFacets(RepositorySession session, String repositoryId, String facetId) throws MetadataRepositoryException
MetadataRepository
removeMetadataFacets
in interface MetadataRepository
removeMetadataFacets
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The id of the repositoryfacetId
- The facet idMetadataRepositoryException
- if the removal failspublic void removeMetadataFacet(RepositorySession session, String repositoryId, String facetId, String name) throws MetadataRepositoryException
MetadataRepository
removeMetadataFacet
in interface MetadataRepository
removeMetadataFacet
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The id of the repositoryfacetId
- The facet idname
- The facet name or pathMetadataRepositoryException
public List<ArtifactMetadata> getArtifactsByDateRange(RepositorySession session, String repositoryId, ZonedDateTime startTime, ZonedDateTime endTime, QueryParameter queryParameter) throws MetadataRepositoryException
MetadataRepository
null
, the time range for the search is unbounded for this parameter.getArtifactsByDateRange
in interface MetadataRepository
getArtifactsByDateRange
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The repository idstartTime
- The start time/date as zoned date, can be null
endTime
- The end time/date as zoned date, can be null
queryParameter
- Additional parameters for the query that affect ordering and returned resultsMetadataRepositoryException
- if the query fails.public Stream<ArtifactMetadata> getArtifactByDateRangeStream(RepositorySession session, String repositoryId, ZonedDateTime startTime, ZonedDateTime endTime, QueryParameter queryParameter) throws MetadataRepositoryException
MetadataRepository.getArtifactByDateRangeStream(RepositorySession, String, ZonedDateTime, ZonedDateTime, QueryParameter)
This implementation orders the stream. It does not order the query in the backend.getArtifactByDateRangeStream
in interface MetadataRepository
getArtifactByDateRangeStream
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The repository idstartTime
- The start time, can be null
endTime
- The end time, can be null
queryParameter
- Additional parameters for the query that affect ordering and number of returned results.MetadataRepositoryException
MetadataRepository.getArtifactByDateRangeStream(org.apache.archiva.metadata.repository.RepositorySession, java.lang.String, java.time.ZonedDateTime, java.time.ZonedDateTime)
protected ArtifactMetadata mapArtifactMetadataLongColumnSlice(String key, me.prettyprint.hector.api.beans.ColumnSlice<String,Long> columnSlice)
protected ArtifactMetadata mapArtifactMetadataStringColumnSlice(String key, me.prettyprint.hector.api.beans.ColumnSlice<String,String> columnSlice)
public List<ArtifactMetadata> getArtifactsByChecksum(RepositorySession session, String repositoryId, String checksum) throws MetadataRepositoryException
MetadataRepository
getArtifactsByChecksum
in interface MetadataRepository
getArtifactsByChecksum
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The repository idchecksum
- The checksum as string of numbersMetadataRepositoryException
- if the artifact retrieval failspublic List<ArtifactMetadata> getArtifactsByProjectVersionFacet(RepositorySession session, String key, String value, String repositoryId) throws MetadataRepositoryException
MetadataRepository.getArtifactsByAttribute(RepositorySession, String, String, String)
getArtifactsByProjectVersionFacet
in interface MetadataRepository
getArtifactsByProjectVersionFacet
in class AbstractMetadataRepository
session
- The repository sessionkey
- The attribute key to searchvalue
- The attribute value used for searchrepositoryId
- can be null
, meaning search in all repositoriesMetadataRepositoryException
- if the artifact retrieval fails.public List<ArtifactMetadata> getArtifactsByAttribute(RepositorySession session, String key, String value, String repositoryId) throws MetadataRepositoryException
MetadataRepository
key
ist the string representation of one of the metadata attributes. Only artifacts are returned where
the attribute value matches exactly the given search value.getArtifactsByAttribute
in interface MetadataRepository
getArtifactsByAttribute
in class AbstractMetadataRepository
session
- The repository session.key
- The string representation of the artifact metadata attribute.value
- The search value.repositoryId
- can be null
, meaning search in all repositoriesMetadataRepositoryException
- if the artifact retrieval fails.public List<ArtifactMetadata> getArtifactsByProjectVersionAttribute(RepositorySession session, String key, String value, String repositoryId) throws MetadataRepositoryException
MetadataRepository
getArtifactsByProjectVersionAttribute
in interface MetadataRepository
getArtifactsByProjectVersionAttribute
in class AbstractMetadataRepository
session
- the repository session.key
- The name of the attribute (may be nested like scm.url, mailinglist.0.name)value
- The value to search forrepositoryId
- can be null
, which means to search in all repositoriesMetadataRepositoryException
- if the artifact retrieval failspublic void removeArtifact(RepositorySession session, String repositoryId, String namespace, String project, String version, String id) throws MetadataRepositoryException
MetadataRepository
removeArtifact
in interface MetadataRepository
removeArtifact
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The repository idnamespace
- The namespace of the projectproject
- The project nameversion
- The project versionid
- The artifact idMetadataRepositoryException
- if the artifact retrieval fails, or if the artifact cannot be found.public void removeTimestampedArtifact(RepositorySession session, ArtifactMetadata artifactMetadata, String baseVersion) throws MetadataRepositoryException
MetadataRepository
removeTimestampedArtifact
in interface MetadataRepository
removeTimestampedArtifact
in class AbstractMetadataRepository
session
- The repository sessionartifactMetadata
- the artifactMetadata with the timestamped version (2.0-20120618.214135-2)baseVersion
- the base version of the snapshot (2.0-SNAPSHOT)MetadataRepositoryException
- if the removal fails.public void removeFacetFromArtifact(RepositorySession session, String repositoryId, String namespace, String project, String version, MetadataFacet metadataFacet) throws MetadataRepositoryException
MetadataRepository
MetadataFacet
of the given artifact.removeFacetFromArtifact
in interface MetadataRepository
removeFacetFromArtifact
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The repository id.namespace
- The namespaceproject
- The project nameversion
- The project versionmetadataFacet
- The facet dataMetadataRepositoryException
- if the removal failedpublic List<ArtifactMetadata> getArtifacts(RepositorySession session, String repositoryId) throws MetadataRepositoryException
MetadataRepository
getArtifacts
in interface MetadataRepository
getArtifacts
in class AbstractMetadataRepository
session
- The repository sessionrepositoryId
- The repository idMetadataRepositoryException
- if the retrieval failed.public List<ProjectVersionReference> getProjectReferences(RepositorySession session, String repoId, String namespace, String projectId, String projectVersion) throws MetadataResolutionException
MetadataRepository
getProjectReferences
in interface MetadataRepository
getProjectReferences
in class AbstractMetadataRepository
session
- The repository session.repoId
- The repository ID to look withinnamespace
- The namespace of the project to get references toprojectId
- The identifier of the project to get references toprojectVersion
- The version of the project to get references toMetadataResolutionException
- if the version could not be found.public void removeProjectVersion(RepositorySession session, String repoId, String namespace, String projectId, String projectVersion) throws MetadataRepositoryException
MetadataRepository
removeProjectVersion
in interface MetadataRepository
removeProjectVersion
in class AbstractMetadataRepository
session
- The repository session.repoId
- The repository id.namespace
- The namespace '.'-separated.projectId
- The project nameprojectVersion
- The project version.MetadataRepositoryException
- if the removal failed.public List<ArtifactMetadata> getArtifacts(RepositorySession session, String repoId, String namespace, String projectId, String projectVersion) throws MetadataResolutionException
MetadataRepository
getArtifacts
in interface MetadataRepository
getArtifacts
in class AbstractMetadataRepository
session
- The repository session.repoId
- The repository id.namespace
- The namespace '.'-separated.projectId
- The project name.projectVersion
- The project version.MetadataResolutionException
- if the retrieval failed.public void close() throws MetadataRepositoryException
MetadataRepository
close
in interface MetadataRepository
close
in class AbstractMetadataRepository
MetadataRepositoryException
- if the something went wrong or if the repository was closed already.protected org.modelmapper.ModelMapper getModelMapper()
public List<ArtifactMetadata> searchArtifacts(RepositorySession session, String repositoryId, String text, boolean exact) throws MetadataRepositoryException
searchArtifacts
in interface MetadataRepository
searchArtifacts
in class AbstractMetadataRepository
session
- The repository session.repositoryId
- can be null
to search in all repositoriestext
- The search textexact
- if true, the value must exactly match the text.MetadataRepositoryException
- if the retrieval failed.public List<ArtifactMetadata> searchArtifacts(RepositorySession session, String repositoryId, String key, String text, boolean exact) throws MetadataRepositoryException
searchArtifacts
in interface MetadataRepository
searchArtifacts
in class AbstractMetadataRepository
session
- The repository session.repositoryId
- can be null
to search in all repositorieskey
- search only inside this attribute.text
- The search string.exact
- if true, the value must exactly match the text.MetadataRepositoryException
- if the retrieval failed.public Stream<ArtifactMetadata> getArtifactStream(RepositorySession session, String repositoryId, QueryParameter queryParameter) throws MetadataResolutionException
MetadataRepository
queryParameter
.
The efficiency of ordering of elements is dependent on the implementation.
There may be some implementations that have to put a hard limit on the elements returned.
If there are no sortFields
defined in the query parameter, the order of elements in the stream is undefined and depends
on the implementation.getArtifactStream
in interface MetadataRepository
getArtifactStream
in class AbstractMetadataRepository
session
- The repository session.repositoryId
- The repository id.MetadataResolutionException
public Stream<ArtifactMetadata> getArtifactStream(RepositorySession session, String repoId, String namespace, String projectId, String projectVersion, QueryParameter queryParameter) throws MetadataResolutionException
MetadataRepository
queryParameter
getArtifactStream
in interface MetadataRepository
getArtifactStream
in class AbstractMetadataRepository
session
- The repository session. May not be null
.repoId
- The repository id. May not be null
.namespace
- The namespace. May not be null
.projectId
- The project id. May not be null
.projectVersion
- The project version. May not be null
.queryParameter
.MetadataResolutionException
- if there are no elements for the given artifact coordinates.Copyright © 2006–2019 The Apache Software Foundation. All rights reserved.