This project has retired. For details please refer to its Attic page.
Source code
001package org.apache.archiva.indexer.merger;
002/*
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements.  See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership.  The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License.  You may obtain a copy of the License at
010 *
011 *   http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing,
014 * software distributed under the License is distributed on an
015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016 * KIND, either express or implied.  See the License for the
017 * specific language governing permissions and limitations
018 * under the License.
019 */
020
021import org.apache.archiva.repository.storage.StorageAsset;
022
023import java.io.Serializable;
024import java.nio.file.Path;
025import java.util.Date;
026
027/**
028 * @author Olivier Lamy
029 */
030public class TemporaryGroupIndex
031    implements Serializable
032{
033    private long creationTime = new Date().getTime();
034
035    private StorageAsset directory;
036
037    private String indexId;
038
039    private String groupId;
040
041    private int mergedIndexTtl;
042
043    public TemporaryGroupIndex(StorageAsset directory, String indexId, String groupId, int mergedIndexTtl)
044    {
045        this.directory = directory;
046        this.indexId = indexId;
047        this.groupId = groupId;
048        this.mergedIndexTtl = mergedIndexTtl;
049    }
050
051    public long getCreationTime()
052    {
053        return creationTime;
054    }
055
056    public TemporaryGroupIndex setCreationTime( long creationTime )
057    {
058        this.creationTime = creationTime;
059        return this;
060    }
061
062    public StorageAsset getDirectory()
063    {
064        return directory;
065    }
066
067    public TemporaryGroupIndex setDirectory( StorageAsset directory )
068    {
069        this.directory = directory;
070        return this;
071    }
072
073    public String getIndexId()
074    {
075        return indexId;
076    }
077
078    public TemporaryGroupIndex setIndexId( String indexId )
079    {
080        this.indexId = indexId;
081        return this;
082    }
083
084    public String getGroupId()
085    {
086        return groupId;
087    }
088
089    public void setGroupId( String groupId )
090    {
091        this.groupId = groupId;
092    }
093
094    public int getMergedIndexTtl() {
095        return mergedIndexTtl;
096    }
097
098    public void setMergedIndexTtl(int mergedIndexTtl) {
099        this.mergedIndexTtl = mergedIndexTtl;
100    }
101
102    @Override
103    public int hashCode()
104    {
105        return Long.toString( creationTime ).hashCode();
106    }
107
108    @Override
109    public boolean equals( Object o )
110    {
111        if ( this == o )
112        {
113            return true;
114        }
115        if ( !( o instanceof TemporaryGroupIndex ) )
116        {
117            return false;
118        }
119        return this.creationTime == ( (TemporaryGroupIndex) o ).creationTime;
120    }
121}