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.

ArchivaIndexManager.java 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. package org.apache.archiva.indexer;
  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.Repository;
  21. import org.apache.archiva.repository.RepositoryType;
  22. import java.net.URI;
  23. import java.util.Collection;
  24. public interface ArchivaIndexManager {
  25. /**
  26. * Compresses the index to a more dense packed format.
  27. * @param context
  28. */
  29. void pack(ArchivaIndexingContext context) throws IndexUpdateFailedException;
  30. /**
  31. * Rescans the whole repository, this index is associated to.
  32. * @param context
  33. *
  34. */
  35. void scan(ArchivaIndexingContext context) throws IndexUpdateFailedException;
  36. /**
  37. * Updates the index from the remote url.
  38. * @param context
  39. * @param fullUpdate
  40. */
  41. void update(ArchivaIndexingContext context, boolean fullUpdate) throws IndexUpdateFailedException;
  42. /**
  43. * Adds a list of artifacts to the index.
  44. * @param context
  45. * @param artifactReference
  46. */
  47. void addArtifactsToIndex(ArchivaIndexingContext context, Collection<URI> artifactReference) throws IndexUpdateFailedException;
  48. /**
  49. * Removes a list of artifacts from the index.
  50. * @param context
  51. * @param artifactReference
  52. */
  53. void removeArtifactsFromIndex(ArchivaIndexingContext context, Collection<URI> artifactReference) throws IndexUpdateFailedException;
  54. /**
  55. * Returns true, if this manager is able to apply the index actions for the given repository type.
  56. * @param type
  57. * @return
  58. */
  59. boolean supportsRepository(RepositoryType type);
  60. /**
  61. * Creates the indexing context for the given repository.
  62. * @param repository the repository for which the index context should be created
  63. * @return the index context
  64. */
  65. ArchivaIndexingContext createContext(Repository repository) throws IndexCreationFailedException;
  66. /**
  67. * Reinitializes the index. E.g. remove the files and create a new empty index.
  68. *
  69. * @param context
  70. * @return the new created index
  71. */
  72. ArchivaIndexingContext reset(ArchivaIndexingContext context) throws IndexUpdateFailedException;
  73. /**
  74. * Moves the context to a new directory. It's up to the implementation, if a new context is created
  75. * or the context is moved only.
  76. *
  77. * @param context The current context
  78. * @param repo The repository
  79. * @return The new context
  80. * @throws IndexCreationFailedException
  81. */
  82. ArchivaIndexingContext move(ArchivaIndexingContext context, Repository repo) throws IndexCreationFailedException;
  83. /**
  84. * Returns the local path where the index is stored.
  85. * @return
  86. */
  87. public void updateLocalIndexPath(Repository repo);
  88. }