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.configuration.impl;
017
018import java.util.Map;
019
020import org.apache.avalon.framework.configuration.Configuration;
021
022import org.ametys.core.migration.configuration.VersionConfiguration;
023
024/**
025 * Script Version Configuration
026 */
027public class ScriptVersionConfiguration implements VersionConfiguration
028{
029    private String _script;
030    private String _componentId;
031    private Map<String, Object> _additionalParameters;
032    
033    /**
034     * Create the configuration object
035     * @param componentId componet id
036     * @param script the script to run
037     * @param versionConfiguration full configuration for this handler
038     * @param additionalParameters Some additional parameters
039     */
040    public ScriptVersionConfiguration(String componentId, String script, Configuration versionConfiguration, Map<String, Object> additionalParameters)
041    {
042        _componentId = componentId;
043        _script = script;
044        _additionalParameters = additionalParameters;
045    }
046    
047    /**
048     * Get the script to run
049     * @return the script to run
050     */
051    public String getScript()
052    {
053        return _script;
054    }
055
056    /**
057     * The component Id
058     * @return the component Id
059     */
060    public String getComponentId()
061    {
062        return _componentId;
063    }
064
065    /**
066     * Get a map of parameters that will be passed to the script
067     * @return a map of parameters that will be passed to the script
068     */
069    public Map<String, Object> getAdditionalParameters()
070    {
071        return _additionalParameters;
072    }
073    
074}