archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1581702 - in /archiva/trunk/archiva-modules: metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/ plugins/metadata-store-cassandra/ plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadat...
Date Wed, 26 Mar 2014 06:02:09 GMT
Author: olamy
Date: Wed Mar 26 06:02:09 2014
New Revision: 1581702

URL: http://svn.apache.org/r1581702
Log:
some cleanup

Modified:
    archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java
    archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/pom.xml
    archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
    archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ArtifactMetadataModel.java
    archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/MetadataFacetModel.java
    archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/Project.java
    archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ProjectVersionMetadataModel.java
    archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java

Modified: archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java?rev=1581702&r1=1581701&r2=1581702&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java
(original)
+++ archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java
Wed Mar 26 06:02:09 2014
@@ -50,6 +50,7 @@ public interface MetadataRepository
 
     /**
      * create the namespace in the repository. (if not exist)
+     *
      * @param repositoryId
      * @param namespace
      * @throws MetadataRepositoryException
@@ -61,12 +62,11 @@ public interface MetadataRepository
         throws MetadataRepositoryException;
 
     /**
-     *
      * @param repositoryId
      * @param facetId
      * @return true if the repository datas for this facetId
-     * @since 1.4-M4
      * @throws MetadataRepositoryException
+     * @since 1.4-M4
      */
     boolean hasMetadataFacet( String repositoryId, String facetId )
         throws MetadataRepositoryException;
@@ -85,9 +85,10 @@ public interface MetadataRepository
 
     /**
      * if startTime or endTime are <code>null</code> they are not used for search
+     *
      * @param repositoryId
-     * @param startTime can be <code>null</code>
-     * @param endTime can be <code>null</code>
+     * @param startTime    can be <code>null</code>
+     * @param endTime      can be <code>null</code>
      * @return
      * @throws MetadataRepositoryException
      */
@@ -118,6 +119,7 @@ public interface MetadataRepository
     /**
      * FIXME need a unit test!!!
      * Only remove {@link MetadataFacet} for the artifact
+     *
      * @param repositoryId
      * @param namespace
      * @param project
@@ -152,6 +154,7 @@ public interface MetadataRepository
 
     /**
      * basically just checking it exists not complete data returned
+     *
      * @param repoId
      * @param namespace
      * @param projectId
@@ -186,7 +189,6 @@ public interface MetadataRepository
         throws MetadataResolutionException;
 
     /**
-     *
      * @param repoId
      * @param namespace
      * @return {@link Collection} of child namespaces of the namespace argument
@@ -195,9 +197,22 @@ public interface MetadataRepository
     Collection<String> getNamespaces( String repoId, String namespace )
         throws MetadataResolutionException;
 
+    /**
+     * @param repoId
+     * @param namespace
+     * @return
+     * @throws MetadataResolutionException
+     */
     Collection<String> getProjects( String repoId, String namespace )
         throws MetadataResolutionException;
 
+    /**
+     * @param repoId
+     * @param namespace
+     * @param projectId
+     * @return
+     * @throws MetadataResolutionException
+     */
     Collection<String> getProjectVersions( String repoId, String namespace, String
projectId )
         throws MetadataResolutionException;
 
@@ -212,12 +227,21 @@ public interface MetadataRepository
     void removeProjectVersion( String repoId, String namespace, String projectId, String
projectVersion )
         throws MetadataRepositoryException;
 
+    /**
+     * @param repoId
+     * @param namespace
+     * @param projectId
+     * @param projectVersion
+     * @return
+     * @throws MetadataResolutionException
+     */
     Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String
