@Test public void getRepositories( ) throws Exception { Collection<Repository> repos = repositoryRegistry.getRepositories( ); assertEquals( 5, repos.size( ) ); assertTrue(repos.stream().anyMatch( rep -> rep.getId().equals("internal") )); assertTrue( repos.stream( ).anyMatch( rep -> rep.getId( ).equals( "snapshots") ) ); assertTrue(repos.stream().anyMatch( rep -> rep.getId().equals( "central") )); }
@Override public Collection<Repository> getRepositories( ) { rwLock.readLock().lock(); try { return Stream.concat(managedRepositories.values().stream(), remoteRepositories.values().stream()).collect(Collectors.toList()); } finally { rwLock.readLock().unlock(); } }
ArchivaRepositoryRegistry implements ConfigurationListener, EventHandler<Event>,
    RepositoryRegistry { @Override public Collection<Repository> getRepositories( ) { rwLock.readLock().lock(); try { return Stream.concat(managedRepositories.values().stream(), remoteRepositories.values().stream()).collect(Collectors.toList()); } finally { rwLock.readLock().unlock(); } } }
ArchivaRepositoryRegistry implements ConfigurationListener, EventHandler<Event>,
    RepositoryRegistry { @Override public Collection<Repository> getRepositories( ) { rwLock.readLock().lock(); try { return Stream.concat(managedRepositories.values().stream(), remoteRepositories.values().stream()).collect(Collectors.toList()); } finally { rwLock.readLock().unlock(); } } ArchivaRepositoryRegistry(); }
ArchivaRepositoryRegistry implements ConfigurationListener, EventHandler<Event>,
    RepositoryRegistry { @Override public Collection<Repository> getRepositories( ) { rwLock.readLock().lock(); try { return Stream.concat(managedRepositories.values().stream(), remoteRepositories.values().stream()).collect(Collectors.toList()); } finally { rwLock.readLock().unlock(); } } ArchivaRepositoryRegistry(); @Override void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ); @PreDestroy void destroy(); @Override ArchivaIndexManager getIndexManager( RepositoryType type ); @Override MetadataReader getMetadataReader( final RepositoryType type ); @Override Collection<Repository> getRepositories( ); @Override Collection<ManagedRepository> getManagedRepositories( ); @Override Collection<RemoteRepository> getRemoteRepositories( ); @Override Collection<RepositoryGroup> getRepositoryGroups( ); @Override Repository getRepository( String repoId ); @Override ManagedRepository getManagedRepository( String repoId ); @Override RemoteRepository getRemoteRepository( String repoId ); @Override RepositoryGroup getRepositoryGroup( String groupId ); @Override ManagedRepository putRepository( ManagedRepository managedRepository ); @Override ManagedRepository putRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration ); @Override ManagedRepository putRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration, Configuration configuration ); @Override RepositoryGroup putRepositoryGroup( RepositoryGroup repositoryGroup ); @Override RepositoryGroup putRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration ); @Override RepositoryGroup putRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration, Configuration configuration ); @Override RemoteRepository putRepository( RemoteRepository remoteRepository, Configuration configuration ); @Override RemoteRepository putRepository( RemoteRepository remoteRepository ); @Override RemoteRepository putRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration ); @Override @SuppressWarnings("unchecked") RemoteRepository putRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration, Configuration configuration ); @Override void removeRepository( String repoId ); @Override void removeRepository( Repository repo ); @Override void removeRepository( ManagedRepository managedRepository ); @Override void removeRepository( ManagedRepository managedRepository, Configuration configuration ); @Override void removeRepositoryGroup( RepositoryGroup repositoryGroup ); @Override void removeRepositoryGroup( RepositoryGroup repositoryGroup, Configuration configuration ); @Override void removeRepository( RemoteRepository remoteRepository ); @Override void removeRepository( RemoteRepository remoteRepository, Configuration configuration ); @Override void reload( ); @Override void resetIndexingContext( Repository repository ); @Override ManagedRepository clone( ManagedRepository repo, String newId ); @Override Repository clone( T repo, String newId ); @Override RemoteRepository clone( RemoteRepository repo, String newId ); @Override Repository getRepositoryOfAsset( StorageAsset asset ); @Override void configurationEvent(ConfigurationEvent event); @Override void registerEventHandler( EventType<T> type, EventHandler<? super T> eventHandler); @Override void unregisterEventHandler(EventType<T> type, EventHandler<? super T> eventHandler); @Override void handle(Event event); }
ArchivaRepositoryRegistry implements ConfigurationListener, EventHandler<Event>,
    RepositoryRegistry { @Override public Collection<Repository> getRepositories( ) { rwLock.readLock().lock(); try { return Stream.concat(managedRepositories.values().stream(), remoteRepositories.values().stream()).collect(Collectors.toList()); } finally { rwLock.readLock().unlock(); } } ArchivaRepositoryRegistry(); @Override void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ); @PreDestroy void destroy(); @Override ArchivaIndexManager getIndexManager( RepositoryType type ); @Override MetadataReader getMetadataReader( final RepositoryType type ); @Override Collection<Repository> getRepositories( ); @Override Collection<ManagedRepository> getManagedRepositories( ); @Override Collection<RemoteRepository> getRemoteRepositories( ); @Override Collection<RepositoryGroup> getRepositoryGroups( ); @Override Repository getRepository( String repoId ); @Override ManagedRepository getManagedRepository( String repoId ); @Override RemoteRepository getRemoteRepository( String repoId ); @Override RepositoryGroup getRepositoryGroup( String groupId ); @Override ManagedRepository putRepository( ManagedRepository managedRepository ); @Override ManagedRepository putRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration ); @Override ManagedRepository putRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration, Configuration configuration ); @Override RepositoryGroup putRepositoryGroup( RepositoryGroup repositoryGroup ); @Override RepositoryGroup putRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration ); @Override RepositoryGroup putRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration, Configuration configuration ); @Override RemoteRepository putRepository( RemoteRepository remoteRepository, Configuration configuration ); @Override RemoteRepository putRepository( RemoteRepository remoteRepository ); @Override RemoteRepository putRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration ); @Override @SuppressWarnings("unchecked") RemoteRepository putRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration, Configuration configuration ); @Override void removeRepository( String repoId ); @Override void removeRepository( Repository repo ); @Override void removeRepository( ManagedRepository managedRepository ); @Override void removeRepository( ManagedRepository managedRepository, Configuration configuration ); @Override void removeRepositoryGroup( RepositoryGroup repositoryGroup ); @Override void removeRepositoryGroup( RepositoryGroup repositoryGroup, Configuration configuration ); @Override void removeRepository( RemoteRepository remoteRepository ); @Override void removeRepository( RemoteRepository remoteRepository, Configuration configuration ); @Override void reload( ); @Override void resetIndexingContext( Repository repository ); @Override ManagedRepository clone( ManagedRepository repo, String newId ); @Override Repository clone( T repo, String newId ); @Override RemoteRepository clone( RemoteRepository repo, String newId ); @Override Repository getRepositoryOfAsset( StorageAsset asset ); @Override void configurationEvent(ConfigurationEvent event); @Override void registerEventHandler( EventType<T> type, EventHandler<? super T> eventHandler); @Override void unregisterEventHandler(EventType<T> type, EventHandler<? super T> eventHandler); @Override void handle(Event event);  }