@Service public class SshService extends BaseWorkspaceService<SshModel>
key, tableName, tClass
Constructor and Description |
---|
SshService() |
Modifier and Type | Method and Description |
---|---|
String |
checkCommand(SshModel sshModel,
String command)
获取 ssh 中的 环境 版本
|
boolean |
checkSshRun(SshModel sshModel,
String tag)
检查是否存在正在运行的进程
|
Integer |
checkSshRunPid(SshModel sshModel,
String tag)
检查是否存在正在运行的进程
|
void |
download(SshModel sshModel,
String remoteFile,
File save)
下载文件
|
String |
exec(SshModel sshModel,
BiFunction<String,com.jcraft.jsch.Session,String> function,
String... command)
ssh 执行模版命令
|
String |
exec(SshModel sshModel,
String... command)
ssh 执行模版命令
|
protected void |
fillSelectResult(SshModel data)
查询结果 填充
|
static com.jcraft.jsch.Session |
getSessionByModel(SshModel sshModel)
获取 ssh 回话
|
void |
syncToWorkspace(String ids,
String nowWorkspaceId,
String workspaceId)
将ssh信息同步到其他工作空间
|
void |
uploadDir(SshModel sshModel,
String remotePath,
File desc)
上传文件
|
checkUserWorkspace, checkUserWorkspace, defaultOrders, delByKey, delByWorkspace, fillInsert, getByKey, getByKey, getCheckUserWorkspace, getWorkspaceId, listById, listByWorkspace, listPage, sortMoveDown, sortMoveUp, sortToTop, updateById
autoClear, autoLoopClear, clearTimeColumns, count, count, covetTableName, executeClearImpl, getData, getLastTimeValue, insert, insert, insertNotFill, list, listById, listById, listPage, listPage, parsePage, update, updateById, updateById, upsert
count, count, dataBeanToEntity, del, delByKey, delByKey, entityToBean, entityToBean, entityToBeanList, execute, exists, exists, findByCondition, getByKey, getByKey, getByKey, getKey, getTableName, insert, listByBean, listByEntity, listPageOnlyResult, query, query, queryByBean, queryList, queryList, queryList, update, warpException
protected void fillSelectResult(SshModel data)
BaseDbCommonService
fillSelectResult
in class BaseDbCommonService<SshModel>
data
- 数据public static com.jcraft.jsch.Session getSessionByModel(SshModel sshModel)
sshModel
- sshModelpublic boolean checkSshRun(SshModel sshModel, String tag) throws IOException
sshModel
- sshtag
- 标识IOException
- IOpublic String checkCommand(SshModel sshModel, String command) throws IOException
sshModel
- sshIOException
- IOpublic Integer checkSshRunPid(SshModel sshModel, String tag) throws IOException
sshModel
- sshtag
- 标识IOException
- IOpublic String exec(SshModel sshModel, String... command) throws IOException
sshModel
- sshcommand
- 命令IOException
- iopublic String exec(SshModel sshModel, BiFunction<String,com.jcraft.jsch.Session,String> function, String... command) throws IOException
sshModel
- sshcommand
- 命令IOException
- iopublic void uploadDir(SshModel sshModel, String remotePath, File desc)
sshModel
- sshremotePath
- 远程路径desc
- 文件夹或者文件public void download(SshModel sshModel, String remoteFile, File save) throws IOException, com.jcraft.jsch.SftpException
sshModel
- 实体remoteFile
- 远程文件save
- 文件对象IOException
- iocom.jcraft.jsch.SftpException
- sftpCopyright © 2017–2022. All rights reserved.