org.apache.archiva.metadata.repository
Interface MetadataRepository

All Known Implementing Classes:
FileMetadataRepository, JcrMetadataRepository

public interface MetadataRepository


Method Summary
 void addMetadataFacet(String repositoryId, MetadataFacet metadataFacet)
           
 boolean canObtainAccess(Class<?> aClass)
           
 void close()
           
 List<ArtifactMetadata> getArtifacts(String repositoryId)
           
 Collection<ArtifactMetadata> getArtifacts(String repoId, String namespace, String projectId, String projectVersion)
           
 List<ArtifactMetadata> getArtifactsByChecksum(String repositoryId, String checksum)
           
 List<ArtifactMetadata> getArtifactsByDateRange(String repositoryId, Date startTime, Date endTime)
          if startTime or endTime are null they are not used for search
 Collection<String> getArtifactVersions(String repoId, String namespace, String projectId, String projectVersion)
           
 MetadataFacet getMetadataFacet(String repositoryId, String facetId, String name)
           
 List<String> getMetadataFacets(String repositoryId, String facetId)
           
 Collection<String> getNamespaces(String repoId, String namespace)
           
 ProjectMetadata getProject(String repoId, String namespace, String projectId)
          basically just checking it exists not complete data returned
 Collection<ProjectVersionReference> getProjectReferences(String repoId, String namespace, String projectId, String projectVersion)
          Retrieve project references from the metadata repository.
 Collection<String> getProjects(String repoId, String namespace)
           
 ProjectVersionMetadata getProjectVersion(String repoId, String namespace, String projectId, String projectVersion)
           
 Collection<String> getProjectVersions(String repoId, String namespace, String projectId)
           
 Collection<String> getRepositories()
           
 Collection<String> getRootNamespaces(String repoId)
           
 boolean hasMetadataFacet(String repositoryId, String facetId)
           
<T> T
obtainAccess(Class<T> aClass)
           
 void removeArtifact(ArtifactMetadata artifactMetadata, String baseVersion)
          used for deleting timestamped version of SNAPSHOT artifacts
 void removeArtifact(String repositoryId, String namespace, String project, String version, MetadataFacet metadataFacet)
          Only remove MetadataFacet for the artifact
 void removeArtifact(String repositoryId, String namespace, String project, String version, String id)
           
 void removeMetadataFacet(String repositoryId, String facetId, String name)
           
 void removeMetadataFacets(String repositoryId, String facetId)
           
 void removeNamespace(String repositoryId, String namespace)
           
 void removeProject(String repositoryId, String namespace, String projectId)
          remove a project
 void removeProjectVersion(String repoId, String namespace, String projectId, String projectVersion)
           
 void removeRepository(String repositoryId)
          Delete a repository's metadata.
 void revert()
          implementations can throw RuntimeException
 void save()
          implementations can throw RuntimeException
 void updateArtifact(String repositoryId, String namespace, String projectId, String projectVersion, ArtifactMetadata artifactMeta)
           
 void updateNamespace(String repositoryId, String namespace)
          create the namespace in the repository.
 void updateProject(String repositoryId, ProjectMetadata project)
          Update metadata for a particular project in the metadata repository, or create it if it does not already exist.
 void updateProjectVersion(String repositoryId, String namespace, String projectId, ProjectVersionMetadata versionMetadata)
           
 

Method Detail

updateProject

void updateProject(String repositoryId,
                   ProjectMetadata project)
                   throws MetadataRepositoryException
Update metadata for a particular project in the metadata repository, or create it if it does not already exist.

Parameters:
repositoryId - the repository the project is in
project - the project metadata to create or update
Throws:
MetadataRepositoryException

updateArtifact

void updateArtifact(String repositoryId,
                    String namespace,
                    String projectId,
                    String projectVersion,
                    ArtifactMetadata artifactMeta)
                    throws MetadataRepositoryException
Throws:
MetadataRepositoryException

updateProjectVersion

void updateProjectVersion(String repositoryId,
                          String namespace,
                          String projectId,
                          ProjectVersionMetadata versionMetadata)
                          throws MetadataRepositoryException
Throws:
MetadataRepositoryException

updateNamespace

void updateNamespace(String repositoryId,
                     String namespace)
                     throws MetadataRepositoryException
create the namespace in the repository. (if not exist)

Parameters:
repositoryId -
namespace -
Throws:
MetadataRepositoryException

getMetadataFacets

List<String> getMetadataFacets(String repositoryId,
                               String facetId)
                               throws MetadataRepositoryException
Throws:
MetadataRepositoryException

hasMetadataFacet

boolean hasMetadataFacet(String repositoryId,
                         String facetId)
                         throws MetadataRepositoryException
Parameters:
repositoryId -
facetId -
Returns:
true if the repository datas for this facetId
Throws:
MetadataRepositoryException
Since:
1.4-M4

getMetadataFacet

MetadataFacet getMetadataFacet(String repositoryId,
                               String facetId,
                               String name)
                               throws MetadataRepositoryException
Throws:
MetadataRepositoryException

addMetadataFacet

void addMetadataFacet(String repositoryId,
                      MetadataFacet metadataFacet)
                      throws MetadataRepositoryException
Throws:
MetadataRepositoryException

removeMetadataFacets

void removeMetadataFacets(String repositoryId,
                          String facetId)
                          throws MetadataRepositoryException
Throws:
MetadataRepositoryException

removeMetadataFacet

void removeMetadataFacet(String repositoryId,
                         String facetId,
                         String name)
                         throws MetadataRepositoryException
Throws:
MetadataRepositoryException

getArtifactsByDateRange

