You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TemporaryGroupIndex.java 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. import org.apache.archiva.repository.storage.StorageAsset;
  21. import java.io.Serializable;
  22. import java.nio.file.Path;
  23. import java.util.Date;
  24. /**
  25. * @author Olivier Lamy
  26. */
  27. public class TemporaryGroupIndex
  28. implements Serializable
  29. {
  30. private long creationTime = new Date().getTime();
  31. private StorageAsset directory;
  32. private String indexId;
  33. private String groupId;
  34. private int mergedIndexTtl;
  35. public TemporaryGroupIndex(StorageAsset directory, String indexId, String groupId, int mergedIndexTtl)
  36. {
  37. this.directory = directory;
  38. this.indexId = indexId;
  39. this.groupId = groupId;
  40. this.mergedIndexTtl = mergedIndexTtl;
  41. }
  42. public long getCreationTime()
  43. {
  44. return creationTime;
  45. }
  46. public TemporaryGroupIndex setCreationTime( long creationTime )
  47. {
  48. this.creationTime = creationTime;
  49. return this;
  50. }
  51. public StorageAsset getDirectory()
  52. {
  53. return directory;
  54. }
  55. public TemporaryGroupIndex setDirectory( StorageAsset directory )
  56. {
  57. this.directory = directory;
  58. return this;
  59. }
  60. public String getIndexId()
  61. {
  62. return indexId;
  63. }
  64. public TemporaryGroupIndex setIndexId( String indexId )
  65. {
  66. this.indexId = indexId;
  67. return this;
  68. }
  69. public String getGroupId()
  70. {
  71. return groupId;
  72. }
  73. public void setGroupId( String groupId )
  74. {
  75. this.groupId = groupId;
  76. }
  77. public int getMergedIndexTtl() {
  78. return mergedIndexTtl;
  79. }
  80. public void setMergedIndexTtl(int mergedIndexTtl) {
  81. this.mergedIndexTtl = mergedIndexTtl;
  82. }
  83. @Override
  84. public int hashCode()
  85. {
  86. return Long.toString( creationTime ).hashCode();
  87. }
  88. @Override
  89. public boolean equals( Object o )
  90. {
  91. if ( this == o )
  92. {
  93. return true;
  94. }
  95. if ( !( o instanceof TemporaryGroupIndex ) )
  96. {
  97. return false;
  98. }
  99. return this.creationTime == ( (TemporaryGroupIndex) o ).creationTime;
  100. }
  101. }