archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1486321 - in /archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra: CassandraMetadataRepository.java model/ArtifactMetadataModel.java
Date Sat, 25 May 2013 12:48:43 GMT
Author: olamy
Date: Sat May 25 12:48:43 2013
New Revision: 1486321

URL: http://svn.apache.org/r1486321
Log:
use same type to ease bean replication

Modified:
    archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
    archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ArtifactMetadataModel.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=1486321&r1=1486320&r2=1486321&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
Sat May 25 12:48:43 2013
@@ -552,12 +552,12 @@ public class CassandraMetadataRepository
         ArtifactMetadataModel artifactMetadataModel = artifactMetadataModelEntityManager.get(
key );
         if ( artifactMetadataModel == null )
         {
-            artifactMetadataModel =
-                new ArtifactMetadataModel( key, projectId, repositoryId, namespaceId, artifactMeta.getProject(),
-                                           projectVersion, artifactMeta.getVersion(),
-                                           artifactMeta.getFileLastModified(), artifactMeta.getSize(),
-                                           artifactMeta.getMd5(), artifactMeta.getSha1(),
-                                           artifactMeta.getWhenGathered() );
+            artifactMetadataModel = new ArtifactMetadataModel( key, artifactMeta.getId(),
repositoryId, namespaceId,
+                                                               artifactMeta.getProject(),
projectVersion,
+                                                               artifactMeta.getVersion(),
+                                                               artifactMeta.getFileLastModified(),
+                                                               artifactMeta.getSize(), artifactMeta.getMd5(),
+                                                               artifactMeta.getSha1(), artifactMeta.getWhenGathered()
);
             artifactMetadataModelEntityManager.put( artifactMetadataModel );
 
         }
@@ -860,7 +860,8 @@ public class CassandraMetadataRepository
                     {
 
                         Date when = artifactMetadataModel.getWhenGathered();
-                        if ( when.getTime() >= startTime.getTime() && when.getTime()
<= endTime.getTime() )
+                        if ( ( startTime != null ? when.getTime() >= startTime.getTime()
: true ) && ( endTime != null ?
+                            when.getTime() <= endTime.getTime() : true ) )
                         {
                             artifactMetadataModels.add( artifactMetadataModel );
                         }

Modified: archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ArtifactMetadataModel.java
URL: http://svn.apache.org/viewvc/archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ArtifactMetadataModel.java?rev=1486321&r1=1486320&r2=1486321&view=diff
==============================================================================
--- archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ArtifactMetadataModel.java
(original)
+++ archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ArtifactMetadataModel.java
Sat May 25 12:48:43 2013
@@ -58,7 +58,7 @@ public class ArtifactMetadataModel
     private String version;
 
     @Column( name = "fileLastModified" )
-    private Date fileLastModified;
+    private long fileLastModified;
 
     @Column( name = "size" )
     private long size;
@@ -88,7 +88,7 @@ public class ArtifactMetadataModel
         this.project = project;
         this.projectVersion = projectVersion;
         this.version = version;
-        this.fileLastModified = fileLastModified;
+        this.fileLastModified = fileLastModified.getTime();
         this.size = size;
         this.md5 = md5;
         this.sha1 = sha1;
@@ -165,12 +165,12 @@ public class ArtifactMetadataModel
         this.version = version;
     }
 
-    public Date getFileLastModified()
+    public long getFileLastModified()
     {
         return fileLastModified;
     }
 
-    public void setFileLastModified( Date fileLastModified )
+    public void setFileLastModified( long fileLastModified )
     {
         this.fileLastModified = fileLastModified;
     }



Mime
View raw message