| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- /*
- *
- */
- 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<String> 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<String> getAutoUpdateFileNames() {
- return autoUpdateFileNames;
- }
- /**
- * Sets the 自动更新的文件名.
- *
- * @param autoUpdateFileNames the new 自动更新的文件名
- */
- public void setAutoUpdateFileNames(List<String> 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;
- }
- }
|