// Path: src/main/java/org/centralperf/model/dao/ScriptVariable.java
// @Entity
// public class ScriptVariable {
// 
// 	@Id
// 	@GeneratedValue
// 	private Long id;
// 	
// 	private String name;
// 	private String defaultValue;
// 	private String value;
// 	private String description;
// 	
// 	public String getName() {
// 		return name;
// 	}
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 	public String getDefaultValue() {
// 		return defaultValue;
// 	}
// 	public void setDefaultValue(String defaultValue) {
// 		this.defaultValue = defaultValue;
// 	}
// 	public String getValue() {
// 		return value;
// 	}
// 	public void setValue(String value) {
// 		this.value = value;
// 	}
// 	public String getDescription() {
// 		return description;
// 	}
// 	public void setDescription(String description) {
// 		this.description = description;
// 	}
// 	
// 	@Override
// 	public ScriptVariable clone() {
// 		ScriptVariable scriptVariable = new ScriptVariable();
// 		scriptVariable.setName(this.getName());
// 		scriptVariable.setValue(this.getValue());
// 		scriptVariable.setDescription(this.getDescription());
// 		scriptVariable.setDefaultValue(this.getDefaultValue());
// 		return scriptVariable;
// 	};
// 	
// 	@Override
// 	public String toString() {
// 		return "ScriptVariable. Name = " + this.getName() 
// 				+ ", value = " + this.getValue()				
// 				+ ", default value = " + this.getDefaultValue() 
// 				+ ", description = " + this.getDescription();
// 	}
// 	
// }
// 
// Path: src/main/java/org/centralperf/model/dao/ScriptVariableSet.java
// @Entity
// public class ScriptVariableSet {
// 
// 	@Id
// 	@GeneratedValue
// 	private Long id;
// 	
// 	private String name;
// 	
// 	@OneToMany(cascade=CascadeType.ALL)
// 	private List<ScriptVariable> scriptVariables = new ArrayList<ScriptVariable>();
// 	
// 	public List<ScriptVariable> getScriptVariables() {
// 		return scriptVariables;
// 	}
// 	public void setScriptVariables(List<ScriptVariable> scriptsVariable) {
// 		this.scriptVariables = scriptsVariable;
// 	}
// 	public String getName() {
// 		return name;
// 	}
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		StringBuilder builder = new StringBuilder();
// 		builder.append("Script variable set. Name = " + this.getName() + "\r\n");
// 		builder.append("==================\r\n");
// 		for (ScriptVariable scriptsVariable : this.getScriptVariables()) {
// 			builder.append(scriptsVariable.toString() + "\r\n");
// 		}
// 		builder.append("==================\r\n");
// 		return builder.toString();
// 	}
// 	
// }
// 
// Path: src/main/java/org/centralperf/sampler/api/SamplerScriptProcessor.java
// public interface SamplerScriptProcessor {
// 	
// 	/**
// 	 * Validates the provided script is compatible with this sampler
// 	 * @param script
// 	 * @return true if script is compatible
// 	 */
// 	public boolean validateScript(String script);
// 	
// 	/**
// 	 * Get the variables for provided script
// 	 * @param script
// 	 * @return a list of variable sets
// 	 */
// 	public List<ScriptVariableSet> getVariableSets(String script);
// 
// 	/**
// 	 * Returns a script with variables replaced with provided values
// 	 * @param scriptContent
// 	 * @param scriptVariables
// 	 * @return
// 	 */
// 	public String replaceVariablesInScript(String scriptContent,List<ScriptVariable> scriptVariables);
// }


import java.util.List;
import org.centralperf.model.dao.ScriptVariable;
import org.centralperf.model.dao.ScriptVariableSet;
import org.centralperf.sampler.api.SamplerScriptProcessor;
import org.springframework.stereotype.Component;
/*
 * Copyright (C) 2014  The Central Perf authors
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.centralperf.sampler.driver.gatling;



/**
* Gatling based Script processor
* @since 1.0 
*/
@Component
public class GatlingScriptProcessor implements SamplerScriptProcessor {

	@Override
	public boolean validateScript(String script) {
		return script.startsWith("package");
	}

	@Override
	public List<ScriptVariableSet> getVariableSets(String script) {
		return null;
	}

	@Override
	public String replaceVariablesInScript(String scriptContent,
// Path: src/main/java/org/centralperf/model/dao/ScriptVariable.java
// @Entity
// public class ScriptVariable {
// 
// 	@Id
// 	@GeneratedValue
// 	private Long id;
// 	
// 	private String name;
// 	private String defaultValue;
// 	private String value;
// 	private String description;
// 	
// 	public String getName() {
// 		return name;
// 	}
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 	public String getDefaultValue() {
// 		return defaultValue;
// 	}
// 	public void setDefaultValue(String defaultValue) {
// 		this.defaultValue = defaultValue;
// 	}
// 	public String getValue() {
// 		return value;
// 	}
// 	public void setValue(String value) {
// 		this.value = value;
// 	}
// 	public String getDescription() {
// 		return description;
// 	}
// 	public void setDescription(String description) {
// 		this.description = description;
// 	}
// 	
// 	@Override
// 	public ScriptVariable clone() {
// 		ScriptVariable scriptVariable = new ScriptVariable();
// 		scriptVariable.setName(this.getName());
// 		scriptVariable.setValue(this.getValue());
// 		scriptVariable.setDescription(this.getDescription());
// 		scriptVariable.setDefaultValue(this.getDefaultValue());
// 		return scriptVariable;
// 	};
// 	
// 	@Override
// 	public String toString() {
// 		return "ScriptVariable. Name = " + this.getName() 
// 				+ ", value = " + this.getValue()				
// 				+ ", default value = " + this.getDefaultValue() 
// 				+ ", description = " + this.getDescription();
// 	}
// 	
// }
// 
// Path: src/main/java/org/centralperf/model/dao/ScriptVariableSet.java
// @Entity
// public class ScriptVariableSet {
// 
// 	@Id
// 	@GeneratedValue
// 	private Long id;
// 	
// 	private String name;
// 	
// 	@OneToMany(cascade=CascadeType.ALL)
// 	private List<ScriptVariable> scriptVariables = new ArrayList<ScriptVariable>();
// 	
// 	public List<ScriptVariable> getScriptVariables() {
// 		return scriptVariables;
// 	}
// 	public void setScriptVariables(List<ScriptVariable> scriptsVariable) {
// 		this.scriptVariables = scriptsVariable;
// 	}
// 	public String getName() {
// 		return name;
// 	}
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		StringBuilder builder = new StringBuilder();
// 		builder.append("Script variable set. Name = " + this.getName() + "\r\n");
// 		builder.append("==================\r\n");
// 		for (ScriptVariable scriptsVariable : this.getScriptVariables()) {
// 			builder.append(scriptsVariable.toString() + "\r\n");
// 		}
// 		builder.append("==================\r\n");
// 		return builder.toString();
// 	}
// 	
// }
// 
// Path: src/main/java/org/centralperf/sampler/api/SamplerScriptProcessor.java
// public interface SamplerScriptProcessor {
// 	
// 	/**
// 	 * Validates the provided script is compatible with this sampler
// 	 * @param script
// 	 * @return true if script is compatible
// 	 */
// 	public boolean validateScript(String script);
// 	
// 	/**
// 	 * Get the variables for provided script
// 	 * @param script
// 	 * @return a list of variable sets
// 	 */
// 	public List<ScriptVariableSet> getVariableSets(String script);
// 
// 	/**
// 	 * Returns a script with variables replaced with provided values
// 	 * @param scriptContent
// 	 * @param scriptVariables
// 	 * @return
// 	 */
// 	public String replaceVariablesInScript(String scriptContent,List<ScriptVariable> scriptVariables);
// }


// Path: src/main/java/org/centralperf/sampler/driver/gatling/GatlingScriptProcessor.java
import java.util.List;
import org.centralperf.model.dao.ScriptVariable;
import org.centralperf.model.dao.ScriptVariableSet;
import org.centralperf.sampler.api.SamplerScriptProcessor;
import org.springframework.stereotype.Component;

/*
 * Copyright (C) 2014  The Central Perf authors
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.centralperf.sampler.driver.gatling;



/**
* Gatling based Script processor
* @since 1.0 
*/
@Component
public class GatlingScriptProcessor implements SamplerScriptProcessor {

	@Override
	public boolean validateScript(String script) {
		return script.startsWith("package");
	}

	@Override
	public List<ScriptVariableSet> getVariableSets(String script) {
		return null;
	}

	@Override
	public String replaceVariablesInScript(String scriptContent,
			List<ScriptVariable> scriptVariables) {