001/*
002 *  Copyright 2020 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.core.migration;
017
018import org.apache.avalon.framework.configuration.Configuration;
019
020/**
021 * Object to store each migration extension
022 */
023public class MigrationConfiguration
024{
025    private String _id;
026    private String _pluginName;
027    private String _featureName;
028    private Configuration _configuration;
029    
030    /**
031     * Constructor with all attributes
032     * @param id id of the extension
033     * @param pluginName plugin containing the extension
034     * @param featureName feature containing the extension
035     * @param configuration configuration of the extension
036     */
037    public MigrationConfiguration(String id, String pluginName, String featureName, Configuration configuration)
038    {
039        _id = id;
040        _pluginName = pluginName;
041        _featureName = featureName;
042        _configuration = configuration;
043    }
044
045    /**
046     * Get the extension id
047     * @return The extension id
048     */
049    public String getId()
050    {
051        return _id;
052    }
053
054    /**
055     * Get the plugin name
056     * @return The plugin name
057     */
058    public String getPluginName()
059    {
060        return _pluginName;
061    }
062
063    /**
064     * Get the feature name
065     * @return The feature name
066     */
067    public String getFeatureName()
068    {
069        return _featureName;
070    }
071
072    /**
073     * Get the configuration
074     * @return The configuration
075     */
076    public Configuration getConfiguration()
077    {
078        return _configuration;
079    }
080    
081    @Override
082    public String toString()
083    {
084        return "Extension: '" + _id + "' in feature '" + _featureName + "' in plugin '" + _pluginName + "'";
085    }
086}