1 package org.apache.archiva.configuration;
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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
22 import org.apache.archiva.redback.components.registry.RegistryException;
23 import org.apache.archiva.redback.components.registry.RegistryListener;
26 * Configuration holder for the model read from the registry.
28 public interface ArchivaConfiguration
31 * Get the configuration.
33 * @return the configuration
35 Configuration getConfiguration();
38 * Save any updated configuration.
40 * @param configuration the configuration to save
41 * @throws org.apache.archiva.redback.components.registry.RegistryException
42 * if there is a problem saving the registry data
43 * @throws IndeterminateConfigurationException
44 * if the configuration cannot be saved because it was read from two sources
46 void save( Configuration configuration )
47 throws RegistryException, IndeterminateConfigurationException;
50 * Determines if the configuration in use was as a result of a defaulted configuration.
52 * @return true if the configuration was created from the default-archiva.xml as opposed
53 * to being loaded from the usual locations of ${user.home}/.m2/archiva.xml or
54 * ${appserver.base}/conf/archiva.xml
56 boolean isDefaulted();
59 * Add a configuration listener to notify of changes to the configuration.
61 * @param listener the listener
63 void addListener( ConfigurationListener listener );
66 * Remove a configuration listener to stop notifications of changes to the configuration.
68 * @param listener the listener
70 void removeListener( ConfigurationListener listener );
73 * Add a registry listener to notify of events in spring-registry.
75 * @param listener the listener
76 * TODO: Remove in future.
78 void addChangeListener( RegistryListener listener );
80 void removeChangeListener( RegistryListener listener );
83 * reload configuration from file included registry