Coverage Report - org.apache.maven.archiva.configuration.ArchivaConfiguration
 
Classes in this File Line Coverage Branch Coverage Complexity
ArchivaConfiguration
N/A
N/A
1
 
 1  
 package org.apache.maven.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.codehaus.plexus.registry.RegistryException;
 23  
 import org.codehaus.plexus.registry.RegistryListener;
 24  
 
 25  
 /**
 26  
  * Configuration holder for the model read from the registry.
 27  
  */
 28  
 public interface ArchivaConfiguration
 29  
 {
 30  
     String ROLE = ArchivaConfiguration.class.getName();
 31  
 
 32  
     /**
 33  
      * Get the configuration.
 34  
      *
 35  
      * @return the configuration
 36  
      */
 37  
     Configuration getConfiguration();
 38  
 
 39  
     /**
 40  
      * Save any updated configuration.
 41  
      *
 42  
      * @param configuration the configuration to save
 43  
      * @throws org.codehaus.plexus.registry.RegistryException
 44  
      *          if there is a problem saving the registry data
 45  
      * @throws IndeterminateConfigurationException
 46  
      *          if the configuration cannot be saved because it was read from two sources
 47  
      */
 48  
     void save( Configuration configuration )
 49  
         throws RegistryException, IndeterminateConfigurationException;
 50  
     
 51  
     /**
 52  
      * Determines if the configuration in use was as a result of a defaulted configuration.
 53  
      * 
 54  
      * @return true if the configuration was created from the default-archiva.xml as opposed
 55  
      *              to being loaded from the usual locations of ${user.home}/.m2/archiva.xml or
 56  
      *              ${appserver.base}/conf/archiva.xml
 57  
      */
 58  
     boolean isDefaulted();
 59  
 
 60  
     /**
 61  
      * Add a configuration listener to notify of changes to the configuration.
 62  
      *
 63  
      * @param listener the listener
 64  
      */
 65  
     void addListener( ConfigurationListener listener );
 66  
     
 67  
     /**
 68  
      * Remove a configuration listener to stop notifications of changes to the configuration.
 69  
      *
 70  
      * @param listener the listener
 71  
      */
 72  
     void removeListener( ConfigurationListener listener );
 73  
     
 74  
     /**
 75  
      * Add a registry listener to notify of events in plexus-registry.
 76  
      *
 77  
      * @param listener the listener
 78  
      * TODO: Remove in future.
 79  
      */
 80  
     void addChangeListener( RegistryListener listener );
 81  
 }
 82