View Javadoc
1   package org.apache.archiva.configuration;
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  import org.apache.archiva.redback.components.registry.RegistryException;
23  import org.apache.archiva.redback.components.registry.RegistryListener;
24  import org.springframework.stereotype.Service;
25  
26  @Service("archivaConfiguration#mocked")
27  public class StubConfiguration
28      implements ArchivaConfiguration
29  {
30      private Configuration configuration;
31  
32      @Override
33      public Configuration getConfiguration()
34      {
35          return configuration;
36      }
37  
38      @Override
39      public void save( Configuration configuration )
40          throws RegistryException, IndeterminateConfigurationException
41      {
42          this.configuration = configuration;
43      }
44  
45      @Override
46      public boolean isDefaulted()
47      {
48          return false;
49      }
50  
51      @Override
52      public void addListener( ConfigurationListener listener )
53      {
54          throw new UnsupportedOperationException();
55      }
56  
57      @Override
58      public void removeListener( ConfigurationListener listener )
59      {
60          throw new UnsupportedOperationException();
61      }
62  
63      @Override
64      public void addChangeListener( RegistryListener listener )
65      {
66          throw new UnsupportedOperationException();
67      }
68  
69      @Override
70      public void removeChangeListener( RegistryListener listener )
71      {
72          throw new UnsupportedOperationException();
73      }
74  
75      @Override
76      public void reload()
77      {
78          // no op
79      }
80  }