Search in sources :

Example 1 with DeployLogService

use of com.ibeiliao.deployment.admin.service.server.DeployLogService in project Corgi by kevinYin.

the class LogMessageProcessor method readLogs.

private List<ShellLogResponseMessage.ServerShellLog> readLogs(ShellLogRequestMessage request) {
    List<ShellLogResponseMessage.ServerShellLog> shellLogList = new ArrayList<>();
    DeployLogService deployLogService = SpringContextUtil.getBean(DeployLogService.class);
    StringBuilder sb = new StringBuilder(1024);
    for (Integer id : request.getServerDeployIdList()) {
        List<ServerDeployLog> list = deployLogService.getServerDeployLog(id);
        if (!CollectionUtils.isEmpty(list)) {
            sb.setLength(0);
            ShellLogResponseMessage.ServerShellLog log = new ShellLogResponseMessage.ServerShellLog();
            log.setServerDeployId(id);
            for (ServerDeployLog temp : list) {
                sb.append(temp.getShellLog()).append("\n");
            }
            log.setLog(sb.toString());
            shellLogList.add(log);
        }
    }
    return shellLogList;
}
Also used : ServerDeployLog(com.ibeiliao.deployment.admin.vo.server.ServerDeployLog) DeployLogService(com.ibeiliao.deployment.admin.service.server.DeployLogService) ArrayList(java.util.ArrayList) ShellLogResponseMessage(com.ibeiliao.deployment.admin.websocket.request.ShellLogResponseMessage)

Aggregations

DeployLogService (com.ibeiliao.deployment.admin.service.server.DeployLogService)1 ServerDeployLog (com.ibeiliao.deployment.admin.vo.server.ServerDeployLog)1 ShellLogResponseMessage (com.ibeiliao.deployment.admin.websocket.request.ShellLogResponseMessage)1 ArrayList (java.util.ArrayList)1