/* * */ package com.leanwo.management.model; import java.util.List; import com.leanwo.management.service.ProgramRunResult; import com.leanwo.management.util.CloseableUtil; /** * 应用程序实体类. * * @author YangZhiJie */ public class ApplicationSetting { /** 应用程序名称. */ private String name; /** 安装路径. */ private String installPath; /** 启动程序命令. */ private String startCommand; /** 启动程序BAT文件路径. */ private String startBatFile; /** 停止程序BAT文件路径. */ private String stopBatFile; /** 监控地址. */ private String monitorUrl; /** token. */ private String token; /** 自动更新的文件名. */ private List autoUpdateFileNames; /** XML文件配置. */ private XmlConfigPath xmlConfigPath; /** 应用程序是否在线(计算值). */ private boolean online; /** 程序运行结果(计算值). */ private ProgramRunResult programRunResult; /** * Gets the 应用程序名称. * * @return the 应用程序名称 */ public String getName() { return name; } /** * Sets the 应用程序名称. * * @param name the new 应用程序名称 */ public void setName(String name) { this.name = name; } /** * Gets the 安装路径. * * @return the 安装路径 */ public String getInstallPath() { return installPath; } /** * Sets the 安装路径. * * @param installPath the new 安装路径 */ public void setInstallPath(String installPath) { this.installPath = installPath; } /** * Gets the 启动程序命令. * * @return the 启动程序命令 */ public String getStartCommand() { return startCommand; } /** * Sets the 启动程序命令. * * @param startCommand the new 启动程序命令 */ public void setStartCommand(String startCommand) { this.startCommand = startCommand; } /** * Gets the 启动程序BAT文件路径. * * @return the 启动程序BAT文件路径 */ public String getStartBatFile() { return startBatFile; } /** * Sets the 启动程序BAT文件路径. * * @param startBatFile the new 启动程序BAT文件路径 */ public void setStartBatFile(String startBatFile) { this.startBatFile = startBatFile; } /** * Gets the 停止程序BAT文件路径. * * @return the 停止程序BAT文件路径 */ public String getStopBatFile() { return stopBatFile; } /** * Sets the 停止程序BAT文件路径. * * @param stopBatFile the new 停止程序BAT文件路径 */ public void setStopBatFile(String stopBatFile) { this.stopBatFile = stopBatFile; } /** * Gets the 监控地址. * * @return the 监控地址 */ public String getMonitorUrl() { return monitorUrl; } /** * Sets the 监控地址. * * @param monitorUrl the new 监控地址 */ public void setMonitorUrl(String monitorUrl) { this.monitorUrl = monitorUrl; } /** * Gets the token. * * @return the token */ public String getToken() { return token; } /** * Sets the token. * * @param token the new token */ public void setToken(String token) { this.token = token; } /** * Gets the 自动更新的文件名. * * @return the 自动更新的文件名 */ public List getAutoUpdateFileNames() { return autoUpdateFileNames; } /** * Sets the 自动更新的文件名. * * @param autoUpdateFileNames the new 自动更新的文件名 */ public void setAutoUpdateFileNames(List autoUpdateFileNames) { this.autoUpdateFileNames = autoUpdateFileNames; } /** * Gets the xML文件配置. * * @return the xML文件配置 */ public XmlConfigPath getXmlConfigPath() { return xmlConfigPath; } /** * Sets the xML文件配置. * * @param xmlConfigPath the new xML文件配置 */ public void setXmlConfigPath(XmlConfigPath xmlConfigPath) { this.xmlConfigPath = xmlConfigPath; } /** * Checks if is 应用程序是否在线(计算值). * * @return the 应用程序是否在线(计算值) */ public boolean isOnline() { return online; } /** * Sets the 应用程序是否在线(计算值). * * @param online the new 应用程序是否在线(计算值) */ public void setOnline(boolean online) { this.online = online; } /** * Gets the 程序运行结果(计算值). * * @return the 程序运行结果(计算值) */ public ProgramRunResult getProgramRunResult() { return programRunResult; } /** * Sets the 程序运行结果(计算值). * * @param programRunResult the new 程序运行结果(计算值) */ public void setProgramRunResult(ProgramRunResult programRunResult) { if(programRunResult == null) { if(this.programRunResult != null) { Process process = this.programRunResult.getProcess(); if(process != null) { CloseableUtil.close(process.getInputStream(), process.getOutputStream(), process.getErrorStream()); process.destroyForcibly(); } } } this.programRunResult = programRunResult; } }