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.

ManagedRepositoriesService.java 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. package org.apache.archiva.rest.api.services;
  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 io.swagger.v3.oas.annotations.tags.Tag;
  21. import io.swagger.v3.oas.annotations.tags.Tags;
  22. import org.apache.archiva.admin.model.beans.ManagedRepository;
  23. import org.apache.archiva.redback.authorization.RedbackAuthorization;
  24. import org.apache.archiva.rest.api.model.ActionStatus;
  25. import org.apache.archiva.rest.api.model.ArchivaRepositoryStatistics;
  26. import org.apache.archiva.rest.api.model.FileStatus;
  27. import org.apache.archiva.security.common.ArchivaRoleConstants;
  28. import javax.ws.rs.Consumes;
  29. import javax.ws.rs.GET;
  30. import javax.ws.rs.POST;
  31. import javax.ws.rs.Path;
  32. import javax.ws.rs.PathParam;
  33. import javax.ws.rs.Produces;
  34. import javax.ws.rs.QueryParam;
  35. import javax.ws.rs.core.MediaType;
  36. import java.util.List;
  37. /**
  38. * @author Olivier Lamy
  39. * @since 1.4-M1
  40. */
  41. @Path( "/managedRepositoriesService/" )
  42. @Tags( {
  43. @Tag( name = "ManagedRepositories", description = "Administration for managed repositories" ),
  44. @Tag( name = "Repositories" )
  45. })
  46. public interface ManagedRepositoriesService
  47. {
  48. @Path( "getManagedRepositories" )
  49. @GET
  50. @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
  51. @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
  52. List<ManagedRepository> getManagedRepositories()
  53. throws ArchivaRestServiceException;
  54. @Path( "getManagedRepository/{repositoryId}" )
  55. @GET
  56. @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
  57. @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
  58. ManagedRepository getManagedRepository( @PathParam( "repositoryId" ) String repositoryId )
  59. throws ArchivaRestServiceException;
  60. @Path( "deleteManagedRepository" )
  61. @GET
  62. @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
  63. @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
  64. ActionStatus deleteManagedRepository( @QueryParam( "repositoryId" ) String repositoryId,
  65. @QueryParam( "deleteContent" ) boolean deleteContent )
  66. throws ArchivaRestServiceException;
  67. @Path( "addManagedRepository" )
  68. @POST
  69. @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
  70. @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
  71. @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
  72. ManagedRepository addManagedRepository( ManagedRepository managedRepository )
  73. throws ArchivaRestServiceException;
  74. @Path( "updateManagedRepository" )
  75. @POST
  76. @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
  77. @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
  78. @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
  79. Boolean updateManagedRepository( ManagedRepository managedRepository )
  80. throws ArchivaRestServiceException;
  81. /**
  82. * @since 3.0
  83. */
  84. @Path( "fileLocationExists" )
  85. @GET
  86. @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
  87. @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
  88. FileStatus getFileStatus( @QueryParam( "fileLocation" ) String fileLocation )
  89. throws ArchivaRestServiceException;
  90. /**
  91. * @since 1.4-M3
  92. */
  93. @Path( "getManagedRepositoryStatistics/{repositoryId}/{lang}" )
  94. @GET
  95. @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
  96. @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
  97. ArchivaRepositoryStatistics getManagedRepositoryStatistics( @PathParam( "repositoryId" ) String repositoryId,
  98. @PathParam( "lang" ) String lang )
  99. throws ArchivaRestServiceException;
  100. /**
  101. * return a pom snippet to use this repository with entities escaped (&lt; &gt;)
  102. * @since 1.4-M3
  103. */
  104. @Path( "getPomSnippet/{repositoryId}" )
  105. @GET
  106. @Produces( { MediaType.TEXT_PLAIN } )
  107. @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
  108. String getPomSnippet( @PathParam( "repositoryId" ) String repositoryId )
  109. throws ArchivaRestServiceException;
  110. }