]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1490] REST services add missing fields when creating a managed repository
authorOlivier Lamy <olamy@apache.org>
Thu, 15 Sep 2011 08:58:52 +0000 (08:58 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 15 Sep 2011 08:58:52 +0000 (08:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1171014 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ManagedRepository.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultManagedRepositoriesService.java

index d3d87eebbf1ff88f3bb07ec420830c6d4b02a041..e12936d79792e94bc309c83a65e0d75d65c1944c 100644 (file)
@@ -215,6 +215,7 @@ public class DefaultManagedRepositoryAdmin
         repository.setDaysOlder( daysOlder );
         repository.setRetentionCount( retentionCount );
         repository.setDeleteReleasedSnapshots( deteleReleasedSnapshots );
+        repository.setIndexDir( indexDir );
 
         try
         {
index 85d903a28ba726ddcd8c2937b4859a19a36833f1..afab71e521d884005d150577a045a6c98ea76a55 100644 (file)
@@ -50,7 +50,21 @@ public class ManagedRepository
 
     private boolean resetStats;
 
-    private boolean scanned =false;
+    private boolean scanned = false;
+
+    /**
+     * default model value
+     */
+    private int daysOlder = 100;
+
+    /**
+     * default model value
+     */
+    private int retentionCount = 2;
+
+    private boolean deleteReleasedSnapshots;
+
+    private String indexDirectory;
 
     public ManagedRepository()
     {
@@ -186,6 +200,46 @@ public class ManagedRepository
         this.scanned = scanned;
     }
 
+    public String getIndexDirectory()
+    {
+        return indexDirectory;
+    }
+
+    public void setIndexDirectory( String indexDirectory )
+    {
+        this.indexDirectory = indexDirectory;
+    }
+
+    public int getDaysOlder()
+    {
+        return daysOlder;
+    }
+
+    public void setDaysOlder( int daysOlder )
+    {
+        this.daysOlder = daysOlder;
+    }
+
+    public int getRetentionCount()
+    {
+        return retentionCount;
+    }
+
+    public void setRetentionCount( int retentionCount )
+    {
+        this.retentionCount = retentionCount;
+    }
+
+    public boolean isDeleteReleasedSnapshots()
+    {
+        return deleteReleasedSnapshots;
+    }
+
+    public void setDeleteReleasedSnapshots( boolean deleteReleasedSnapshots )
+    {
+        this.deleteReleasedSnapshots = deleteReleasedSnapshots;
+    }
+
     public int hashCode()
     {
         int result = 17;
@@ -227,6 +281,7 @@ public class ManagedRepository
         sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' );
         sb.append( ", resetStats=" ).append( resetStats );
         sb.append( ", scanned=" ).append( scanned );
+        sb.append( ", indexDirectory='" ).append( indexDirectory ).append( '\'' );
         sb.append( '}' );
         return sb.toString();
     }
index a122821138647af3ea66df84fc5403adb921d5a4..2bce3fa97552cf310d6ac97e7e0fc8598fc46fd8 100644 (file)
@@ -119,6 +119,10 @@ public class DefaultManagedRepositoriesService
         repo.setName( managedRepository.getName() );
         repo.setReleases( managedRepository.isReleases() );
         repo.setSnapshots( managedRepository.isSnapshots() );
+        repo.setIndexDirectory( managedRepository.getIndexDirectory() );
+        repo.setDaysOlder( managedRepository.getDaysOlder() );
+        repo.setDeleteReleasedSnapshots( managedRepository.isDeleteReleasedSnapshots() );
+        repo.setRetentionCount( managedRepository.getRetentionCount() );
         try
         {
             return managedRepositoryAdmin.addManagedRepository( repo, managedRepository.isStageRepoNeeded(),