1 package org.apache.archiva.rest.api.model.v2;/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing,
12 * software distributed under the License is distributed on an
13 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 * KIND, either express or implied. See the License for the
15 * specific language governing permissions and limitations
19 import io.swagger.v3.oas.annotations.media.Schema;
21 import javax.xml.bind.annotation.XmlRootElement;
22 import java.io.Serializable;
23 import java.util.Objects;
25 import static org.apache.archiva.indexer.ArchivaIndexManager.DEFAULT_INDEX_PATH;
28 * Index merge configuration.
30 * @author Martin Stockhammer <martin_s@apache.org>
33 @XmlRootElement(name="mergeConfiguration")
34 @Schema(name="MergeConfiguration", description = "Configuration settings for index merge of remote repositories.")
35 public class MergeConfiguration implements Serializable
37 private static final long serialVersionUID = -3629274059574459133L;
39 private String mergedIndexPath = DEFAULT_INDEX_PATH;
40 private int mergedIndexTtlMinutes = 30;
41 private String indexMergeSchedule = "";
43 @Schema(name="merged_index_path", description = "The path where the merged index is stored. The path is relative to the repository directory of the group.")
44 public String getMergedIndexPath( )
46 return mergedIndexPath;
49 public void setMergedIndexPath( String mergedIndexPath )
51 this.mergedIndexPath = mergedIndexPath;
54 @Schema(name="merged_index_ttl_minutes", description = "The Time to Life of the merged index in minutes.")
55 public int getMergedIndexTtlMinutes( )
57 return mergedIndexTtlMinutes;
60 public void setMergedIndexTtlMinutes( int mergedIndexTtlMinutes )
62 this.mergedIndexTtlMinutes = mergedIndexTtlMinutes;
65 @Schema(name="index_merge_schedule", description = "Cron expression that defines the times/intervals for index merging.")
66 public String getIndexMergeSchedule( )
68 return indexMergeSchedule;
71 public void setIndexMergeSchedule( String indexMergeSchedule )
73 this.indexMergeSchedule = indexMergeSchedule;
77 public boolean equals( Object o )
79 if ( this == o ) return true;
80 if ( o == null || getClass( ) != o.getClass( ) ) return false;
82 MergeConfiguration that = (MergeConfiguration) o;
84 if ( mergedIndexTtlMinutes != that.mergedIndexTtlMinutes ) return false;
85 if ( !Objects.equals( mergedIndexPath, that.mergedIndexPath ) )
87 return Objects.equals( indexMergeSchedule, that.indexMergeSchedule );
91 public int hashCode( )
93 int result = mergedIndexPath != null ? mergedIndexPath.hashCode( ) : 0;
94 result = 31 * result + mergedIndexTtlMinutes;
95 result = 31 * result + ( indexMergeSchedule != null ? indexMergeSchedule.hashCode( ) : 0 );
99 @SuppressWarnings( "StringBufferReplaceableByString" )
101 public String toString( )
103 final StringBuilder sb = new StringBuilder( "MergeConfiguration{" );
104 sb.append( "mergedIndexPath='" ).append( mergedIndexPath ).append( '\'' );
105 sb.append( ", mergedIndexTtlMinutes=" ).append( mergedIndexTtlMinutes );
106 sb.append( ", indexMergeSchedule='" ).append( indexMergeSchedule ).append( '\'' );
108 return sb.toString( );