projectId,
                                                String projectVersion )
         throws MetadataResolutionException;
 
     /**
      * remove a project
+     *
      * @param repositoryId
      * @param namespace
      * @param projectId
@@ -244,6 +268,6 @@ public interface MetadataRepository
 
     boolean canObtainAccess( Class<?> aClass );
 
-    <T>T obtainAccess( Class<T> aClass )
+    <T> T obtainAccess( Class<T> aClass )
         throws MetadataRepositoryException;
 }

Modified: archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/pom.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/pom.xml?rev=1581702&r1=1581701&r2=1581702&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/pom.xml (original)
+++ archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/pom.xml Wed Mar 26 06:02:09
2014
@@ -75,12 +75,6 @@
       <artifactId>modelmapper</artifactId>
     </dependency>
 
-
-    <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-jpa_2.0_spec</artifactId>
-    </dependency>
-
     <dependency>
       <groupId>org.apache.cassandra</groupId>
       <artifactId>cassandra-all</artifactId>

Modified: archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java?rev=1581702&r1=1581701&r2=1581702&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
(original)
+++ archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
Wed Mar 26 06:02:09 2014
@@ -1030,8 +1030,7 @@ public class CassandraMetadataRepository
 
         String key = result.get().iterator().next().getKey();
 
-        ColumnFamilyResult<String, String> columnFamilyResult =
-            this.projectVersionMetadataTemplate.queryColumns( key );
+        ColumnFamilyResult<String, String> columnFamilyResult = this.projectVersionMetadataTemplate.queryColumns(
key );
 
         if ( !columnFamilyResult.hasResults() )
         {
@@ -1547,9 +1546,8 @@ public class CassandraMetadataRepository
                     .addEqualsExpression( "repositoryName", artifactMetadataModel.getRepositoryId()
) //
                     .addEqualsExpression( "namespaceId", artifactMetadataModel.getNamespace()
) //
                     .addEqualsExpression( "projectId", artifactMetadataModel.getProject()
) //
-                    .addEqualsExpression( "projectVersion",
-                                          artifactMetadataModel.getProjectVersion() ).addEqualsExpression(
"facetId",
-                                                                                        
                  facetId ) //
+                    .addEqualsExpression( "projectVersion", artifactMetadataModel.getProjectVersion()
) //
+                    .addEqualsExpression( "facetId", facetId ) //
                     .execute();
 
             for ( Row<String, String, String> row : result.get().getList() )
@@ -1686,23 +1684,12 @@ public class CassandraMetadataRepository
         {
             for ( Map.Entry<String, String> entry : metadataFacet.toProperties().entrySet()
)
             {
-
                 String key = new MetadataFacetModel.KeyBuilder().withRepositoryId( repositoryId
).withFacetId(
                     metadataFacet.getFacetId() ).withName( metadataFacet.getName() ).withKey(
entry.getKey() ).build();
 
                 boolean exists = this.metadataFacetTemplate.isColumnsExist( key );
                 if ( !exists )
                 {
-                    //metadataFacetModel = new MetadataFacetModel();
-                    // we need to store the repositoryId
-                    //ArtifactMetadataModel artifactMetadataModel = new ArtifactMetadataModel();
-                    //artifactMetadataModel.setRepositoryId( repositoryId );
-                    //metadataFacetModel.setArtifactMetadataModel( artifactMetadataModel
);
-                    //metadataFacetModel.setId( key );
-                    //metadataFacetModel.setKey( entry.getKey() );
-                    //metadataFacetModel.setFacetId( metadataFacet.getFacetId() );
-                    //metadataFacetModel.setName( metadataFacet.getName() );
-
                     String cf = this.cassandraArchivaManager.getMetadataFacetFamilyName();
                     this.metadataFacetTemplate.createMutator() //
                         .addInsertion( key, cf, column( "repositoryName", repositoryId )
) //
@@ -1711,7 +1698,6 @@ public class CassandraMetadataRepository
                         .addInsertion( key, cf, column( "key", entry.getKey() ) ) //
                         .addInsertion( key, cf, column( "value", entry.getValue() ) ) //
                         .execute();
-
                 }
                 else
                 {
@@ -1965,8 +1951,6 @@ public class CassandraMetadataRepository
         {
             this.artifactMetadataTemplate.deleteRow( row.getKey() );
         }
-
-
     }
 
 

Modified: archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ArtifactMetadataModel.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ArtifactMetadataModel.java?rev=1581702&r1=1581701&r2=1581702&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ArtifactMetadataModel.java
(original)
+++ archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ArtifactMetadataModel.java
Wed Mar 26 06:02:09 2014
@@ -21,7 +21,6 @@ package org.apache.archiva.metadata.repo
 
 import org.apache.archiva.metadata.repository.cassandra.CassandraUtils;
 
-import javax.persistence.Column;
 import java.io.Serializable;
 import java.util.Date;
 
@@ -35,37 +34,26 @@ public class ArtifactMetadataModel
     implements Serializable
 {
 
-    @Column(name = "id")
     private String id;
 
-    @Column(name = "repositoryName")
     private String repositoryId;
 
-    @Column(name = "namespaceId")
     private String namespace;
 
-    @Column(name = "project")
     private String project;
 
-    @Column(name = "projectVersion")
     private String projectVersion;
 
-    @Column(name = "version")
     private String version;
 
-    @Column(name = "fileLastModified")
     private long fileLastModified;
 
-    @Column(name = "size")
     private long size;
 
-    @Column(name = "md5")
     private String md5;
 
-    @Column(name = "sha1")
     private String sha1;
 
-    @Column(name = "whenGathered")
     private long whenGathered;
 
     public ArtifactMetadataModel()

Modified: archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/MetadataFacetModel.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/MetadataFacetModel.java?rev=1581702&r1=1581701&r2=1581702&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/MetadataFacetModel.java
(original)
+++ archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/MetadataFacetModel.java
Wed Mar 26 06:02:09 2014
@@ -21,8 +21,6 @@ package org.apache.archiva.metadata.repo
 
 import org.apache.archiva.metadata.repository.cassandra.CassandraUtils;
 
-import javax.persistence.Column;
-
 /**
  * Cassandra storage model for {@link org.apache.archiva.metadata.model.MetadataFacet}
  *
@@ -31,21 +29,12 @@ import javax.persistence.Column;
  */
 public class MetadataFacetModel
 {
-    // id is repositoryId + namespaceId + projectId + facetId + name + mapKey
-
-    //@Column(name = "artifactMetadataModel")
-    //private ArtifactMetadataModel artifactMetadataModel;
-
-    @Column(name = "facetId")
     private String facetId;
 
-    @Column(name = "key")
     private String key;
 
-    @Column(name = "name")
     private String name;
 
-    @Column(name = "value")
     private String value;
 
     private String projectVersion;

Modified: archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/Project.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/Project.java?rev=1581702&r1=1581701&r2=1581702&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/Project.java
(original)
+++ archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/Project.java
Wed Mar 26 06:02:09 2014
@@ -21,8 +21,6 @@ package org.apache.archiva.metadata.repo
 
 import org.apache.archiva.metadata.repository.cassandra.CassandraUtils;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -32,103 +30,6 @@ import java.io.Serializable;
 public class Project
     implements Serializable
 {
-    @Id
-    @Column(name = "projectKey")
-    private String projectKey;
-
-    @Column(name = "projectId")
-    private String projectId;
-
-
-    @Column(name = "repository")
-    private Namespace namespace;
-
-    public Project()
-    {
-        // no op
-    }
-
-    public Project( String projectKey, String projectId, Namespace namespace )
-    {
-        this.projectId = projectId;
-        this.projectKey = projectKey;
-        this.namespace = namespace;
-    }
-
-    public String getProjectKey()
-    {
-        return projectKey;
-    }
-
-    public void setProjectKey( String projectKey )
-    {
-        this.projectKey = projectKey;
-    }
-
-    public Namespace getNamespace()
-    {
-        return namespace;
-    }
-
-    public void setNamespace( Namespace namespace )
-    {
-        this.namespace = namespace;
-    }
-
-    public String getProjectId()
-    {
-        return projectId;
-    }
-
-    public void setProjectId( String projectId )
-    {
-        this.projectId = projectId;
-    }
-
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( this == o )
-        {
-            return true;
-        }
-        if ( o == null || getClass() != o.getClass() )
-        {
-            return false;
-        }
-
-        Project project = (Project) o;
-
-        if ( !projectKey.equals( project.projectKey ) )
-        {
-            return false;
-        }
-        if ( !namespace.equals( project.namespace ) )
-        {
-            return false;
-        }
-
-        return true;
-    }
-
-    @Override
-    public int hashCode()
-    {
-        int result = projectKey.hashCode();
-        result = 31 * result + namespace.hashCode();
-        return result;
-    }
-
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder( "Project{" );
-        sb.append( "projectKey='" ).append( projectKey ).append( '\'' );
-        sb.append( ", projectId='" ).append( projectId ).append( '\'' );
-        sb.append( ", namespace=" ).append( namespace );
-        sb.append( '}' );
-        return sb.toString();
-    }
 
     public static class KeyBuilder
     {

Modified: archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ProjectVersionMetadataModel.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ProjectVersionMetadataModel.java?rev=1581702&r1=1581701&r2=1581702&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ProjectVersionMetadataModel.java
(original)
+++ archiva/trunk/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ProjectVersionMetadataModel.java
Wed Mar 26 06:02:09 2014
@@ -28,7 +28,6 @@ import org.apache.archiva.metadata.model
 import org.apache.archiva.metadata.model.Scm;
 import org.apache.archiva.metadata.repository.cassandra.CassandraUtils;
 
-import javax.persistence.Column;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -38,52 +37,32 @@ import java.util.List;
  */
 public class ProjectVersionMetadataModel
 {
-
-
-    @Column(name = "namespaceId") // repositoryName
     private Namespace namespace;
 
-    /**
-     * id is the id
-     */
-    @Column(name = "id")
     private String id;
 
-    @Column(name = "projectId")
     private String projectId;
 
-    @Column(name = "url")
     private String url;
 
-    @Column(name = "name")
     private String name;
 
-    @Column(name = "description")
     private String description;
 
-    @Column(name = "organization")
     private Organization organization;
 
-    @Column(name = "issueManagement")
     private IssueManagement issueManagement;
 
-    @Column(name = "scm")
     private Scm scm;
 
-    @Column(name = "ciManagement")
     private CiManagement ciManagement;
 
-    // FIXME store those values in a separate table
-    @Column(name = "licenses")
     private List<License> licenses = new ArrayList<License>();
 
-    @Column(name = "mailingLists")
     private List<MailingList> mailingLists = new ArrayList<MailingList>();
 
-    @Column(name = "dependencies")
     private List<Dependency> dependencies = new ArrayList<Dependency>();
 
-    @Column(name = "incomplete")
     private boolean incomplete;
 
     public String getProjectId()

Modified: archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java?rev=1581702&r1=1581701&r2=1581702&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
(original)
+++ archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
Wed Mar 26 06:02:09 2014
@@ -1148,8 +1148,8 @@ public class JcrMetadataRepository
 
             for ( Node node : JcrUtils.getChildNodes( nodeAtPath ) )
             {
-                if ( node.isNodeType( PROJECT_VERSION_NODE_TYPE ) && StringUtils.equals(
node.getName(),
-                                                                                        
projectVersion ) )
+                if ( node.isNodeType( PROJECT_VERSION_NODE_TYPE ) //
+                    && StringUtils.equals( node.getName(), projectVersion ) )
                 {
                     node.remove();
                 }



Mime
View raw message