archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1489417 - /archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
Date Tue, 04 Jun 2013 12:46:21 GMT
Author: olamy
Date: Tue Jun  4 12:46:20 2013
New Revision: 1489417

URL: http://svn.apache.org/r1489417
Log:
fix getProjects

Modified:
    archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java

Modified: archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
URL: http://svn.apache.org/viewvc/archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java?rev=1489417&r1=1489416&r2=1489417&view=diff
==============================================================================
--- archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
(original)
+++ archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
Tue Jun  4 12:46:20 2013
@@ -692,7 +692,7 @@ public class CassandraMetadataRepository
                 {
                     if ( StringUtils.equals( repoId,
                                              projectVersionMetadataModel.getNamespace().getRepository().getName()
)
-                        && StringUtils.equals( namespace, projectVersionMetadataModel.getNamespace().getName()
)
+                        && StringUtils.startsWith( projectVersionMetadataModel.getNamespace().getName(),
namespace )
                         && StringUtils.equals( projectId, projectVersionMetadataModel.getProjectId()
) )
                     {
                         versions.add( projectVersionMetadataModel.getId() );
@@ -1536,6 +1536,24 @@ public class CassandraMetadataRepository
         final Set<String> projects = new HashSet<String>();
 
         // FIXME use cql query
+        projectEntityManager.visitAll( new Function<Project, Boolean>()
+        {
+            @Override
+            public Boolean apply( Project project )
+            {
+                if ( project != null )
+                {
+                    if ( StringUtils.equals( repoId, project.getNamespace().getRepository().getName()
)
+                        && StringUtils.startsWith( project.getNamespace().getName(),
namespace ) )
+                    {
+                        projects.add( project.getProjectId() );
+                    }
+                }
+                return Boolean.TRUE;
+            }
+        } );
+        /*
+
         artifactMetadataModelEntityManager.visitAll( new Function<ArtifactMetadataModel,
Boolean>()
         {
             @Override
@@ -1552,7 +1570,7 @@ public class CassandraMetadataRepository
                 return Boolean.TRUE;
             }
         } );
-
+        */
         return projects;
     }
 



Mime
View raw message