summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-04-02 04:04:10 +0000
committerOlivier Lamy <olamy@apache.org>2014-04-02 04:04:10 +0000
commit668d12030bc3050bed480959f4db2b89bd65a85b (patch)
treec53f54ca43f18622ec46af31df61c87f9f3c31b8 /archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default
parent56696b4bd8dadb5de0d436e77ab4b910fe183a45 (diff)
downloadarchiva-668d12030bc3050bed480959f4db2b89bd65a85b.tar.gz
archiva-668d12030bc3050bed480959f4db2b89bd65a85b.zip
invalidate namespace cache when deleting a repository
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1583869 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default')
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
index bb7b09d53..6f56f37fd 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
@@ -36,6 +36,7 @@ import org.apache.archiva.metadata.repository.MetadataRepositoryException;
import org.apache.archiva.metadata.repository.RepositorySession;
import org.apache.archiva.metadata.repository.RepositorySessionFactory;
import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager;
+import org.apache.archiva.redback.components.cache.Cache;
import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
import org.apache.archiva.redback.role.RoleManager;
import org.apache.archiva.redback.role.RoleManagerException;
@@ -60,6 +61,7 @@ import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -102,6 +104,10 @@ public class DefaultManagedRepositoryAdmin
@Inject
protected RoleManager roleManager;
+ @Inject
+ @Named( value = "cache#namespaces" )
+ private Cache<String, Collection<String>> namespacesCache;
+
// fields
List<? extends IndexCreator> indexCreators;
@@ -382,6 +388,8 @@ public class DefaultManagedRepositoryAdmin
{
MetadataRepository metadataRepository = repositorySession.getRepository();
metadataRepository.removeRepository( repository.getId() );
+ //invalidate cache
+ namespacesCache.remove( repository.getId() );
log.debug( "call repositoryStatisticsManager.deleteStatistics" );
getRepositoryStatisticsManager().deleteStatistics( metadataRepository, repository.getId() );
repositorySession.save();