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.

RepositoryCapabilities.java 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. package org.apache.archiva.repository;
  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 java.util.Set;
  21. /**
  22. * Describe the capabilities a repository implementation supports.
  23. */
  24. public interface RepositoryCapabilities {
  25. /**
  26. * Returns true, if this repository has a mechanism for indexes
  27. * @return true, if this repository is indexable, otherwise false.
  28. */
  29. default boolean isIndexable() {
  30. return true;
  31. }
  32. /**
  33. * Returns true, if this repository type is storing its artifacts on the filesystem.
  34. * @return true, if this is a file based repository, otherwise false.
  35. */
  36. default boolean isFileBased() {
  37. return true;
  38. }
  39. /**
  40. * Returns true, if this repository allows to block redeployments to prevent overriding
  41. * released artifacts
  42. * @return true, if this repo can block redeployments, otherwise false.
  43. */
  44. default boolean canBlockRedeployments() {
  45. return true;
  46. }
  47. /**
  48. * Returns true, if the artifacts can be scanned for metadata retrieval or maintenance tasks
  49. * @return true, if this repository can be scanned regularily, otherwise false.
  50. */
  51. default boolean isScannable() {
  52. return true;
  53. }
  54. /**
  55. * Returns true, if this repository can use failover repository urls
  56. * @return true, if there is a failover mechanism for repository access, otherwise false.
  57. */
  58. default boolean allowsFailover() {
  59. return false;
  60. }
  61. /**
  62. * Returns the release schemes this repository type can handle
  63. */
  64. Set<ReleaseScheme> supportedReleaseSchemes();
  65. /**
  66. * Returns the layouts this repository type can provide
  67. * @return The list of layouts supported by this repository.
  68. */
  69. Set<String> supportedLayouts();
  70. /**
  71. * Returns additional capabilities, that this repository type implements.
  72. * @return A list of custom capabilities.
  73. */
  74. Set<String> customCapabilities();
  75. /**
  76. * Returns the supported features this repository type supports. This method returns
  77. * string that corresponds to fully qualified class names.
  78. * We use string representation to allow implementations provide their own feature
  79. * implementations if necessary and to avoid class errors.
  80. *
  81. * @return The list of supported features as string values.
  82. */
  83. Set<String> supportedFeatures();
  84. }