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.

package-info.java 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. /**
  20. * <p>This is the V2 REST API of Archiva. It uses JAX-RS annotations for defining the endpoints.
  21. * The API is documented with OpenApi annotations.</p>
  22. *
  23. * <h3>Some design principles of the API and classes:</h3>
  24. * <ul>
  25. * <li>All services use V2 model classes. Internal models are always converted to V2 classes.</li>
  26. * <li>Schema attributes use the snake case syntax (lower case with '_' as divider)</li>
  27. * <li>Return code <code>200</code> and <code>201</code> (POST) is used for successful execution.</li>
  28. * <li>Return code <code>403</code> is used, if the user has not the permission for the action.</li>
  29. * <li>Return code <code>422</code> is used for input that has invalid data.</li>
  30. * </ul>
  31. *
  32. * <h4>Querying entity lists</h4>
  33. * <p>The main entities of a given path are retrieved on the base path.
  34. * Further sub entities or entries may be retrieved via subpaths.
  35. * A single entity is returned by the "{id}" path. Be careful with technical paths that are parallel to the
  36. * id path. Avoid naming conflicts with the id and technical paths.
  37. * Entity attributes may be retrieved by "{id}/{attribute}" path or if there are lists or collections by
  38. * "{id}/mycollection/{subentryid}"</p>
  39. *
  40. * <ul>
  41. * <li><code>GET</code> method is used for retrieving entities on the base path ""</li>
  42. * <li>The query for base entities should always return a paged result and be filterable and sortable</li>
  43. * <li>Query parameters for filtering, ordering and limits should be optional and proper defaults must be set</li>
  44. * <li>Return code <code>200</code> is used for successful retrieval</li>
  45. * <li>This action is idempotent</li>
  46. * </ul>
  47. *
  48. * <h4>Querying single entities</h4>
  49. * <p>Single entities are retrieved on the path "{id}"</p>
  50. * <ul>
  51. * <li><code>GET</code> method is used for retrieving a single entity. The id is always a path parameter.</li>
  52. * <li>Return code <code>200</code> is used for successful retrieval</li>
  53. * <li>Return code <code>404</code> is used if the entity with the given id does not exist</li>
  54. * <li>This action is idempotent</li>
  55. * </ul>
  56. *
  57. * <h4>Creating entities</h4>
  58. * <p>The main entities are created on the base path "".</p>
  59. * <ul>
  60. * <li><code>POST</code> is used for creating new entities</li>
  61. * <li>The <code>POST</code> body must always have a complete definition of the entity.</li>
  62. * <li>A unique <code>id</code> or <code>name</code> attribute is required for entities. If the id is generated during POST,
  63. * it must be returned by response body.</li>
  64. * <li>A successful <code>POST</code> request should always return the entity definition as it would be returned by the GET request.</li>
  65. * <li>Return code <code>201</code> is used for successful creation of the new entity.</li>
  66. * <li>A successful response has a <code>Location</code> header with the URL for retrieving the single created entity.</li>
  67. * <li>Return code <code>303</code> is used, if the entity exists already</li>
  68. * <li>This action is not idempotent</li>
  69. * </ul>
  70. *
  71. * <h4>Updating entities</h4>
  72. * <p>The path for entity update must contain the '{id}' of the entity. The path should be the same as for the GET operation.</p>
  73. * <ul>
  74. * <li><code>PUT</code> is used for updating existing entities</li>
  75. * <li>The body contains a JSON object. Only existing attributes are updated.</li>
  76. * <li>A successful PUT request should return the complete entity definition as it would be returned by the GET request.</li>
  77. * <li>Return code <code>200</code> is used for successful update of the new entity. Even if nothing changed.</li>
  78. * <li>This action is idempotent</li>
  79. * </ul>
  80. *
  81. * <h4>Deleting entities</h4>
  82. * <p>The path for entity deletion must contain the '{id}' of the entity. The path should be the same as
  83. * for the GET operation.</p>
  84. * <ul>
  85. * <li><code>DELETE</code> is used for deleting existing entities</li>
  86. * <li>The successful operation has no request and no response body</li>
  87. * <li>Return code <code>200</code> is used for successful deletion of the new entity.</li>
  88. * <li>This action is not idempotent</li>
  89. * </ul>
  90. *
  91. * <h4>Errors</h4>
  92. * <ul>
  93. * <li>A error uses a return code <code>>=400</code> </li>
  94. * <li>All errors use the same result object ({@link org.apache.archiva.rest.api.services.v2.ArchivaRestError}</li>
  95. * <li>Error messages are returned as keys. Translation is part of the client application.</li>
  96. * </ul>
  97. *
  98. * @author Martin Stockhammer <martin_s@apache.org>
  99. * @since 3.0
  100. */
  101. package org.apache.archiva.rest.api.services.v2;