1 package org.apache.archiva.indexer.merger;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
22 import java.util.Collection;
25 * @author Olivier Lamy
27 public class IndexMergerRequest
30 * repositories Ids to merge content
32 private Collection<String> repositoriesIds;
35 * will generate a downloadable index
37 private boolean packIndex;
40 * original groupId (repositoryGroup id)
42 private String groupId;
44 private String mergedIndexPath = "/.indexer";
46 private int mergedIndexTtl;
48 private File mergedIndexDirectory;
50 private boolean temporary;
52 public IndexMergerRequest( Collection<String> repositoriesIds, boolean packIndex, String groupId )
54 this.repositoriesIds = repositoriesIds;
55 this.packIndex = packIndex;
56 this.groupId = groupId;
62 public IndexMergerRequest( Collection<String> repositoriesIds, boolean packIndex, String groupId,
63 String mergedIndexPath, int mergedIndexTtl )
65 this.repositoriesIds = repositoriesIds;
66 this.packIndex = packIndex;
67 this.groupId = groupId;
68 this.mergedIndexPath = mergedIndexPath;
69 this.mergedIndexTtl = mergedIndexTtl;
72 public Collection<String> getRepositoriesIds()
74 return repositoriesIds;
77 public void setRepositoriesIds( Collection<String> repositoriesIds )
79 this.repositoriesIds = repositoriesIds;
82 public boolean isPackIndex()
87 public void setPackIndex( boolean packIndex )
89 this.packIndex = packIndex;
92 public String getGroupId()
97 public void setGroupId( String groupId )
99 this.groupId = groupId;
102 public String getMergedIndexPath()
104 return mergedIndexPath;
107 public void setMergedIndexPath( String mergedIndexPath )
109 this.mergedIndexPath = mergedIndexPath;
112 public int getMergedIndexTtl()
114 return mergedIndexTtl;
117 public void setMergedIndexTtl( int mergedIndexTtl )
119 this.mergedIndexTtl = mergedIndexTtl;
122 public File getMergedIndexDirectory()
124 return mergedIndexDirectory;
127 public void setMergedIndexDirectory( File mergedIndexDirectory )
129 this.mergedIndexDirectory = mergedIndexDirectory;
132 public IndexMergerRequest mergedIndexDirectory( File mergedIndexDirectory )
134 this.mergedIndexDirectory = mergedIndexDirectory;
138 public boolean isTemporary()
143 public void setTemporary( boolean temporary )
145 this.temporary = temporary;
149 public IndexMergerRequest temporary( boolean temporary )
151 this.temporary = temporary;
156 public String toString()
158 final StringBuilder sb = new StringBuilder( "IndexMergerRequest{" );
159 sb.append( "repositoriesIds=" ).append( repositoriesIds );
160 sb.append( ", packIndex=" ).append( packIndex );
161 sb.append( ", groupId='" ).append( groupId ).append( '\'' );
162 sb.append( ", mergedIndexPath='" ).append( mergedIndexPath ).append( '\'' );
163 sb.append( ", mergedIndexTtl=" ).append( mergedIndexTtl );
164 sb.append( ", mergedIndexDirectory=" ).append( mergedIndexDirectory );
165 sb.append( ", temporary=" ).append( temporary );
167 return sb.toString();
171 public boolean equals( Object o )
177 if ( o == null || getClass() != o.getClass() )
182 IndexMergerRequest that = (IndexMergerRequest) o;
184 return groupId.equals( that.groupId );
188 public int hashCode()
190 return groupId.hashCode();