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 org.apache.continuum.model.repository.LocalRepository; 23 24 import java.util.List; 25 26 /** 27 * @author Maria Catherine Tan 28 * @version $Id: RepositoryService.java 1372260 2012-08-13 04:29:09Z brett $ 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 * 87 * @param layout the layout of the repository. "default" or "legacy" 88 * @return List of local repositories 89 * @throws RepositoryServiceException 90 */ 91 List<LocalRepository> getLocalRepositoriesByLayout( String layout ); 92 93 /** 94 * Retrieve local repository 95 * 96 * @param repositoryId the id of the local repository 97 * @return LocalRepository the local repository 98 * @throws RepositoryServiceException 99 */ 100 LocalRepository getLocalRepository( int repositoryId ) 101 throws RepositoryServiceException; 102 103 /** 104 * Retrieve local repository 105 * 106 * @param repositoryName 107 * @return 108 * @throws RepositoryServiceException 109 */ 110 LocalRepository getLocalRepositoryByName( String repositoryName ) 111 throws RepositoryServiceException; 112 }