@Service(value="metadataResolver#default") public class DefaultMetadataResolver extends Object implements MetadataResolver
Default implementation of the metadata resolver API. At present it will handle updating the content repository from new or changed information in the model and artifacts from the repository storage.
This is a singleton component to allow an alternate implementation to be provided. It is intended to be the same system-wide for the whole content repository instead of on a per-managed-repository basis. Therefore, the session is passed in as an argument to obtain any necessary resources, rather than the class being instantiated within the session in the context of a single managed repository's resolution needs.
Note that the caller is responsible for the session, such as closing and saving (which is implied by the resolver
being obtained from within the session). The RepositorySession.markDirty()
method is used as a hint to ensure
that the session knows we've made changes at close. We cannot ensure the changes will be persisted if the caller
chooses to revert first. This is preferable to storing the metadata immediately - a separate session would require
having a bi-directional link with the session factory, and saving the existing session might save other changes
unknowingly by the caller.
Constructor and Description |
---|
DefaultMetadataResolver() |
Modifier and Type | Method and Description |
---|---|
Collection<ArtifactMetadata> |
resolveArtifacts(RepositorySession session,
String repoId,
String namespace,
String projectId,
String projectVersion) |
Collection<String> |
resolveNamespaces(RepositorySession session,
String repoId,
String namespace) |
Collection<ProjectVersionReference> |
resolveProjectReferences(RepositorySession session,
String repoId,
String namespace,
String projectId,
String projectVersion)
Retrieve project references from the metadata repository.
|
Collection<String> |
resolveProjects(RepositorySession session,
String repoId,
String namespace) |
ProjectVersionMetadata |
resolveProjectVersion(RepositorySession session,
String repoId,
String namespace,
String projectId,
String projectVersion) |
Collection<String> |
resolveProjectVersions(RepositorySession session,
String repoId,
String namespace,
String projectId) |
Collection<String> |
resolveRootNamespaces(RepositorySession session,
String repoId) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
supportsRepositoryTypes
public DefaultMetadataResolver()
public ProjectVersionMetadata resolveProjectVersion(RepositorySession session, String repoId, String namespace, String projectId, String projectVersion) throws MetadataResolutionException
resolveProjectVersion
in interface MetadataResolver
MetadataResolutionException
public Collection<ProjectVersionReference> resolveProjectReferences(RepositorySession session, String repoId, String namespace, String projectId, String projectVersion) throws MetadataResolutionException
MetadataResolver
resolveProjectReferences
in interface MetadataResolver
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
public Collection<String> resolveRootNamespaces(RepositorySession session, String repoId) throws MetadataResolutionException
resolveRootNamespaces
in interface MetadataResolver
MetadataResolutionException
public Collection<String> resolveNamespaces(RepositorySession session, String repoId, String namespace) throws MetadataResolutionException
resolveNamespaces
in interface MetadataResolver
MetadataResolutionException
public Collection<String> resolveProjects(RepositorySession session, String repoId, String namespace) throws MetadataResolutionException
resolveProjects
in interface MetadataResolver
MetadataResolutionException
public Collection<String> resolveProjectVersions(RepositorySession session, String repoId, String namespace, String projectId) throws MetadataResolutionException
resolveProjectVersions
in interface MetadataResolver
MetadataResolutionException
public Collection<ArtifactMetadata> resolveArtifacts(RepositorySession session, String repoId, String namespace, String projectId, String projectVersion) throws MetadataResolutionException
resolveArtifacts
in interface MetadataResolver
MetadataResolutionException
Copyright © 2006–2019 The Apache Software Foundation. All rights reserved.