RemoteControllerFactory.java 822 Bytes
package com.sitech.ismp.check.util;

import com.sitech.ismp.check.interfaces.AsiaSSH;
import com.sitech.ismp.check.interfaces.InterfacePro;
import com.sitech.util.upload.RomoteController;

public class RemoteControllerFactory {

	public static RomoteController createRemoteController(String ip, String type, String username, String password) {
		String isInterface = InterfacePro.isInterface;
		
		if(isInterface.equals("true")){
			return new AsiaSSH(ip,username);//链接堡垒机
		}else{
			if ("SSH".equals(type)) {
				return new com.sitech.util.upload.SSHThread(ip, 22, username, password);
			} else if ("TELNET".equals(type)) {
				return new com.sitech.util.upload.TelnetThread(ip, 23, username, password);
			} else {
				return new com.sitech.util.upload.SSHThread(ip, 22, username, password);
			}
		}
	}
	
}