001package org.apache.archiva.repository.features; 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 022 023import org.apache.archiva.repository.ManagedRepository; 024 025/** 026 * This feature provides some information about staging repositories. 027 * 028 */ 029public class StagingRepositoryFeature implements RepositoryFeature<StagingRepositoryFeature> { 030 031 public static final String STAGING_REPO_POSTFIX = "-stage"; 032 033 private ManagedRepository stagingRepository = null; 034 private boolean stageRepoNeeded = false; 035 036 public StagingRepositoryFeature() { 037 038 } 039 040 public StagingRepositoryFeature(ManagedRepository stagingRepository, boolean stageRepoNeeded) { 041 this.stagingRepository = stagingRepository; 042 this.stageRepoNeeded = stageRepoNeeded; 043 } 044 045 @Override 046 public StagingRepositoryFeature get() { 047 return this; 048 } 049 050 /** 051 * Returns the staging repository, if it exists. 052 * 053 * @return The staging repository, null if not set. 054 * 055 */ 056 public ManagedRepository getStagingRepository() { 057 return stagingRepository; 058 } 059 060 /** 061 * Sets the staging repository. 062 * 063 * @param stagingRepository 064 */ 065 public void setStagingRepository(ManagedRepository stagingRepository) { 066 this.stagingRepository = stagingRepository; 067 } 068 069 /** 070 * Returns true, if a staging repository is needed by this repository. 071 * @return True, if staging repository is needed, otherwise false. 072 */ 073 public boolean isStageRepoNeeded() { 074 return stageRepoNeeded; 075 } 076 077 /** 078 * Sets the flag for needed staging repository. 079 * 080 * @param stageRepoNeeded 081 */ 082 public void setStageRepoNeeded(boolean stageRepoNeeded) { 083 this.stageRepoNeeded = stageRepoNeeded; 084 } 085}