This project has retired. For details please refer to its Attic page.
TemporaryGroupIndex xref
View Javadoc
1   package org.apache.archiva.indexer.merger;
2   /*
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
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
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
18   * under the License.
19   */
20  
21  import java.io.File;
22  import java.io.Serializable;
23  import java.util.Date;
24  
25  /**
26   * @author Olivier Lamy
27   */
28  public class TemporaryGroupIndex
29      implements Serializable
30  {
31      private long creationTime = new Date().getTime();
32  
33      private File directory;
34  
35      private String indexId;
36  
37      private String groupId;
38  
39      private int mergedIndexTtl;
40  
41      public TemporaryGroupIndex(File directory, String indexId, String groupId, int mergedIndexTtl)
42      {
43          this.directory = directory;
44          this.indexId = indexId;
45          this.groupId = groupId;
46          this.mergedIndexTtl = mergedIndexTtl;
47      }
48  
49      public long getCreationTime()
50      {
51          return creationTime;
52      }
53  
54      public TemporaryGroupIndex setCreationTime( long creationTime )
55      {
56          this.creationTime = creationTime;
57          return this;
58      }
59  
60      public File getDirectory()
61      {
62          return directory;
63      }
64  
65      public TemporaryGroupIndex setDirectory( File directory )
66      {
67          this.directory = directory;
68          return this;
69      }
70  
71      public String getIndexId()
72      {
73          return indexId;
74      }
75  
76      public TemporaryGroupIndex setIndexId( String indexId )
77      {
78          this.indexId = indexId;
79          return this;
80      }
81  
82      public String getGroupId()
83      {
84          return groupId;
85      }
86  
87      public void setGroupId( String groupId )
88      {
89          this.groupId = groupId;
90      }
91  
92      public int getMergedIndexTtl() {
93          return mergedIndexTtl;
94      }
95  
96      public void setMergedIndexTtl(int mergedIndexTtl) {
97          this.mergedIndexTtl = mergedIndexTtl;
98      }
99  
100     @Override
101     public int hashCode()
102     {
103         return Long.toString( creationTime ).hashCode();
104     }
105 
106     @Override
107     public boolean equals( Object o )
108     {
109         if ( this == o )
110         {
111             return true;
112         }
113         if ( !( o instanceof TemporaryGroupIndex ) )
114         {
115             return false;
116         }
117         return this.creationTime == ( (TemporaryGroupIndex) o ).creationTime;
118     }
119 }