View Javadoc

1   package org.apache.continuum.repository;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.List;
23  
24  import org.apache.continuum.model.repository.LocalRepository;
25  
26  /**
27   * @author Maria Catherine Tan
28   * @version $Id: RepositoryService.java 681492 2008-07-31 21:02:48Z olamy $
29   * @since 25 jul 07
30   */
31  public interface RepositoryService
32  {
33      String ROLE = RepositoryService.class.getName();
34      
35      // ------------------------------------------------------
36      //  LocalRepository
37      // ------------------------------------------------------
38      
39      /**
40       * Add the local repository
41       * 
42       * @param repository the local repository to add
43       * @return LocalRepository the local repository
44       * @throws RepositoryServiceException
45       */
46      LocalRepository addLocalRepository( LocalRepository repository )
47          throws RepositoryServiceException;
48  
49      /**
50       * Update the local repository
51       * 
52       * @param repository the local repository to update
53       * @throws RepositoryServiceException
54       */
55      void updateLocalRepository( LocalRepository repository )
56          throws RepositoryServiceException;
57  
58      /**
59       * Remove the local repository
60       * 
61       * @param repositoryId the id of the local repository to remove
62       * @throws RepositoryServiceException
63       */
64      void removeLocalRepository( int repositoryId )
65          throws RepositoryServiceException;
66  
67      /**
68       * Retrieve all local repositories
69       * 
70       * @return list of all local repositories
71       */
72      List<LocalRepository> getAllLocalRepositories();
73      
74      /**
75       * Retrieve local repository
76       * 
77       * @param location the system file path of the repository
78       * @return LocalRepository the local repository
79       * @throws RepositoryServiceException
80       */
81      LocalRepository getLocalRepositoryByLocation( String location )
82          throws RepositoryServiceException;
83      
84      /**
85       * Retrieve list of local repositories with the specified layout
86       * @param layout the layout of the repository. "default" or "legacy"
87       * @return List of local repositories
88       * @throws RepositoryServiceException
89       */
90      List<LocalRepository> getLocalRepositoriesByLayout( String layout );
91      
92      /**
93       * Retrieve local repository
94       * 
95       * @param repositoryId the id of the local repository
96       * @return LocalRepository the local repository
97       * @throws RepositoryServiceException
98       */
99      LocalRepository getLocalRepository( int repositoryId )
100         throws RepositoryServiceException;
101 }