1 package org.apache.continuum.taskqueue.manager; 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.codehaus.plexus.taskqueue.TaskQueue;; 23 24 /** 25 * @author <a href="mailto:ctan@apache.org">Maria Catherine Tan</a> 26 */ 27 public interface TaskQueueManager 28 { 29 String ROLE = TaskQueueManager.class.getName(); 30 31 TaskQueue getPurgeQueue(); 32 33 boolean isInPurgeQueue( int purgeConfigurationId ) 34 throws TaskQueueManagerException; 35 36 /** 37 * Check if the repository is already in the purging queue 38 * 39 * @param repositoryId the id of the repository purge configuration 40 * @return true if the repository is in the purging queue, otherwise false 41 * @throws TaskQueueManagerException 42 */ 43 boolean isRepositoryInPurgeQueue( int repositoryId ) 44 throws TaskQueueManagerException; 45 46 /** 47 * Check if the repository is being used by a project that is currently building 48 * 49 * @param repositoryId the id of the local repository 50 * @return true if the repository is in use, otherwise false 51 * @throws TaskQueueManagerException 52 */ 53 boolean isRepositoryInUse( int repositoryId ) 54 throws TaskQueueManagerException; 55 56 /** 57 * Check whether a project is in the release stage based on the given releaseId. 58 * 59 * @param releaseId 60 * @return 61 * @throws TaskQueueManagerException 62 */ 63 boolean isProjectInReleaseStage( String releaseId ) 64 throws TaskQueueManagerException; 65 66 boolean releaseInProgress() 67 throws TaskQueueManagerException; 68 69 /** 70 * Remove local repository from the purge queue 71 * 72 * @param purgeConfigId the id of the purge configuration 73 * @return true if the purge configuration was successfully removed from the purge queue, otherwise false 74 * @throws TaskQueueManagerException 75 */ 76 boolean removeFromPurgeQueue( int purgeConfigId ) 77 throws TaskQueueManagerException; 78 79 /** 80 * Remove local repositories from the purge queue 81 * 82 * @param purgeConfigIds the ids of the purge configuration 83 * @return true if the purge configurations were successfully removed from the purge queue, otherwise false 84 * @throws TaskQueueManagerException 85 */ 86 boolean removeFromPurgeQueue( int[] purgeConfigIds ) 87 throws TaskQueueManagerException; 88 89 /** 90 * Remove local repository from the purge queue 91 * 92 * @param repositoryId the id of the local repository 93 * @throws TaskQueueManagerException 94 */ 95 void removeRepositoryFromPurgeQueue( int repositoryId ) 96 throws TaskQueueManagerException; 97 }