]> source.dussan.org Git - archiva.git/blob
7a8a98291107dfbc671545126c83e45846d71a1c
[archiva.git] /
1 package org.apache.archiva.admin.repository.managed;
2 /*
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
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
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
18  * under the License.
19  */
20
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.components.cache.Cache;
27 import org.apache.archiva.components.taskqueue.TaskQueueException;
28 import org.apache.archiva.configuration.Configuration;
29 import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
30 import org.apache.archiva.configuration.ProxyConnectorConfiguration;
31 import org.apache.archiva.indexer.ArchivaIndexManager;
32 import org.apache.archiva.indexer.IndexManagerFactory;
33 import org.apache.archiva.indexer.IndexUpdateFailedException;
34 import org.apache.archiva.metadata.model.facets.AuditEvent;
35 import org.apache.archiva.metadata.repository.MetadataRepository;
36 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
37 import org.apache.archiva.metadata.repository.MetadataSessionException;
38 import org.apache.archiva.metadata.repository.RepositorySession;
39 import org.apache.archiva.metadata.repository.RepositorySessionFactory;
40 import org.apache.archiva.metadata.repository.stats.model.RepositoryStatisticsManager;
41 import org.apache.archiva.redback.role.RoleManager;
42 import org.apache.archiva.redback.role.RoleManagerException;
43 import org.apache.archiva.repository.ReleaseScheme;
44 import org.apache.archiva.repository.RepositoryException;
45 import org.apache.archiva.repository.RepositoryRegistry;
46 import org.apache.archiva.repository.base.RepositoryHandlerDependencies;
47 import org.apache.archiva.repository.features.ArtifactCleanupFeature;
48 import org.apache.archiva.repository.features.IndexCreationFeature;
49 import org.apache.archiva.repository.features.StagingRepositoryFeature;
50 import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
51 import org.apache.archiva.scheduler.repository.model.RepositoryTask;
52 import org.apache.archiva.security.common.ArchivaRoleConstants;
53 import org.apache.commons.lang3.StringUtils;
54 import org.slf4j.Logger;
55 import org.slf4j.LoggerFactory;
56 import org.springframework.stereotype.Service;
57
58 import javax.annotation.PostConstruct;
59 import javax.annotation.PreDestroy;
60 import javax.inject.Inject;
61 import javax.inject.Named;
62 import java.io.IOException;
63 import java.nio.file.Path;
64 import java.nio.file.Paths;
65 import java.util.ArrayList;
66 import java.util.Collection;
67 import java.util.List;
68 import java.util.Map;
69 import java.util.stream.Collectors;
70
71 /**
72  * FIXME review the staging mechanism to have a per user session one
73  *
74  * @author Olivier Lamy
75  */
76 @Service("managedRepositoryAdmin#default")
77 public class DefaultManagedRepositoryAdmin
78     extends AbstractRepositoryAdmin
79     implements ManagedRepositoryAdmin
80 {
81
82     private Logger log = LoggerFactory.getLogger( getClass() );
83
84     public static final String STAGE_REPO_ID_END = "-stage";
85
86
87     @Inject
88     private RepositoryRegistry repositoryRegistry;
89
90     @SuppressWarnings( "unused" )
91     @Inject
92     private RepositoryHandlerDependencies managedRepositoryHandler;
93
94     @Inject
95     @Named(value = "archivaTaskScheduler#repository")
96     private RepositoryArchivaTaskScheduler repositoryTaskScheduler;
97
98     /**
99      * FIXME: this could be multiple implementations and needs to be configured.
100      */
101     @Inject
102     private RepositorySessionFactory repositorySessionFactory;
103
104     @Inject
105     private RepositoryStatisticsManager repositoryStatisticsManager;
106
107     @Inject
108     protected RoleManager roleManager;
109
110     @Inject
111     @Named(value = "cache#namespaces")
112     private Cache<String, List<String>> namespacesCache;
113
114     @Inject
115     private IndexManagerFactory indexManagerFactory;
116
117
118
119
120     @PostConstruct
121     public void initialize()
122         throws RepositoryAdminException, RoleManagerException
123     {
124         // initialize index context on start and check roles here
125         for ( ManagedRepository managedRepository : getManagedRepositories() )
126         {
127             log.debug("Initializating {}", managedRepository.getId());
128             addRepositoryRoles( managedRepository.getId() );
129
130         }
131     }
132
133     @PreDestroy
134     public void shutdown()
135         throws RepositoryAdminException
136     {
137     }
138
139     /*
140      * Conversion between the repository from the registry and the serialized DTO for the admin API
141      */
142     private ManagedRepository convertRepo( org.apache.archiva.repository.ManagedRepository repo ) {
143         if (repo==null) {
144             return null;
145         }
146         ManagedRepository adminRepo = new ManagedRepository( getArchivaConfiguration().getDefaultLocale() );
147         setBaseRepoAttributes( adminRepo, repo );
148         adminRepo.setLocation( convertUriToString( repo.getLocation()) );
149         adminRepo.setReleases(repo.getActiveReleaseSchemes().contains( ReleaseScheme.RELEASE ));
150         adminRepo.setSnapshots( repo.getActiveReleaseSchemes().contains(ReleaseScheme.SNAPSHOT) );
151         adminRepo.setBlockRedeployments( repo.blocksRedeployments() );
152         adminRepo.setCronExpression( repo.getSchedulingDefinition() );
153         if (repo.supportsFeature( IndexCreationFeature.class )) {
154             IndexCreationFeature icf = repo.getFeature( IndexCreationFeature.class ).get();
155             adminRepo.setSkipPackedIndexCreation( icf.isSkipPackedIndexCreation() );
156         }
157         adminRepo.setScanned( repo.isScanned() );
158         if (repo.supportsFeature( ArtifactCleanupFeature.class) ) {
159             ArtifactCleanupFeature acf = repo.getFeature( ArtifactCleanupFeature.class ).get();
160             adminRepo.setRetentionPeriod( acf.getRetentionPeriod().getDays() );
161             adminRepo.setRetentionCount( acf.getRetentionCount() );
162             adminRepo.setDeleteReleasedSnapshots( acf.isDeleteReleasedSnapshots() );
163
164         }
165         if (repo.supportsFeature( StagingRepositoryFeature.class )) {
166             StagingRepositoryFeature stf = repo.getFeature( StagingRepositoryFeature.class ).get();
167             adminRepo.setStageRepoNeeded( stf.isStageRepoNeeded() );
168             if (stf.getStagingRepository()!=null) {
169                 adminRepo.setStagingRepository( convertRepo( stf.getStagingRepository() ) );
170             }
171         }
172         return adminRepo;
173     }
174
175     private ManagedRepositoryConfiguration getRepositoryConfiguration(ManagedRepository repo) {
176         ManagedRepositoryConfiguration repoConfig = new ManagedRepositoryConfiguration();
177         setBaseRepoAttributes( repoConfig, repo );
178         repoConfig.setBlockRedeployments( repo.isBlockRedeployments( ) );
179         repoConfig.setReleases( repo.isReleases() );
180         repoConfig.setSnapshots( repo.isSnapshots() );
181         repoConfig.setScanned( repo.isScanned() );
182         repoConfig.setLocation( getRepositoryCommonValidator().removeExpressions( repo.getLocation() ) );
183         repoConfig.setRefreshCronExpression( repo.getCronExpression() );
184         repoConfig.setRetentionPeriod( repo.getRetentionPeriod() );
185         repoConfig.setRetentionCount( repo.getRetentionCount());
186         repoConfig.setDeleteReleasedSnapshots( repo.isDeleteReleasedSnapshots() );
187         repoConfig.setSkipPackedIndexCreation( repo.isSkipPackedIndexCreation());
188         repoConfig.setStageRepoNeeded( repo.isStageRepoNeeded() );
189
190         return repoConfig;
191     }
192
193     @Override
194     public List<ManagedRepository> getManagedRepositories()
195         throws RepositoryAdminException
196     {
197
198         return repositoryRegistry.getManagedRepositories().stream().map( rep -> this.convertRepo( rep ) ).collect( Collectors.toList());
199     }
200
201     @Override
202     public Map<String, ManagedRepository> getManagedRepositoriesAsMap()
203         throws RepositoryAdminException
204     {
205         return repositoryRegistry.getManagedRepositories().stream().collect( Collectors.toMap( e -> e.getId(), e -> convertRepo( e ) ) );
206     }
207
208     @Override
209     public ManagedRepository getManagedRepository( String repositoryId )
210         throws RepositoryAdminException
211     {
212         return convertRepo( repositoryRegistry.getManagedRepository( repositoryId ) );
213     }
214
215     @Override
216     public Boolean addManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
217                                          AuditInformation auditInformation )
218         throws RepositoryAdminException
219     {
220         log.debug("addManagedRepository {}, {}, {}", managedRepository.getId(), needStageRepo, auditInformation);
221
222         getRepositoryCommonValidator().basicValidation( managedRepository, false );
223         getRepositoryCommonValidator().validateManagedRepository( managedRepository );
224         triggerAuditEvent( managedRepository.getId(), null, AuditEvent.ADD_MANAGED_REPO, auditInformation );
225         ManagedRepositoryConfiguration repoConfig = getRepositoryConfiguration( managedRepository );
226         if (needStageRepo) {
227             repoConfig.setStageRepoNeeded( true );
228         }
229         Configuration configuration = getArchivaConfiguration().getConfiguration();
230         try
231         {
232             org.apache.archiva.repository.ManagedRepository newRepo = repositoryRegistry.putRepository( repoConfig );
233             log.debug("Added new repository {}", newRepo.getId());
234             addRepositoryRoles( newRepo.getId() );
235             //MRM-1342 Repository statistics report doesn't appear to be working correctly
236             //scan repository when adding of repository is successful
237             try
238             {
239                 if ( newRepo.isScanned())
240                 {
241                     scanRepository( newRepo.getId(), true );
242                 }
243
244                 org.apache.archiva.repository.ManagedRepository stagingRepo = newRepo.getFeature( StagingRepositoryFeature.class ).get( ).getStagingRepository( );
245                 if ( stagingRepo!=null)
246                 {
247                     if (stagingRepo.isScanned()) {
248                         scanRepository( stagingRepo.getId(), true );
249                     }
250                     addRepositoryRoles( stagingRepo.getId( ) );
251                 }
252             }
253             catch ( Exception e )
254             {
255                 log.warn("Unable to scan repository [{}]: {}", newRepo.getId(), e.getMessage(), e);
256             }
257         }
258         catch ( RepositoryException e )
259         {
260             log.error("Could not add managed repository {}"+managedRepository);
261             throw new RepositoryAdminException( "Could not add repository "+e.getMessage() );
262         }
263         catch ( RoleManagerException e )
264         {
265             log.error("Could not add repository roles for repository [{}]: {}", managedRepository.getId(), e.getMessage(), e);
266             throw new RepositoryAdminException( "Could not add roles to repository "+e.getMessage() );
267         }
268         return Boolean.TRUE;
269
270     }
271
272
273
274     @Override
275     public Boolean deleteManagedRepository( String repositoryId, AuditInformation auditInformation,
276                                             boolean deleteContent )
277         throws RepositoryAdminException
278     {
279         Configuration config = getArchivaConfiguration().getConfiguration();
280         ManagedRepositoryConfiguration repoConfig=config.findManagedRepositoryById( repositoryId );
281         if (repoConfig!=null) {
282
283             log.debug("Repo location " + repoConfig.getLocation());
284
285             org.apache.archiva.repository.ManagedRepository repo = repositoryRegistry.getManagedRepository(repositoryId);
286             org.apache.archiva.repository.ManagedRepository stagingRepository = null;
287             if (repo != null) {
288                 if (repo.supportsFeature(StagingRepositoryFeature.class)) {
289                     stagingRepository = repo.getFeature(StagingRepositoryFeature.class).get().getStagingRepository();
290                 }
291             } else {
292                 throw new RepositoryAdminException("A repository with that id does not exist");
293             }
294
295             triggerAuditEvent(repositoryId, null, AuditEvent.DELETE_MANAGED_REPO, auditInformation);
296             if (repoConfig != null) {
297                 deleteManagedRepository(repoConfig, deleteContent, config, false);
298             }
299
300
301             // stage repo exists ?
302             if (stagingRepository != null) {
303                 // do not trigger event when deleting the staged one
304                 ManagedRepositoryConfiguration stagingRepositoryConfig = config.findManagedRepositoryById(stagingRepository.getId());
305                 if (stagingRepositoryConfig != null) {
306                     deleteManagedRepository(stagingRepositoryConfig, deleteContent, config, true);
307                 }
308             }
309
310             try {
311                 saveConfiguration(config);
312             } catch (Exception e) {
313                 throw new RepositoryAdminException("Error saving configuration for delete action" + e.getMessage(), e);
314             }
315
316             return Boolean.TRUE;
317         } else {
318             return Boolean.FALSE;
319         }
320     }
321
322     private Boolean deleteManagedRepository( ManagedRepositoryConfiguration repository, boolean deleteContent,
323                                              Configuration config, boolean stagedOne )
324         throws RepositoryAdminException
325     {
326
327         if ( !stagedOne )
328         {
329             boolean success=false;
330             try(RepositorySession repositorySession = getRepositorySessionFactory().createSession())
331             {
332                 MetadataRepository metadataRepository = repositorySession.getRepository();
333                 metadataRepository.removeRepository(repositorySession , repository.getId() );
334                 //invalidate cache
335                 namespacesCache.remove( repository.getId() );
336                 repositorySession.save();
337                 success=true;
338             }
339             catch ( MetadataRepositoryException e )
340             {
341                 //throw new RepositoryAdminException( e.getMessage(), e );
342                 log.warn( "skip error during removing repository from MetadataRepository:{}", e.getMessage(), e );
343                 success = false;
344             } catch (MetadataSessionException e) {
345                 log.warn( "skip error during removing repository from MetadataRepository:{}", e.getMessage(), e );
346                 success = false;
347             }
348             if (success)
349             {
350                 log.debug( "call repositoryStatisticsManager.deleteStatistics" );
351                 try
352                 {
353                     getRepositoryStatisticsManager( ).deleteStatistics( repository.getId( ) );
354                 }
355                 catch ( MetadataRepositoryException e )
356                 {
357                     e.printStackTrace( );
358                 }
359             }
360
361         }
362
363
364         // olamy: copy list for reading as a unit test in webapp fail with ConcurrentModificationException
365         List<ProxyConnectorConfiguration> proxyConnectors = new ArrayList<>( config.getProxyConnectors() );
366         for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors )
367         {
368             if ( StringUtils.equals( proxyConnector.getSourceRepoId(), repository.getId() ) )
369             {
370                 config.removeProxyConnector( proxyConnector );
371             }
372         }
373         try
374         {
375             removeRepositoryRoles( repository );
376         }
377         catch ( RoleManagerException e )
378         {
379             throw new RepositoryAdminException(
380                 "fail to remove repository roles for repository " + repository.getId() + " : " + e.getMessage(), e );
381         }
382
383         try {
384             org.apache.archiva.repository.ManagedRepository repo = repositoryRegistry.getManagedRepository( repository.getId( ) );
385             if (repo!=null)
386             {
387                 repositoryRegistry.removeRepository( repo, config );
388                 if ( deleteContent )
389                 {
390                     // TODO could be async ? as directory can be huge
391                     Path dir = Paths.get( repository.getLocation( ) );
392                     org.apache.archiva.common.utils.FileUtils.deleteQuietly( dir );
393                 }
394             }
395         } catch (RepositoryException e) {
396             throw new RepositoryAdminException("Removal of repository "+repository.getId()+ " failed: "+e.getMessage());
397         }
398
399         saveConfiguration( config );
400
401
402         return Boolean.TRUE;
403     }
404
405     ArchivaIndexManager getIndexManager(ManagedRepository managedRepository) {
406         org.apache.archiva.repository.ManagedRepository repo = getRepositoryRegistry().getManagedRepository(managedRepository.getId());
407         return indexManagerFactory.getIndexManager(repo.getType());
408     }
409
410     @Override
411     public Boolean updateManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
412                                             AuditInformation auditInformation, boolean resetStats )
413         throws RepositoryAdminException
414     {
415
416         log.debug( "updateManagedConfiguration repo {} needStage {} resetStats {} ", managedRepository, needStageRepo,
417                    resetStats );
418
419         // Ensure that the fields are valid.
420
421         getRepositoryCommonValidator().basicValidation( managedRepository, true );
422
423         getRepositoryCommonValidator().validateManagedRepository( managedRepository );
424
425         ManagedRepositoryConfiguration updatedRepoConfig = getRepositoryConfiguration( managedRepository );
426         updatedRepoConfig.setStageRepoNeeded( needStageRepo );
427
428         org.apache.archiva.repository.ManagedRepository oldRepo = repositoryRegistry.getManagedRepository( managedRepository.getId( ) );
429         boolean stagingExists = false;
430         if (oldRepo.supportsFeature( StagingRepositoryFeature.class ) ){
431             stagingExists = oldRepo.getFeature( StagingRepositoryFeature.class ).get().getStagingRepository() != null;
432         }
433         boolean updateIndexContext = !StringUtils.equals( updatedRepoConfig.getIndexDir(), managedRepository.getIndexDirectory() );
434         org.apache.archiva.repository.ManagedRepository newRepo;
435         // TODO remove content from old if path has changed !!!!!
436         try
437         {
438             newRepo = repositoryRegistry.putRepository( updatedRepoConfig );
439             if (newRepo.supportsFeature( StagingRepositoryFeature.class )) {
440                 org.apache.archiva.repository.ManagedRepository stagingRepo = newRepo.getFeature( StagingRepositoryFeature.class ).get( ).getStagingRepository( );
441                 if (stagingRepo!=null && !stagingExists)
442                 {
443                     triggerAuditEvent( stagingRepo.getId(), null, AuditEvent.ADD_MANAGED_REPO, auditInformation );
444                     addRepositoryRoles( stagingRepo.getId( ) );
445                 }
446             }
447
448
449         }
450         catch ( RepositoryException e )
451         {
452             log.error("Could not update repository {}: {}", managedRepository.getId(), e.getMessage(), e);
453             throw new RepositoryAdminException( "Could not update repository "+managedRepository.getId());
454         }
455         catch ( RoleManagerException e ) {
456             log.error("Error during role update of stage repo {}", managedRepository.getId(), e);
457             throw new RepositoryAdminException( "Could not update repository "+managedRepository.getId());
458         }
459         triggerAuditEvent( managedRepository.getId(), null, AuditEvent.MODIFY_MANAGED_REPO,
460             auditInformation );
461         // Save the repository configuration.
462         RepositorySession repositorySession = null;
463         try
464         {
465             repositorySession = getRepositorySessionFactory().createSession();
466         }
467         catch ( MetadataRepositoryException e )
468         {
469             e.printStackTrace( );
470         }
471
472         try
473         {
474
475             if ( resetStats )
476             {
477                 log.debug( "call repositoryStatisticsManager.deleteStatistics" );
478                 getRepositoryStatisticsManager().deleteStatistics(
479                     managedRepository.getId() );
480                 repositorySession.save();
481             }
482
483         }
484         catch (MetadataRepositoryException | MetadataSessionException e )
485         {
486             throw new RepositoryAdminException( e.getMessage(), e );
487         }
488         finally
489         {
490             repositorySession.close();
491         }
492
493         if ( updateIndexContext )
494         {
495             try
496             {
497
498                 repositoryRegistry.resetIndexingContext(newRepo);
499             } catch (IndexUpdateFailedException e) {
500                 e.printStackTrace();
501             }
502         }
503
504         return true;
505     }
506
507     //--------------------------
508     // utils methods
509     //--------------------------
510
511
512     protected void addRepository( ManagedRepositoryConfiguration repository, Configuration configuration )
513         throws RepositoryAdminException, IOException
514     {
515         try
516         {
517             getRepositoryRegistry().putRepository( repository, configuration );
518         }
519         catch ( RepositoryException e )
520         {
521             throw new RepositoryAdminException( "Could not add the repository to the registry. Cause: "+e.getMessage() );
522         }
523
524     }
525
526
527     public Boolean scanRepository( String repositoryId, boolean fullScan )
528     {
529         if ( getRepositoryTaskScheduler().isProcessingRepositoryTask( repositoryId ) )
530         {
531             log.info( "scanning of repository with id {} already scheduled", repositoryId );
532         }
533         RepositoryTask task = new RepositoryTask();
534         task.setRepositoryId( repositoryId );
535         task.setScanAll( fullScan );
536         try
537         {
538             getRepositoryTaskScheduler().queueTask( task );
539         }
540         catch ( TaskQueueException e )
541         {
542             log.error( "failed to schedule scanning of repo with id {}", repositoryId, e );
543             return false;
544         }
545         return true;
546     }
547
548
549     private void addRepositoryRoles( String repoId )
550         throws RoleManagerException
551     {
552         // TODO: double check these are configured on start up
553         // TODO: belongs in the business logic
554
555         if ( !getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) )
556         {
557             getRoleManager().createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId );
558         }
559
560         if ( !getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) )
561         {
562             getRoleManager().createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId );
563         }
564     }
565
566     protected void removeRepositoryRoles( ManagedRepositoryConfiguration existingRepository )
567         throws RoleManagerException
568     {
569         String repoId = existingRepository.getId();
570
571         if ( getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) )
572         {
573             getRoleManager().removeTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId );
574         }
575
576         if ( getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) )
577         {
578             getRoleManager().removeTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId );
579         }
580
581         log.debug( "removed user roles associated with repository {}", repoId );
582     }
583
584     //--------------------------
585     // setters/getters
586     //--------------------------
587
588
589     public RoleManager getRoleManager()
590     {
591         return roleManager;
592     }
593
594     public void setRoleManager( RoleManager roleManager )
595     {
596         this.roleManager = roleManager;
597     }
598
599     public RepositoryStatisticsManager getRepositoryStatisticsManager()
600     {
601         return repositoryStatisticsManager;
602     }
603
604     public void setRepositoryStatisticsManager( RepositoryStatisticsManager repositoryStatisticsManager )
605     {
606         this.repositoryStatisticsManager = repositoryStatisticsManager;
607     }
608
609     public RepositorySessionFactory getRepositorySessionFactory()
610     {
611         return repositorySessionFactory;
612     }
613
614     public void setRepositorySessionFactory( RepositorySessionFactory repositorySessionFactory )
615     {
616         this.repositorySessionFactory = repositorySessionFactory;
617     }
618
619
620     public RepositoryArchivaTaskScheduler getRepositoryTaskScheduler()
621     {
622         return repositoryTaskScheduler;
623     }
624
625     public void setRepositoryTaskScheduler( RepositoryArchivaTaskScheduler repositoryTaskScheduler )
626     {
627         this.repositoryTaskScheduler = repositoryTaskScheduler;
628     }
629
630
631     public RepositoryRegistry getRepositoryRegistry( )
632     {
633         return repositoryRegistry;
634     }
635
636     public void setRepositoryRegistry( RepositoryRegistry repositoryRegistry )
637     {
638         this.repositoryRegistry = repositoryRegistry;
639     }
640 }