001package org.apache.archiva.configuration; 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 java.io.Serializable; 023import java.util.ArrayList; 024import java.util.List; 025 026/** 027 * Class RepositoryGroupConfiguration. 028 * 029 * @version $Revision$ $Date$ 030 */ 031@SuppressWarnings( "all" ) 032public class RepositoryGroupConfiguration 033 implements Serializable 034{ 035 036 //--------------------------/ 037 //- Class/Member Variables -/ 038 //--------------------------/ 039 040 /** 041 * The id of the repository group. 042 */ 043 private String id; 044 045 /** 046 * The name of the repository group 047 */ 048 private String name; 049 050 /** 051 * 052 * The repository type. Currently only MAVEN type 053 * is known. 054 * 055 */ 056 private String type = "MAVEN"; 057 058 059 /** 060 * The path of the merged index. 061 */ 062 private String mergedIndexPath = ".indexer"; 063 064 /** 065 * The time to live of the merged index of the repository group. 066 */ 067 private int mergedIndexTtl = 30; 068 069 /** 070 * 071 * When to run the index merging for this group. 072 * 073 */ 074 private String cronExpression = ""; 075 076 /** 077 * Field repositories. 078 */ 079 private List<String> repositories; 080 081 082 //-----------/ 083 //- Methods -/ 084 //-----------/ 085 086 /** 087 * Method addRepository. 088 * 089 * @param string 090 */ 091 public void addRepository( String string ) 092 { 093 getRepositories().add( string ); 094 } //-- void addRepository( String ) 095 096 /** 097 * Get when to run the index merging for this group. 098 * No default value. 099 * 100 * @return String 101 */ 102 public String getCronExpression() 103 { 104 return this.cronExpression; 105 } //-- String getCronExpression() 106 107 /** 108 * Get the id of the repository group. 109 * 110 * @return String 111 */ 112 public String getId() 113 { 114 return this.id; 115 } //-- String getId() 116 117 /** 118 * Get the path of the merged index. 119 * 120 * @return String 121 */ 122 public String getMergedIndexPath() 123 { 124 return this.mergedIndexPath; 125 } //-- String getMergedIndexPath() 126 127 /** 128 * Get the time to live of the merged index of the repository 129 * group. 130 * 131 * @return int 132 */ 133 public int getMergedIndexTtl() 134 { 135 return this.mergedIndexTtl; 136 } //-- int getMergedIndexTtl() 137 138 /** 139 * Method getRepositories. 140 * 141 * @return List 142 */ 143 public List<String> getRepositories() 144 { 145 if ( this.repositories == null ) 146 { 147 this.repositories = new ArrayList<String>(); 148 } 149 150 return this.repositories; 151 } //-- java.util.List<String> getRepositories() 152 153 /** 154 * Method removeRepository. 155 * 156 * @param string 157 */ 158 public void removeRepository( String string ) 159 { 160 getRepositories().remove( string ); 161 } //-- void removeRepository( String ) 162 163 /** 164 * Set when to run the index merging for this group. 165 * No default value. 166 * 167 * @param cronExpression 168 */ 169 public void setCronExpression( String cronExpression ) 170 { 171 this.cronExpression = cronExpression; 172 } //-- void setCronExpression( String ) 173 174 /** 175 * Set the id of the repository group. 176 * 177 * @param id 178 */ 179 public void setId( String id ) 180 { 181 this.id = id; 182 } //-- void setId( String ) 183 184 /** 185 * Set the path of the merged index. 186 * 187 * @param mergedIndexPath 188 */ 189 public void setMergedIndexPath( String mergedIndexPath ) 190 { 191 this.mergedIndexPath = mergedIndexPath; 192 } //-- void setMergedIndexPath( String ) 193 194 /** 195 * Set the time to live of the merged index of the repository 196 * group. 197 * 198 * @param mergedIndexTtl 199 */ 200 public void setMergedIndexTtl( int mergedIndexTtl ) 201 { 202 this.mergedIndexTtl = mergedIndexTtl; 203 } //-- void setMergedIndexTtl( int ) 204 205 /** 206 * Set the list of repository ids under the group. 207 * 208 * @param repositories 209 */ 210 public void setRepositories( List<String> repositories ) 211 { 212 this.repositories = repositories; 213 } //-- void setRepositories( java.util.List ) 214 215 public String getName() { 216 return name; 217 } 218 219 public void setName(String name) { 220 this.name = name; 221 } 222 223 public String getType() { 224 return type; 225 } 226 227 public void setType(String type) { 228 this.type = type; 229 } 230}