Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

CoreExtensionRepository.java 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2018 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. package org.sonar.core.extension;
  21. import java.util.Set;
  22. import java.util.stream.Stream;
  23. public interface CoreExtensionRepository {
  24. /**
  25. * Register the loaded Core Extensions in the repository.
  26. *
  27. * @throws IllegalStateException if the setCoreExtensionNames has already been called
  28. */
  29. void setLoadedCoreExtensions(Set<CoreExtension> coreExtensions);
  30. /**
  31. * @return a {@link Stream} of the loaded Core Extensions (if any).
  32. *
  33. * @see CoreExtension#getName()
  34. * @throws IllegalStateException if {@link #setLoadedCoreExtensions(Set)} has not been called yet
  35. */
  36. Stream<CoreExtension> loadedCoreExtensions();
  37. /**
  38. * Register that the specified Core Extension has been installed.
  39. *
  40. * @throws IllegalArgumentException if the specified {@link CoreExtension} has not been loaded prior to this call
  41. * ({@link #setLoadedCoreExtensions(Set)}
  42. * @throws IllegalStateException if {@link #setLoadedCoreExtensions(Set)} has not been called yet
  43. */
  44. void installed(CoreExtension coreExtension);
  45. /**
  46. * Tells whether the repository knows of Core Extension with this exact name.
  47. *
  48. * @see CoreExtension#getName()
  49. * @throws IllegalStateException if {@link #setLoadedCoreExtensions(Set)} has not been called yet
  50. */
  51. boolean isInstalled(String coreExtensionName);
  52. }