[MRM-1282] add some logging with regard to namespaces and resolution

git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@893130 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2009-12-22 10:34:07 +00:00
parent efd9d33b06
commit 7a2047d3fe
3 changed files with 36 additions and 0 deletions

View File

@ -91,6 +91,10 @@ public class BrowseAction
Collection<String> subNamespaces = metadataResolver.getNamespaces( repoId, n );
if ( subNamespaces.size() != 1 )
{
if ( log.isDebugEnabled() )
{
log.debug( n + " is not collapsible as it has sub-namespaces: " + subNamespaces );
}
return n;
}
else
@ -98,6 +102,10 @@ public class BrowseAction
Collection<String> projects = metadataResolver.getProjects( repoId, n );
if ( projects != null && !projects.isEmpty() )
{
if ( log.isDebugEnabled() )
{
log.debug( n + " is not collapsible as it has projects" );
}
return n;
}
else

View File

@ -30,5 +30,9 @@
<groupId>org.apache.archiva</groupId>
<artifactId>metadata-model</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -29,6 +29,8 @@ import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.metadata.model.ProjectVersionReference;
import org.apache.archiva.metadata.repository.filter.ExcludesFilter;
import org.apache.archiva.metadata.repository.storage.StorageMetadataResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @plexus.component role="org.apache.archiva.metadata.repository.MetadataResolver"
@ -50,6 +52,8 @@ public class DefaultMetadataResolver
*/
private StorageMetadataResolver storageResolver;
private static final Logger log = LoggerFactory.getLogger( DefaultMetadataResolver.class );
public ProjectMetadata getProject( String repoId, String namespace, String projectId )
{
// TODO: intercept
@ -112,6 +116,10 @@ public class DefaultMetadataResolver
storageResolver.getRootNamespaces( repoId, new ExcludesFilter<String>( namespaces ) );
if ( storageNamespaces != null && !storageNamespaces.isEmpty() )
{
if ( log.isDebugEnabled() )
{
log.debug( "Resolved root namespaces from storage: " + storageNamespaces );
}
for ( String n : storageNamespaces )
{
metadataRepository.updateNamespace( repoId, n );
@ -131,6 +139,10 @@ public class DefaultMetadataResolver
storageResolver.getNamespaces( repoId, namespace, new ExcludesFilter<String>( exclusions ) );
if ( storageNamespaces != null && !storageNamespaces.isEmpty() )
{
if ( log.isDebugEnabled() )
{
log.debug( "Resolved namespaces from storage: " + storageNamespaces );
}
for ( String n : storageNamespaces )
{
metadataRepository.updateNamespace( repoId, namespace + "." + n );
@ -150,6 +162,10 @@ public class DefaultMetadataResolver
storageResolver.getProjects( repoId, namespace, new ExcludesFilter<String>( exclusions ) );
if ( storageProjects != null && !storageProjects.isEmpty() )
{
if ( log.isDebugEnabled() )
{
log.debug( "Resolved projects from storage: " + storageProjects );
}
for ( String projectId : storageProjects )
{
ProjectMetadata projectMetadata = storageResolver.getProject( repoId, namespace, projectId );
@ -172,6 +188,10 @@ public class DefaultMetadataResolver
projectVersions ) );
if ( storageProjectVersions != null && !storageProjectVersions.isEmpty() )
{
if ( log.isDebugEnabled() )
{
log.debug( "Resolved project versions from storage: " + storageProjectVersions );
}
for ( String projectVersion : storageProjectVersions )
{
ProjectVersionMetadata versionMetadata =
@ -197,6 +217,10 @@ public class DefaultMetadataResolver
new ExcludesFilter<String>( createArtifactIdList( artifacts ) ) );
if ( storageArtifacts != null && !storageArtifacts.isEmpty() )
{
if ( log.isDebugEnabled() )
{
log.debug( "Resolved artifacts from storage: " + storageArtifacts );
}
for ( ArtifactMetadata artifact : storageArtifacts )
{
metadataRepository.updateArtifact( repoId, namespace, projectId, projectVersion, artifact );