// Path: flyJenkins/src/main/java/com/agun/flyJenkins/process/FlyProcess.java
// public interface FlyProcess {
// 	public Map<String, Object> run(Object arg1, String operName);
// }


import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Map;
import com.agun.flyJenkins.process.FlyProcess;
import jenkins.model.Jenkins;
import hudson.model.Action;
import hudson.remoting.Callable;

package com.agun.jenkins;





public class CLICallable implements Callable<Map<String, Object>, Throwable> {

	private String operationName;
	private String processName;
	private Object arg1;
	
	public Object getArg1() {
		return arg1;
	}


	public void setArg1(Object arg1) {
		this.arg1 = arg1;
	}


	public void setProcessName(String processName) {
		this.processName = processName;
	}


	public String getProcessName() {
		return processName;
	}

	public String getOperationName() {
		return operationName;
	}


	public void setOperationName(String operationName) {
		this.operationName = operationName;
	}


	@Override
	public  Map<String, Object> call() throws Throwable {
		
		List<Action> actionList = Jenkins.getInstance().getActions();
		
		for(Action action : actionList){
			
			if(action.getDisplayName() != null && action.getDisplayName().equals("flyJenkins")){
				try {
					Method method = action.getClass().getMethod("getFlyProcess", String.class);

// Path: flyJenkins/src/main/java/com/agun/flyJenkins/process/FlyProcess.java
// public interface FlyProcess {
// 	public Map<String, Object> run(Object arg1, String operName);
// }


// Path: flyAgent/src/main/java/com/agun/jenkins/CLICallable.java
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Map;
import com.agun.flyJenkins.process.FlyProcess;
import jenkins.model.Jenkins;
import hudson.model.Action;
import hudson.remoting.Callable;

package com.agun.jenkins;





public class CLICallable implements Callable<Map<String, Object>, Throwable> {

	private String operationName;
	private String processName;
	private Object arg1;
	
	public Object getArg1() {
		return arg1;
	}


	public void setArg1(Object arg1) {
		this.arg1 = arg1;
	}


	public void setProcessName(String processName) {
		this.processName = processName;
	}


	public String getProcessName() {
		return processName;
	}

	public String getOperationName() {
		return operationName;
	}


	public void setOperationName(String operationName) {
		this.operationName = operationName;
	}


	@Override
	public  Map<String, Object> call() throws Throwable {
		
		List<Action> actionList = Jenkins.getInstance().getActions();
		
		for(Action action : actionList){
			
			if(action.getDisplayName() != null && action.getDisplayName().equals("flyJenkins")){
				try {
					Method method = action.getClass().getMethod("getFlyProcess", String.class);

					FlyProcess flyProcess =  (FlyProcess) method.invoke(action, processName);
