1 package org.apache.archiva.admin.repository.managed;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
21 import org.apache.archiva.admin.model.AuditInformation;
22 import org.apache.archiva.admin.model.RepositoryAdminException;
23 import org.apache.archiva.admin.model.beans.ManagedRepository;
24 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
25 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
26 import org.apache.archiva.configuration.Configuration;
27 import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
28 import org.apache.archiva.configuration.ProxyConnectorConfiguration;
29 import org.apache.archiva.configuration.RepositoryGroupConfiguration;
30 import org.apache.archiva.metadata.model.facets.AuditEvent;
31 import org.apache.archiva.metadata.repository.MetadataRepository;
32 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
33 import org.apache.archiva.metadata.repository.RepositorySession;
34 import org.apache.archiva.metadata.repository.RepositorySessionFactory;
35 import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager;
36 import org.apache.archiva.redback.components.cache.Cache;
37 import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
38 import org.apache.archiva.redback.role.RoleManager;
39 import org.apache.archiva.redback.role.RoleManagerException;
40 import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
41 import org.apache.archiva.scheduler.repository.model.RepositoryTask;
42 import org.apache.archiva.security.common.ArchivaRoleConstants;
43 import org.apache.commons.io.FileUtils;
44 import org.apache.commons.lang.StringUtils;
45 import org.apache.maven.index.NexusIndexer;
46 import org.apache.maven.index.context.IndexCreator;
47 import org.apache.maven.index.context.IndexingContext;
48 import org.apache.maven.index.context.UnsupportedExistingLuceneIndexException;
49 import org.slf4j.Logger;
50 import org.slf4j.LoggerFactory;
51 import org.springframework.stereotype.Service;
53 import javax.annotation.PostConstruct;
54 import javax.annotation.PreDestroy;
55 import javax.inject.Inject;
56 import javax.inject.Named;
58 import java.io.IOException;
59 import java.net.MalformedURLException;
60 import java.util.ArrayList;
61 import java.util.Collection;
62 import java.util.Collections;
63 import java.util.HashMap;
64 import java.util.List;
68 * FIXME review the staging mechanism to have a per user session one
70 * @author Olivier Lamy
72 @Service("managedRepositoryAdmin#default")
73 public class DefaultManagedRepositoryAdmin
74 extends AbstractRepositoryAdmin
75 implements ManagedRepositoryAdmin
78 private Logger log = LoggerFactory.getLogger( getClass() );
80 public static final String STAGE_REPO_ID_END = "-stage";
83 @Named(value = "archivaTaskScheduler#repository")
84 private RepositoryArchivaTaskScheduler repositoryTaskScheduler;
87 * FIXME: this could be multiple implementations and needs to be configured.
90 private RepositorySessionFactory repositorySessionFactory;
93 private RepositoryStatisticsManager repositoryStatisticsManager;
96 protected RoleManager roleManager;
99 @Named(value = "cache#namespaces")
100 private Cache<String, Collection<String>> namespacesCache;
104 private List<? extends IndexCreator> indexCreators;
107 private NexusIndexer indexer;
110 public void initialize()
111 throws RepositoryAdminException, RoleManagerException
113 // initialize index context on start and check roles here
114 for ( ManagedRepository managedRepository : getManagedRepositories() )
116 createIndexContext( managedRepository );
117 addRepositoryRoles( managedRepository.getId() );
123 public void shutdown()
124 throws RepositoryAdminException
128 // close index on shutdown
129 for ( ManagedRepository managedRepository : getManagedRepositories() )
131 IndexingContext context = indexer.getIndexingContexts().get( managedRepository.getId() );
132 if ( context != null )
134 indexer.removeIndexingContext( context, false );
138 catch ( IOException e )
140 throw new RepositoryAdminException( e.getMessage(), e );
145 public List<ManagedRepository> getManagedRepositories()
146 throws RepositoryAdminException
148 List<ManagedRepositoryConfiguration> managedRepoConfigs =
149 getArchivaConfiguration().getConfiguration().getManagedRepositories();
151 if ( managedRepoConfigs == null )
153 return Collections.emptyList();
156 List<ManagedRepository> managedRepos = new ArrayList<ManagedRepository>( managedRepoConfigs.size() );
158 for ( ManagedRepositoryConfiguration repoConfig : managedRepoConfigs )
160 ManagedRepository repo =
161 new ManagedRepository( repoConfig.getId(), repoConfig.getName(), repoConfig.getLocation(),
162 repoConfig.getLayout(), repoConfig.isSnapshots(), repoConfig.isReleases(),
163 repoConfig.isBlockRedeployments(), repoConfig.getRefreshCronExpression(),
164 repoConfig.getIndexDir(), repoConfig.isScanned(), repoConfig.getDaysOlder(),
165 repoConfig.getRetentionCount(), repoConfig.isDeleteReleasedSnapshots(),
166 repoConfig.isStageRepoNeeded() );
167 repo.setDescription( repoConfig.getDescription() );
168 repo.setSkipPackedIndexCreation( repoConfig.isSkipPackedIndexCreation() );
169 managedRepos.add( repo );
176 public Map<String, ManagedRepository> getManagedRepositoriesAsMap()
177 throws RepositoryAdminException
179 List<ManagedRepository> managedRepositories = getManagedRepositories();
180 Map<String, ManagedRepository> repositoriesMap = new HashMap<>( managedRepositories.size() );
181 for ( ManagedRepository managedRepository : managedRepositories )
183 repositoriesMap.put( managedRepository.getId(), managedRepository );
185 return repositoriesMap;
189 public ManagedRepository getManagedRepository( String repositoryId )
190 throws RepositoryAdminException
192 List<ManagedRepository> repos = getManagedRepositories();
193 for ( ManagedRepository repo : repos )
195 if ( StringUtils.equals( repo.getId(), repositoryId ) )
204 public Boolean addManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
205 AuditInformation auditInformation )
206 throws RepositoryAdminException
209 getRepositoryCommonValidator().basicValidation( managedRepository, false );
210 getRepositoryCommonValidator().validateManagedRepository( managedRepository );
211 triggerAuditEvent( managedRepository.getId(), null, AuditEvent.ADD_MANAGED_REPO, auditInformation );
213 addManagedRepository( managedRepository.getId(), managedRepository.getLayout(), managedRepository.getName(),
214 managedRepository.getLocation(), managedRepository.isBlockRedeployments(),
215 managedRepository.isReleases(), managedRepository.isSnapshots(), needStageRepo,
216 managedRepository.getCronExpression(), managedRepository.getIndexDirectory(),
217 managedRepository.getDaysOlder(), managedRepository.getRetentionCount(),
218 managedRepository.isDeleteReleasedSnapshots(), managedRepository.getDescription(),
219 managedRepository.isSkipPackedIndexCreation(), managedRepository.isScanned(),
220 auditInformation, getArchivaConfiguration().getConfiguration() ) != null;
222 createIndexContext( managedRepository );
227 private ManagedRepositoryConfiguration addManagedRepository( String repoId, String layout, String name,
228 String location, boolean blockRedeployments,
229 boolean releasesIncluded, boolean snapshotsIncluded,
230 boolean stageRepoNeeded, String cronExpression,
231 String indexDir, int daysOlder, int retentionCount,
232 boolean deteleReleasedSnapshots, String description,
233 boolean skipPackedIndexCreation, boolean scanned,
234 AuditInformation auditInformation,
235 Configuration config )
236 throws RepositoryAdminException
239 ManagedRepositoryConfiguration repository = new ManagedRepositoryConfiguration();
241 repository.setId( repoId );
242 repository.setBlockRedeployments( blockRedeployments );
243 repository.setReleases( releasesIncluded );
244 repository.setSnapshots( snapshotsIncluded );
245 repository.setScanned( scanned );
246 repository.setName( name );
247 repository.setLocation( getRepositoryCommonValidator().removeExpressions( location ) );
248 repository.setLayout( layout );
249 repository.setRefreshCronExpression( cronExpression );
250 repository.setIndexDir( indexDir );
251 repository.setDaysOlder( daysOlder );
252 repository.setRetentionCount( retentionCount );
253 repository.setDeleteReleasedSnapshots( deteleReleasedSnapshots );
254 repository.setIndexDir( indexDir );
255 repository.setDescription( description );
256 repository.setSkipPackedIndexCreation( skipPackedIndexCreation );
257 repository.setStageRepoNeeded( stageRepoNeeded );
261 addRepository( repository, config );
262 addRepositoryRoles( repository.getId() );
264 if ( stageRepoNeeded )
266 ManagedRepositoryConfiguration stagingRepository = getStageRepoConfig( repository );
267 addRepository( stagingRepository, config );
268 addRepositoryRoles( stagingRepository.getId() );
269 triggerAuditEvent( stagingRepository.getId(), null, AuditEvent.ADD_MANAGED_REPO, auditInformation );
272 catch ( RoleManagerException e )
274 throw new RepositoryAdminException( "failed to add repository roles " + e.getMessage(), e );
276 catch ( IOException e )
278 throw new RepositoryAdminException( "failed to add repository " + e.getMessage(), e );
281 saveConfiguration( config );
283 //MRM-1342 Repository statistics report doesn't appear to be working correctly
284 //scan repository when adding of repository is successful
289 scanRepository( repoId, true );
292 // TODO need a better to define scanning or not for staged repo
293 if ( stageRepoNeeded && scanned )
295 ManagedRepositoryConfiguration stagingRepository = getStageRepoConfig( repository );
296 scanRepository( stagingRepository.getId(), true );
299 catch ( Exception e )
301 log.warn( new StringBuilder( "Unable to scan repository [" ).append( repoId ).append( "]: " ).append(
302 e.getMessage() ).toString(), e );
309 public Boolean deleteManagedRepository( String repositoryId, AuditInformation auditInformation,
310 boolean deleteContent )
311 throws RepositoryAdminException
313 Configuration config = getArchivaConfiguration().getConfiguration();
315 ManagedRepositoryConfiguration repository = config.findManagedRepositoryById( repositoryId );
317 if ( repository == null )
319 throw new RepositoryAdminException( "A repository with that id does not exist" );
322 triggerAuditEvent( repositoryId, null, AuditEvent.DELETE_MANAGED_REPO, auditInformation );
324 deleteManagedRepository( repository, deleteContent, config, false );
326 // stage repo exists ?
327 ManagedRepositoryConfiguration stagingRepository =
328 getArchivaConfiguration().getConfiguration().findManagedRepositoryById( repositoryId + STAGE_REPO_ID_END );
329 if ( stagingRepository != null )
331 // do not trigger event when deleting the staged one
332 deleteManagedRepository( stagingRepository, deleteContent, config, true );
337 saveConfiguration( config );
339 catch ( Exception e )
341 throw new RepositoryAdminException( "Error saving configuration for delete action" + e.getMessage(), e );
347 private Boolean deleteManagedRepository( ManagedRepositoryConfiguration repository, boolean deleteContent,
348 Configuration config, boolean stagedOne )
349 throws RepositoryAdminException
354 IndexingContext context = indexer.getIndexingContexts().get( repository.getId() );
355 if ( context != null )
357 // delete content only if directory exists
358 indexer.removeIndexingContext( context,
359 deleteContent && context.getIndexDirectoryFile().exists() );
362 catch ( IOException e )
364 throw new RepositoryAdminException( e.getMessage(), e );
368 RepositorySession repositorySession = getRepositorySessionFactory().createSession();
371 MetadataRepository metadataRepository = repositorySession.getRepository();
372 metadataRepository.removeRepository( repository.getId() );
374 namespacesCache.remove( repository.getId() );
375 log.debug( "call repositoryStatisticsManager.deleteStatistics" );
376 getRepositoryStatisticsManager().deleteStatistics( metadataRepository, repository.getId() );
377 repositorySession.save();
379 catch ( MetadataRepositoryException e )
381 //throw new RepositoryAdminException( e.getMessage(), e );
382 log.warn( "skip error during removing repository from MetadataRepository:{}", e.getMessage(), e );
386 repositorySession.close();
389 config.removeManagedRepository( repository );
393 // TODO could be async ? as directory can be huge
394 File dir = new File( repository.getLocation() );
395 if ( !FileUtils.deleteQuietly( dir ) )
397 throw new RepositoryAdminException( "Cannot delete repository " + dir );
401 // olamy: copy list for reading as a unit test in webapp fail with ConcurrentModificationException
402 List<ProxyConnectorConfiguration> proxyConnectors = new ArrayList<>( config.getProxyConnectors() );
403 for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors )
405 if ( StringUtils.equals( proxyConnector.getSourceRepoId(), repository.getId() ) )
407 config.removeProxyConnector( proxyConnector );
411 Map<String, List<String>> repoToGroupMap = config.getRepositoryToGroupMap();
412 if ( repoToGroupMap != null )
414 if ( repoToGroupMap.containsKey( repository.getId() ) )
416 List<String> repoGroups = repoToGroupMap.get( repository.getId() );
417 for ( String repoGroup : repoGroups )
419 // copy to prevent UnsupportedOperationException
420 RepositoryGroupConfiguration repositoryGroupConfiguration =
421 config.findRepositoryGroupById( repoGroup );
422 List<String> repos = new ArrayList<>( repositoryGroupConfiguration.getRepositories() );
423 config.removeRepositoryGroup( repositoryGroupConfiguration );
424 repos.remove( repository.getId() );
425 repositoryGroupConfiguration.setRepositories( repos );
426 config.addRepositoryGroup( repositoryGroupConfiguration );
433 removeRepositoryRoles( repository );
435 catch ( RoleManagerException e )
437 throw new RepositoryAdminException(
438 "fail to remove repository roles for repository " + repository.getId() + " : " + e.getMessage(), e );
441 saveConfiguration( config );
448 public Boolean updateManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
449 AuditInformation auditInformation, boolean resetStats )
450 throws RepositoryAdminException
453 log.debug( "updateManagedConfiguration repo {} needStage {} resetStats {} ", managedRepository, needStageRepo,
456 // Ensure that the fields are valid.
458 getRepositoryCommonValidator().basicValidation( managedRepository, true );
460 getRepositoryCommonValidator().validateManagedRepository( managedRepository );
462 Configuration configuration = getArchivaConfiguration().getConfiguration();
464 ManagedRepositoryConfiguration toremove = configuration.findManagedRepositoryById( managedRepository.getId() );
466 boolean updateIndexContext = false;
468 if ( toremove != null )
470 configuration.removeManagedRepository( toremove );
472 updateIndexContext = !StringUtils.equals( toremove.getIndexDir(), managedRepository.getIndexDirectory() );
475 ManagedRepositoryConfiguration stagingRepository = getStageRepoConfig( toremove );
477 // TODO remove content from old if path has changed !!!!!
479 if ( stagingRepository != null )
481 configuration.removeManagedRepository( stagingRepository );
484 ManagedRepositoryConfiguration managedRepositoryConfiguration =
485 addManagedRepository( managedRepository.getId(), managedRepository.getLayout(), managedRepository.getName(),
486 managedRepository.getLocation(), managedRepository.isBlockRedeployments(),
487 managedRepository.isReleases(), managedRepository.isSnapshots(), needStageRepo,
488 managedRepository.getCronExpression(), managedRepository.getIndexDirectory(),
489 managedRepository.getDaysOlder(), managedRepository.getRetentionCount(),
490 managedRepository.isDeleteReleasedSnapshots(), managedRepository.getDescription(),
491 managedRepository.isSkipPackedIndexCreation(), managedRepository.isScanned(),
492 auditInformation, getArchivaConfiguration().getConfiguration() );
494 // Save the repository configuration.
495 RepositorySession repositorySession = getRepositorySessionFactory().createSession();
499 triggerAuditEvent( managedRepositoryConfiguration.getId(), null, AuditEvent.MODIFY_MANAGED_REPO,
502 saveConfiguration( this.getArchivaConfiguration().getConfiguration() );
505 log.debug( "call repositoryStatisticsManager.deleteStatistics" );
506 getRepositoryStatisticsManager().deleteStatistics( repositorySession.getRepository(),
507 managedRepositoryConfiguration.getId() );
508 repositorySession.save();
512 catch ( MetadataRepositoryException e )
514 throw new RepositoryAdminException( e.getMessage(), e );
518 repositorySession.close();
521 if ( updateIndexContext )
525 IndexingContext indexingContext = indexer.getIndexingContexts().get( managedRepository.getId() );
526 if ( indexingContext != null )
528 indexer.removeIndexingContext( indexingContext, true );
531 // delete directory too as only content is deleted
532 File indexDirectory = indexingContext.getIndexDirectoryFile();
533 FileUtils.deleteDirectory( indexDirectory );
535 createIndexContext( managedRepository );
537 catch ( IOException e )
539 throw new RepositoryAdminException( e.getMessage(), e );
546 //--------------------------
548 //--------------------------
551 protected void addRepository( ManagedRepositoryConfiguration repository, Configuration configuration )
552 throws RepositoryAdminException, IOException
554 // Normalize the path
555 File file = new File( repository.getLocation() );
556 if ( !file.isAbsolute() )
558 // add appserver.base/repositories
559 file = new File( getRegistry().getString( "appserver.base" ) + File.separatorChar + "repositories",
560 repository.getLocation() );
562 repository.setLocation( file.getCanonicalPath() );
563 if ( !file.exists() )
567 if ( !file.exists() || !file.isDirectory() )
569 throw new RepositoryAdminException(
570 "Unable to add repository - no write access, can not create the root directory: " + file );
573 configuration.addManagedRepository( repository );
578 public IndexingContext createIndexContext( ManagedRepository repository )
579 throws RepositoryAdminException
582 IndexingContext context = indexer.getIndexingContexts().get( repository.getId() );
584 if ( context != null )
586 log.debug( "skip creating repository indexingContent with id {} as already exists", repository.getId() );
590 // take care first about repository location as can be relative
591 File repositoryDirectory = new File( repository.getLocation() );
593 if ( !repositoryDirectory.isAbsolute() )
595 repositoryDirectory =
596 new File( getRegistry().getString( "appserver.base" ) + File.separatorChar + "repositories",
597 repository.getLocation() );
600 if ( !repositoryDirectory.exists() )
602 repositoryDirectory.mkdirs();
608 String indexDir = repository.getIndexDirectory();
609 //File managedRepository = new File( repository.getLocation() );
611 File indexDirectory = null;
612 if ( StringUtils.isNotBlank( indexDir ) )
614 indexDirectory = new File( repository.getIndexDirectory() );
615 // not absolute so create it in repository directory
616 if ( !indexDirectory.isAbsolute() )
618 indexDirectory = new File( repositoryDirectory, repository.getIndexDirectory() );
620 repository.setIndexDirectory( indexDirectory.getAbsolutePath() );
624 indexDirectory = new File( repositoryDirectory, ".indexer" );
625 if ( !repositoryDirectory.isAbsolute() )
627 indexDirectory = new File( repositoryDirectory, ".indexer" );
629 repository.setIndexDirectory( indexDirectory.getAbsolutePath() );
632 if ( !indexDirectory.exists() )
634 indexDirectory.mkdirs();
637 context = indexer.getIndexingContexts().get( repository.getId() );
639 if ( context == null )
641 context = indexer.addIndexingContext( repository.getId(), repository.getId(), repositoryDirectory,
643 repositoryDirectory.toURI().toURL().toExternalForm(),
644 indexDirectory.toURI().toURL().toString(), indexCreators );
646 context.setSearchable( repository.isScanned() );
650 catch ( MalformedURLException e )
652 throw new RepositoryAdminException( e.getMessage(), e );
654 catch ( IOException e )
656 throw new RepositoryAdminException( e.getMessage(), e );
658 catch ( UnsupportedExistingLuceneIndexException e )
660 throw new RepositoryAdminException( e.getMessage(), e );
664 private ManagedRepositoryConfiguration getStageRepoConfig( ManagedRepositoryConfiguration repository )
666 ManagedRepositoryConfiguration stagingRepository = new ManagedRepositoryConfiguration();
667 stagingRepository.setId( repository.getId() + STAGE_REPO_ID_END );
668 stagingRepository.setLayout( repository.getLayout() );
669 stagingRepository.setName( repository.getName() + STAGE_REPO_ID_END );
670 stagingRepository.setBlockRedeployments( repository.isBlockRedeployments() );
671 stagingRepository.setDaysOlder( repository.getDaysOlder() );
672 stagingRepository.setDeleteReleasedSnapshots( repository.isDeleteReleasedSnapshots() );
674 String path = repository.getLocation();
675 int lastIndex = path.replace( '\\', '/' ).lastIndexOf( '/' );
676 stagingRepository.setLocation( path.substring( 0, lastIndex ) + "/" + stagingRepository.getId() );
678 if ( StringUtils.isNotBlank( repository.getIndexDir() ) )
680 File indexDir = new File( repository.getIndexDir() );
681 // in case of absolute dir do not use the same
682 if ( indexDir.isAbsolute() )
684 stagingRepository.setIndexDir( stagingRepository.getLocation() + "/.index" );
688 stagingRepository.setIndexDir( repository.getIndexDir() );
691 stagingRepository.setRefreshCronExpression( repository.getRefreshCronExpression() );
692 stagingRepository.setReleases( repository.isReleases() );
693 stagingRepository.setRetentionCount( repository.getRetentionCount() );
694 stagingRepository.setScanned( repository.isScanned() );
695 stagingRepository.setSnapshots( repository.isSnapshots() );
696 stagingRepository.setSkipPackedIndexCreation( repository.isSkipPackedIndexCreation() );
697 // do not duplicate description
698 //stagingRepository.getDescription("")
699 return stagingRepository;
702 public Boolean scanRepository( String repositoryId, boolean fullScan )
704 if ( getRepositoryTaskScheduler().isProcessingRepositoryTask( repositoryId ) )
706 log.info( "scanning of repository with id {} already scheduled", repositoryId );
708 RepositoryTask task = new RepositoryTask();
709 task.setRepositoryId( repositoryId );
710 task.setScanAll( fullScan );
713 getRepositoryTaskScheduler().queueTask( task );
715 catch ( TaskQueueException e )
717 log.error( "failed to schedule scanning of repo with id {}", repositoryId, e );
724 private void addRepositoryRoles( String repoId )
725 throws RoleManagerException
727 // TODO: double check these are configured on start up
728 // TODO: belongs in the business logic
730 if ( !getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) )
732 getRoleManager().createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId );
735 if ( !getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) )
737 getRoleManager().createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId );
741 protected void removeRepositoryRoles( ManagedRepositoryConfiguration existingRepository )
742 throws RoleManagerException
744 String repoId = existingRepository.getId();
746 if ( getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) )
748 getRoleManager().removeTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId );
751 if ( getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) )
753 getRoleManager().removeTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId );
756 log.debug( "removed user roles associated with repository {}", repoId );
759 //--------------------------
761 //--------------------------
764 public RoleManager getRoleManager()
769 public void setRoleManager( RoleManager roleManager )
771 this.roleManager = roleManager;
774 public RepositoryStatisticsManager getRepositoryStatisticsManager()
776 return repositoryStatisticsManager;
779 public void setRepositoryStatisticsManager( RepositoryStatisticsManager repositoryStatisticsManager )
781 this.repositoryStatisticsManager = repositoryStatisticsManager;
784 public RepositorySessionFactory getRepositorySessionFactory()
786 return repositorySessionFactory;
789 public void setRepositorySessionFactory( RepositorySessionFactory repositorySessionFactory )
791 this.repositorySessionFactory = repositorySessionFactory;
795 public RepositoryArchivaTaskScheduler getRepositoryTaskScheduler()
797 return repositoryTaskScheduler;
800 public void setRepositoryTaskScheduler( RepositoryArchivaTaskScheduler repositoryTaskScheduler )
802 this.repositoryTaskScheduler = repositoryTaskScheduler;
805 public NexusIndexer getIndexer()
810 public void setIndexer( NexusIndexer indexer )
812 this.indexer = indexer;
815 public List<? extends IndexCreator> getIndexCreators()
817 return indexCreators;
820 public void setIndexCreators( List<? extends IndexCreator> indexCreators )
822 this.indexCreators = indexCreators;