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.

AbstractManagedRepository.java 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. package org.apache.archiva.repository.base.managed;
  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. * 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. import org.apache.archiva.repository.EditableManagedRepository;
  20. import org.apache.archiva.repository.ManagedRepositoryContent;
  21. import org.apache.archiva.repository.ReleaseScheme;
  22. import org.apache.archiva.repository.RepositoryType;
  23. import org.apache.archiva.repository.base.AbstractRepository;
  24. import org.apache.archiva.repository.storage.RepositoryStorage;
  25. import java.util.Collections;
  26. import java.util.HashSet;
  27. import java.util.Locale;
  28. import java.util.Set;
  29. /**
  30. * Simple implementation of a managed repository.
  31. */
  32. public abstract class AbstractManagedRepository extends AbstractRepository implements EditableManagedRepository
  33. {
  34. private boolean blocksRedeployment = false;
  35. private ManagedRepositoryContent content;
  36. private Set<ReleaseScheme> activeReleaseSchemes = new HashSet<>( );
  37. private Set<ReleaseScheme> uActiveReleaseSchemes = Collections.unmodifiableSet( activeReleaseSchemes );
  38. public AbstractManagedRepository( RepositoryType type, String id, String name, RepositoryStorage storage)
  39. {
  40. super( type, id, name, storage );
  41. }
  42. public AbstractManagedRepository( Locale primaryLocale, RepositoryType type, String id, String name, RepositoryStorage storage )
  43. {
  44. super( primaryLocale, type, id, name, storage );
  45. }
  46. @Override
  47. public ManagedRepositoryContent getContent( )
  48. {
  49. return content;
  50. }
  51. @Override
  52. public void setContent( ManagedRepositoryContent content) {
  53. this.content = content;
  54. }
  55. @Override
  56. public void setBlocksRedeployment( boolean blocksRedeployment )
  57. {
  58. this.blocksRedeployment = blocksRedeployment;
  59. }
  60. @Override
  61. public boolean blocksRedeployments( )
  62. {
  63. return blocksRedeployment;
  64. }
  65. @Override
  66. public Set<ReleaseScheme> getActiveReleaseSchemes( )
  67. {
  68. return uActiveReleaseSchemes;
  69. }
  70. @Override
  71. public void addActiveReleaseScheme( ReleaseScheme scheme )
  72. {
  73. this.activeReleaseSchemes.add(scheme);
  74. }
  75. @Override
  76. public void removeActiveReleaseScheme( ReleaseScheme scheme )
  77. {
  78. this.activeReleaseSchemes.remove(scheme);
  79. }
  80. @Override
  81. public void clearActiveReleaseSchemes( )
  82. {
  83. this.activeReleaseSchemes.clear();
  84. }
  85. }