This project has retired. For details please refer to its Attic page.
AbstractManagedRepository xref
View Javadoc
1   package org.apache.archiva.repository.base;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  
23  import org.apache.archiva.repository.EditableManagedRepository;
24  import org.apache.archiva.repository.ManagedRepositoryContent;
25  import org.apache.archiva.repository.ReleaseScheme;
26  import org.apache.archiva.repository.RepositoryType;
27  import org.apache.archiva.repository.storage.RepositoryStorage;
28  
29  import java.util.Collections;
30  import java.util.HashSet;
31  import java.util.Locale;
32  import java.util.Set;
33  
34  /**
35   * Simple implementation of a managed repository.
36   */
37  public abstract class AbstractManagedRepository extends AbstractRepository implements EditableManagedRepository
38  {
39      private boolean blocksRedeployment = false;
40      private ManagedRepositoryContent content;
41      private Set<ReleaseScheme> activeReleaseSchemes = new HashSet<>(  );
42      private Set<ReleaseScheme> uActiveReleaseSchemes = Collections.unmodifiableSet( activeReleaseSchemes );
43  
44      public AbstractManagedRepository( RepositoryType type, String id, String name, RepositoryStorage storage)
45      {
46          super( type, id, name, storage );
47      }
48  
49      public AbstractManagedRepository( Locale primaryLocale, RepositoryType type, String id, String name, RepositoryStorage storage )
50      {
51          super( primaryLocale, type, id, name, storage );
52      }
53  
54      @Override
55      public ManagedRepositoryContent getContent( )
56      {
57          return content;
58      }
59  
60      @Override
61      public void setContent(ManagedRepositoryContent content) {
62          this.content = content;
63      }
64  
65      @Override
66      public void setBlocksRedeployment( boolean blocksRedeployment )
67      {
68          this.blocksRedeployment = blocksRedeployment;
69      }
70  
71      @Override
72      public boolean blocksRedeployments( )
73      {
74          return blocksRedeployment;
75      }
76  
77      @Override
78      public Set<ReleaseScheme> getActiveReleaseSchemes( )
79      {
80          return uActiveReleaseSchemes;
81      }
82  
83      @Override
84      public void addActiveReleaseScheme( ReleaseScheme scheme )
85      {
86          this.activeReleaseSchemes.add(scheme);
87      }
88  
89      @Override
90      public void removeActiveReleaseScheme( ReleaseScheme scheme )
91      {
92          this.activeReleaseSchemes.remove(scheme);
93      }
94  
95      @Override
96      public void clearActiveReleaseSchemes( )
97      {
98          this.activeReleaseSchemes.clear();
99      }
100 
101 
102 }