|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.archiva.metadata.repository.file.FileMetadataRepository
public class FileMetadataRepository
Nested Class Summary | |
---|---|
private static class |
FileMetadataRepository.ArtifactComparator
|
Field Summary | |
---|---|
private ArchivaConfiguration |
configuration
|
private org.slf4j.Logger |
log
|
private static String |
METADATA_KEY
|
private Map<String,MetadataFacetFactory> |
metadataFacetFactories
|
private static String |
NAMESPACE_METADATA_KEY
|
private static String |
PROJECT_METADATA_KEY
|
private static String |
PROJECT_VERSION_METADATA_KEY
|
Constructor Summary | |
---|---|
FileMetadataRepository(Map<String,MetadataFacetFactory> metadataFacetFactories,
ArchivaConfiguration configuration)
|
Method Summary | ||
---|---|---|
void |
addMetadataFacet(String repositoryId,
MetadataFacet metadataFacet)
|
|
boolean |
canObtainAccess(Class<?> aClass)
|
|
private static void |
clearMetadataFacetProperties(Collection<MetadataFacet> facetList,
Properties properties,
String prefix)
|
|
void |
close()
|
|
private void |
getArtifacts(List<ArtifactMetadata> artifacts,
String repoId,
String ns)
|
|
List<ArtifactMetadata> |
getArtifacts(String repoId)
|
|
Collection<ArtifactMetadata> |
getArtifacts(String repoId,
String namespace,
String projectId,
String projectVersion)
|
|
private void |
getArtifactsByChecksum(List<ArtifactMetadata> artifacts,
String repositoryId,
String ns,
String checksum)
|
|
List<ArtifactMetadata> |
getArtifactsByChecksum(String repositoryId,
String checksum)
|
|
private void |
getArtifactsByDateRange(List<ArtifactMetadata> artifacts,
String repoId,
String ns,
Date startTime,
Date endTime)
|
|
List<ArtifactMetadata> |
getArtifactsByDateRange(String repoId,
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)
|
|
private File |
getBaseDirectory(String repoId)
|
|
private File |
getDirectory(String repoId)
|
|
private File |
getMetadataDirectory(String repoId,
String facetId)
|
|
MetadataFacet |
getMetadataFacet(String repositoryId,
String facetId,
String name)
|
|
List<String> |
getMetadataFacets(String repoId,
String facetId)
|
|
Collection<String> |
getNamespaces(String repoId,
String baseNamespace)
|
|
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)
|
|
private String |
join(Collection<String> ids)
|
|
|
obtainAccess(Class<T> aClass)
|
|
private Properties |
readOrCreateProperties(File directory,
String propertiesKey)
|
|
private Properties |
readProperties(File directory,
String propertiesKey)
|
|
private void |
recurse(List<String> facets,
String prefix,
File directory)
|
|
void |
removeArtifact(ArtifactMetadata artifactMetadata,
String baseVersion)
used for deleting timestamped version of SNAPSHOT artifacts |
|
void |
removeArtifact(String repositoryId,
String namespace,
String project,
String projectVersion,
MetadataFacet metadataFacet)
FIXME implements this !!!! |
|
void |
removeArtifact(String repoId,
String namespace,
String project,
String version,
String id)
|
|
void |
removeMetadataFacet(String repoId,
String facetId,
String name)
|
|
void |
removeMetadataFacets(String repositoryId,
String facetId)
|
|
void |
removeNamespace(String repositoryId,
String project)
|
|
void |
removeProject(String repositoryId,
String namespace,
String projectId)
remove a project |
|
void |
removeProjectVersion(String repoId,
String namespace,
String projectId,
String projectVersion)
|
|
void |
removeRepository(String repoId)
Delete a repository's metadata. |
|
void |
revert()
implementations can throw RuntimeException |
|
void |
save()
implementations can throw RuntimeException |
|
private void |
setProperty(Properties properties,
String name,
String value)
|
|
void |
updateArtifact(String repoId,
String namespace,
String projectId,
String projectVersion,
ArtifactMetadata artifact)
|
|
private void |
updateArtifactFacets(ArtifactMetadata artifact,
Properties properties)
|
|
void |
updateNamespace(String repoId,
String namespace)
create the namespace in the repository. |
|
void |
updateProject(String repoId,
ProjectMetadata project)
Update metadata for a particular project in the metadata repository, or create it if it does not already exist. |
|
private void |
updateProject(String repoId,
String namespace,
String id)
|
|
private void |
updateProjectReference(String repoId,
String namespace,
String projectId,
String projectVersion,
ProjectVersionReference reference)
|
|
void |
updateProjectVersion(String repoId,
String namespace,
String projectId,
ProjectVersionMetadata versionMetadata)
|
|
private void |
updateProjectVersionFacets(ProjectVersionMetadata versionMetadata,
Properties properties)
|
|
private void |
writeProperties(Properties properties,
File directory,
String propertiesKey)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Map<String,MetadataFacetFactory> metadataFacetFactories
private final ArchivaConfiguration configuration
private org.slf4j.Logger log
private static final String PROJECT_METADATA_KEY
private static final String PROJECT_VERSION_METADATA_KEY
private static final String NAMESPACE_METADATA_KEY
private static final String METADATA_KEY
Constructor Detail |
---|
public FileMetadataRepository(Map<String,MetadataFacetFactory> metadataFacetFactories, ArchivaConfiguration configuration)
Method Detail |
---|
private File getBaseDirectory(String repoId)
private File getDirectory(String repoId)
public void updateProject(String repoId, ProjectMetadata project)
MetadataRepository
updateProject
in interface MetadataRepository
repoId
- the repository the project is inproject
- the project metadata to create or updateprivate void updateProject(String repoId, String namespace, String id)
public void updateProjectVersion(String repoId, String namespace, String projectId, ProjectVersionMetadata versionMetadata)
updateProjectVersion
in interface MetadataRepository
private void updateProjectVersionFacets(ProjectVersionMetadata versionMetadata, Properties properties)
private static void clearMetadataFacetProperties(Collection<MetadataFacet> facetList, Properties properties, String prefix)
private void updateProjectReference(String repoId, String namespace, String projectId, String projectVersion, ProjectVersionReference reference)
public void updateNamespace(String repoId, String namespace)
MetadataRepository
updateNamespace
in interface MetadataRepository
public List<String> getMetadataFacets(String repoId, String facetId)
getMetadataFacets
in interface MetadataRepository
public boolean hasMetadataFacet(String repositoryId, String facetId) throws MetadataRepositoryException
hasMetadataFacet
in interface MetadataRepository
MetadataRepositoryException
private void recurse(List<String> facets, String prefix, File directory)
public MetadataFacet getMetadataFacet(String repositoryId, String facetId, String name)
getMetadataFacet
in interface MetadataRepository
public void addMetadataFacet(String repositoryId, MetadataFacet metadataFacet)
addMetadataFacet
in interface MetadataRepository
public void removeMetadataFacets(String repositoryId, String facetId)
removeMetadataFacets
in interface MetadataRepository
public void removeMetadataFacet(String repoId, String facetId, String name)
removeMetadataFacet
in interface MetadataRepository
public List<ArtifactMetadata> getArtifactsByDateRange(String repoId, Date startTime, Date endTime)
MetadataRepository
null
they are not used for search
getArtifactsByDateRange
in interface MetadataRepository
startTime
- can be null
endTime
- can be null
private void getArtifactsByDateRange(List<ArtifactMetadata> artifacts, String repoId, String ns, Date startTime, Date endTime)
public Collection<ArtifactMetadata> getArtifacts(String repoId, String namespace, String projectId, String projectVersion)
getArtifacts
in interface MetadataRepository
public void save()
MetadataRepository
save
in interface MetadataRepository
public void close()
close
in interface MetadataRepository
public void revert()
MetadataRepository
revert
in interface MetadataRepository
public boolean canObtainAccess(Class<?> aClass)
canObtainAccess
in interface MetadataRepository
public <T> T obtainAccess(Class<T> aClass)
obtainAccess
in interface MetadataRepository
private void updateArtifactFacets(ArtifactMetadata artifact, Properties properties)
public Collection<String> getRepositories()
getRepositories
in interface MetadataRepository
public List<ArtifactMetadata> getArtifactsByChecksum(String repositoryId, String checksum)
getArtifactsByChecksum
in interface MetadataRepository
public void removeNamespace(String repositoryId, String project) throws MetadataRepositoryException
removeNamespace
in interface MetadataRepository
project
- (groupId for maven )
MetadataRepositoryException
public void removeArtifact(ArtifactMetadata artifactMetadata, String baseVersion) throws MetadataRepositoryException
MetadataRepository
removeArtifact
in interface MetadataRepository
artifactMetadata
- the artifactMetadata with the timestamped version (2.0-20120618.214135-2)baseVersion
- the base version of the snapshot (2.0-SNAPSHOT)
MetadataRepositoryException
public void removeArtifact(String repoId, String namespace, String project, String version, String id)
removeArtifact
in interface MetadataRepository
public void removeArtifact(String repositoryId, String namespace, String project, String projectVersion, MetadataFacet metadataFacet) throws MetadataRepositoryException
removeArtifact
in interface MetadataRepository
repositoryId
- namespace
- project
- projectVersion
- metadataFacet
- will remove artifacts which have this MetadataFacet
using equals
MetadataRepositoryException
public void removeRepository(String repoId)
MetadataRepository
removeRepository
in interface MetadataRepository
repoId
- the repository to deleteprivate void getArtifactsByChecksum(List<ArtifactMetadata> artifacts, String repositoryId, String ns, String checksum)
private File getMetadataDirectory(String repoId, String facetId)
private String join(Collection<String> ids)
private void setProperty(Properties properties, String name, String value)
public void updateArtifact(String repoId, String namespace, String projectId, String projectVersion, ArtifactMetadata artifact)
updateArtifact
in interface MetadataRepository
private Properties readOrCreateProperties(File directory, String propertiesKey)
private Properties readProperties(File directory, String propertiesKey) throws IOException
IOException
public ProjectMetadata getProject(String repoId, String namespace, String projectId)
MetadataRepository
getProject
in interface MetadataRepository
public ProjectVersionMetadata getProjectVersion(String repoId, String namespace, String projectId, String projectVersion)
getProjectVersion
in interface MetadataRepository
public Collection<String> getArtifactVersions(String repoId, String namespace, String projectId, String projectVersion)
getArtifactVersions
in interface MetadataRepository
public Collection<ProjectVersionReference> getProjectReferences(String repoId, String namespace, String projectId, String projectVersion)
MetadataRepository
getProjectReferences
in interface MetadataRepository
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 to
public Collection<String> getRootNamespaces(String repoId)
getRootNamespaces
in interface MetadataRepository
public Collection<String> getNamespaces(String repoId, String baseNamespace)
getNamespaces
in interface MetadataRepository
public Collection<String> getProjects(String repoId, String namespace)
getProjects
in interface MetadataRepository
public Collection<String> getProjectVersions(String repoId, String namespace, String projectId)
getProjectVersions
in interface MetadataRepository
public void removeProject(String repositoryId, String namespace, String projectId) throws MetadataRepositoryException
MetadataRepository
removeProject
in interface MetadataRepository
MetadataRepositoryException
public void removeProjectVersion(String repoId, String namespace, String projectId, String projectVersion) throws MetadataRepositoryException
removeProjectVersion
in interface MetadataRepository
MetadataRepositoryException
private void writeProperties(Properties properties, File directory, String propertiesKey) throws IOException
IOException
public List<ArtifactMetadata> getArtifacts(String repoId)
getArtifacts
in interface MetadataRepository
private void getArtifacts(List<ArtifactMetadata> artifacts, String repoId, String ns)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |