This project has retired. For details please refer to its Attic page.
Source code
001package org.apache.archiva.repository;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *  http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import org.apache.archiva.configuration.ArchivaConfiguration;
023import org.apache.archiva.configuration.Configuration;
024import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
025import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
026import org.apache.archiva.configuration.RepositoryGroupConfiguration;
027import org.apache.archiva.event.EventSource;
028import org.apache.archiva.indexer.ArchivaIndexManager;
029import org.apache.archiva.indexer.IndexUpdateFailedException;
030
031import java.util.Collection;
032
033/**
034 *  Registry for repositories. This is the central entry point for repositories. It provides methods for
035 *  retrieving, adding and removing repositories.
036 *  <p>
037 *  The modification methods addXX and removeXX persist the changes immediately to the configuration. If the
038 *  configuration save fails the changes are rolled back.
039 *  <p>
040 * @author Martin Stockhammer <martin_s@apache.org>
041 */
042public interface RepositoryRegistry extends EventSource
043{
044    void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration );
045
046    ArchivaIndexManager getIndexManager( RepositoryType type );
047
048    Collection<Repository> getRepositories( );
049
050    Collection<ManagedRepository> getManagedRepositories( );
051
052    Collection<RemoteRepository> getRemoteRepositories( );
053
054    Collection<RepositoryGroup> getRepositoryGroups( );
055
056    Repository getRepository( String repoId );
057
058    ManagedRepository getManagedRepository( String repoId );
059
060    RemoteRepository getRemoteRepository( String repoId );
061
062    RepositoryGroup getRepositoryGroup( String groupId );
063
064    ManagedRepository putRepository( ManagedRepository managedRepository ) throws RepositoryException;
065
066    ManagedRepository putRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration ) throws RepositoryException;
067
068    ManagedRepository putRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration, Configuration configuration ) throws RepositoryException;
069
070    RepositoryGroup putRepositoryGroup( RepositoryGroup repositoryGroup ) throws RepositoryException;
071
072    RepositoryGroup putRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration ) throws RepositoryException;
073
074    RepositoryGroup putRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration, Configuration configuration ) throws RepositoryException;
075
076    RemoteRepository putRepository( RemoteRepository remoteRepository, Configuration configuration ) throws RepositoryException;
077
078    RemoteRepository putRepository( RemoteRepository remoteRepository ) throws RepositoryException;
079
080    RemoteRepository putRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration ) throws RepositoryException;
081
082    RemoteRepository putRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration, Configuration configuration ) throws RepositoryException;
083
084    void removeRepository( String repoId ) throws RepositoryException;
085
086    void removeRepository( Repository repo ) throws RepositoryException;
087
088    void removeRepository( ManagedRepository managedRepository ) throws RepositoryException;
089
090    void removeRepository( ManagedRepository managedRepository, Configuration configuration ) throws RepositoryException;
091
092    void removeRepositoryGroup( RepositoryGroup repositoryGroup ) throws RepositoryException;
093
094    void removeRepositoryGroup( RepositoryGroup repositoryGroup, Configuration configuration ) throws RepositoryException;
095
096    void removeRepository( RemoteRepository remoteRepository ) throws RepositoryException;
097
098    void removeRepository( RemoteRepository remoteRepository, Configuration configuration ) throws RepositoryException;
099
100    void reload( );
101
102    void resetIndexingContext( Repository repository ) throws IndexUpdateFailedException;
103
104    ManagedRepository clone( ManagedRepository repo, String newId ) throws RepositoryException;
105
106    <T extends Repository> Repository clone( T repo, String newId ) throws RepositoryException;
107
108    RemoteRepository clone( RemoteRepository repo, String newId ) throws RepositoryException;
109}