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
21 import java.io.Serializable;
22 import java.nio.file.Path;
23 import java.util.Date;
26 * @author Olivier Lamy
28 public class TemporaryGroupIndex
29 implements Serializable
31 private long creationTime = new Date().getTime();
33 private Path directory;
35 private String indexId;
37 private String groupId;
39 private int mergedIndexTtl;
41 public TemporaryGroupIndex(Path directory, String indexId, String groupId, int mergedIndexTtl)
43 this.directory = directory;
44 this.indexId = indexId;
45 this.groupId = groupId;
46 this.mergedIndexTtl = mergedIndexTtl;
49 public long getCreationTime()
54 public TemporaryGroupIndex setCreationTime( long creationTime )
56 this.creationTime = creationTime;
60 public Path getDirectory()
65 public TemporaryGroupIndex setDirectory( Path directory )
67 this.directory = directory;
71 public String getIndexId()
76 public TemporaryGroupIndex setIndexId( String indexId )
78 this.indexId = indexId;
82 public String getGroupId()
87 public void setGroupId( String groupId )
89 this.groupId = groupId;
92 public int getMergedIndexTtl() {
93 return mergedIndexTtl;
96 public void setMergedIndexTtl(int mergedIndexTtl) {
97 this.mergedIndexTtl = mergedIndexTtl;
101 public int hashCode()
103 return Long.toString( creationTime ).hashCode();
107 public boolean equals( Object o )
113 if ( !( o instanceof TemporaryGroupIndex ) )
117 return this.creationTime == ( (TemporaryGroupIndex) o ).creationTime;