archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r893130 - in /archiva/branches/MRM-1025/archiva-modules: archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ metadata/metadata-repository-api/ metadata/metadata-repository-api/src/main/java/org/apache/archiva/metad...
Date Tue, 22 Dec 2009 10:34:11 GMT
Author: brett
Date: Tue Dec 22 10:34:07 2009
New Revision: 893130

URL: http://svn.apache.org/viewvc?rev=893130&view=rev
Log:
[MRM-1282] add some logging with regard to namespaces and resolution

Modified:
    archiva/branches/MRM-1025/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java
    archiva/branches/MRM-1025/archiva-modules/metadata/metadata-repository-api/pom.xml
    archiva/branches/MRM-1025/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java

Modified: archiva/branches/MRM-1025/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-1025/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java?rev=893130&r1=893129&r2=893130&view=diff
==============================================================================
--- archiva/branches/MRM-1025/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java
(original)
+++ archiva/branches/MRM-1025/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java
Tue Dec 22 10:34:07 2009
@@ -91,6 +91,10 @@
         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 @@
             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

Modified: archiva/branches/MRM-1025/archiva-modules/metadata/metadata-repository-api/pom.xml
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-1025/archiva-modules/metadata/metadata-repository-api/pom.xml?rev=893130&r1=893129&r2=893130&view=diff
==============================================================================
--- archiva/branches/MRM-1025/archiva-modules/metadata/metadata-repository-api/pom.xml (original)
+++ archiva/branches/MRM-1025/archiva-modules/metadata/metadata-repository-api/pom.xml Tue
Dec 22 10:34:07 2009
@@ -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>

Modified: archiva/branches/MRM-1025/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-1025/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java?rev=893130&r1=893129&r2=893130&view=diff
==============================================================================
--- archiva/branches/MRM-1025/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java
(original)
+++ archiva/branches/MRM-1025/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java
Tue Dec 22 10:34:07 2009
@@ -29,6 +29,8 @@
 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 @@
      */
     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 @@
             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 @@
             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 @@
             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 @@
                                                                                         
   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 @@
                                           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 );



Mime
View raw message