List<ArtifactMetadata> getArtifactsByDateRange(String repositoryId,
                                               Date startTime,
                                               Date endTime)
                                               throws MetadataRepositoryException
if startTime or endTime are null they are not used for search

Parameters:
repositoryId -
startTime - can be null
endTime - can be null
Returns:
Throws:
MetadataRepositoryException

getRepositories

Collection<String> getRepositories()
                                   throws MetadataRepositoryException
Throws:
MetadataRepositoryException

getArtifactsByChecksum

List<ArtifactMetadata> getArtifactsByChecksum(String repositoryId,
                                              String checksum)
                                              throws MetadataRepositoryException
Throws:
MetadataRepositoryException

removeArtifact

void removeArtifact(String repositoryId,
                    String namespace,
                    String project,
                    String version,
                    String id)
                    throws MetadataRepositoryException
Throws:
MetadataRepositoryException

removeArtifact

void removeArtifact(ArtifactMetadata artifactMetadata,
                    String baseVersion)
                    throws MetadataRepositoryException
used for deleting timestamped version of SNAPSHOT artifacts

Parameters:
artifactMetadata - the artifactMetadata with the timestamped version (2.0-20120618.214135-2)
baseVersion - the base version of the snapshot (2.0-SNAPSHOT)
Throws:
MetadataRepositoryException
Since:
1.4-M3

removeArtifact

void removeArtifact(String repositoryId,
                    String namespace,
                    String project,
                    String version,
                    MetadataFacet metadataFacet)
                    throws MetadataRepositoryException
Only remove MetadataFacet for the artifact

Parameters:
repositoryId -
namespace -
project -
version -
metadataFacet -
Throws:
MetadataRepositoryException
Since:
1.4-M3

removeRepository

void removeRepository(String repositoryId)
                      throws MetadataRepositoryException
Delete a repository's metadata. This includes all associated metadata facets.

Parameters:
repositoryId - the repository to delete
Throws:
MetadataRepositoryException

removeNamespace

void removeNamespace(String repositoryId,
                     String namespace)
                     throws MetadataRepositoryException
Parameters:
repositoryId -
namespace - (groupId for maven )
Throws:
MetadataRepositoryException
Since:
1.4-M3

getArtifacts

List<ArtifactMetadata> getArtifacts(String repositoryId)
                                    throws MetadataRepositoryException
Throws:
MetadataRepositoryException

getProject

ProjectMetadata getProject(String repoId,
                           String namespace,
                           String projectId)
                           throws MetadataResolutionException
basically just checking it exists not complete data returned

Parameters:
repoId -
namespace -
projectId -
Returns:
Throws:
MetadataResolutionException

getProjectVersion

ProjectVersionMetadata getProjectVersion(String repoId,
                                         String namespace,
                                         String projectId,
                                         String projectVersion)
                                         throws MetadataResolutionException
Throws:
MetadataResolutionException

getArtifactVersions

Collection<String> getArtifactVersions(String repoId,
                                       String namespace,
                                       String projectId,
                                       String projectVersion)
                                       throws MetadataResolutionException
Throws:
MetadataResolutionException

getProjectReferences

Collection<ProjectVersionReference> getProjectReferences(String repoId,
                                                         String namespace,
                                                         String projectId,
                                                         String projectVersion)
                                                         throws MetadataResolutionException
Retrieve project references from the metadata repository. Note that this is not built into the content model for a project version as a reference may be present (due to reverse-lookup of dependencies) before the actual project is, and we want to avoid adding a stub model to the content repository.

Parameters:
repoId - the repository ID to look within
namespace - the namespace of the project to get references to
projectId - the identifier of the project to get references to
projectVersion - the version of the project to get references to
Returns:
a list of project references
Throws:
MetadataResolutionException

getRootNamespaces

Collection<String> getRootNamespaces(String repoId)
                                     throws MetadataResolutionException
Throws:
MetadataResolutionException

getNamespaces

Collection<String> getNamespaces(String repoId,
                                 String namespace)
                                 throws MetadataResolutionException
Throws:
MetadataResolutionException

getProjects

Collection<String> getProjects(String repoId,
                               String namespace)
                               throws MetadataResolutionException
Throws:
MetadataResolutionException

getProjectVersions

Collection<String> getProjectVersions(String repoId,
                                      String namespace,
                                      String projectId)
                                      throws MetadataResolutionException
Throws:
MetadataResolutionException

removeProjectVersion

void removeProjectVersion(String repoId,
                          String namespace,
                          String projectId,
                          String projectVersion)
                          throws MetadataRepositoryException
Parameters:
repoId -
namespace -
projectId -
projectVersion -
Throws:
MetadataResolutionException
MetadataRepositoryException
Since:
1.4-M4

getArtifacts

Collection<ArtifactMetadata> getArtifacts(String repoId,
                                          String namespace,
                                          String projectId,
                                          String projectVersion)
                                          throws MetadataResolutionException
Throws:
MetadataResolutionException

removeProject

void removeProject(String repositoryId,
                   String namespace,
                   String projectId)
                   throws MetadataRepositoryException
remove a project

Parameters:
repositoryId -
namespace -
projectId -
Throws:
MetadataRepositoryException
Since:
1.4-M4

save

void save()
implementations can throw RuntimeException


close

void close()
           throws MetadataRepositoryException
Throws:
MetadataRepositoryException

revert

void revert()
implementations can throw RuntimeException


canObtainAccess

boolean canObtainAccess(Class<?> aClass)

obtainAccess

<T> T obtainAccess(Class<T> aClass)
               throws MetadataRepositoryException
Throws:
MetadataRepositoryException


Copyright © 2006-2013 The Apache Software Foundation. All Rights Reserved.