Search in sources :

Example 1 with FileTransferNotifyDTO

use of com.orion.ops.entity.dto.FileTransferNotifyDTO in project orion-ops by lijiahangmax.

the class TransferProcessorManager method notifySessionStatusEvent.

/**
 * 通知session 状态事件
 *
 * @param userId    userId
 * @param machineId machineId
 * @param fileToken fileToken
 * @param status    status
 */
public void notifySessionStatusEvent(Long userId, Long machineId, String fileToken, Integer status) {
    // 清除进度
    TRANSFER_PROGRESS.remove(fileToken);
    // 通知
    FileTransferNotifyDTO notify = new FileTransferNotifyDTO();
    notify.setType(SftpNotifyType.CHANGE_STATUS.getType());
    notify.setFileToken(fileToken);
    notify.setBody(status);
    this.notifySession(userId, machineId, notify);
}
Also used : FileTransferNotifyDTO(com.orion.ops.entity.dto.FileTransferNotifyDTO)

Example 2 with FileTransferNotifyDTO

use of com.orion.ops.entity.dto.FileTransferNotifyDTO in project orion-ops by lijiahangmax.

the class TransferProcessorManager method notifySessionAddEvent.

/**
 * 通知session 添加事件
 *
 * @param userId    userId
 * @param machineId machineId
 * @param fileToken fileToken
 * @param record    record
 */
public void notifySessionAddEvent(Long userId, Long machineId, String fileToken, FileTransferLogDO record) {
    FileTransferNotifyDTO notify = new FileTransferNotifyDTO();
    notify.setType(SftpNotifyType.ADD.getType());
    notify.setFileToken(fileToken);
    notify.setBody(Jsons.toJsonWriteNull(Converts.to(record, FileTransferLogVO.class)));
    this.notifySession(userId, machineId, notify);
}
Also used : FileTransferNotifyDTO(com.orion.ops.entity.dto.FileTransferNotifyDTO)

Example 3 with FileTransferNotifyDTO

use of com.orion.ops.entity.dto.FileTransferNotifyDTO in project orion-ops by lijiahangmax.

the class TransferProcessorManager method notifySessionProgressEvent.

/**
 * 通知session 进度事件
 *
 * @param userId    userId
 * @param machineId machineId
 * @param fileToken fileToken
 * @param progress  progress
 */
public void notifySessionProgressEvent(Long userId, Long machineId, String fileToken, FileTransferNotifyDTO.FileTransferNotifyProgress progress) {
    // 设置进度
    TRANSFER_PROGRESS.put(fileToken, progress.getProgress());
    // 通知
    FileTransferNotifyDTO notify = new FileTransferNotifyDTO();
    notify.setType(SftpNotifyType.PROGRESS.getType());
    notify.setFileToken(fileToken);
    notify.setBody(Jsons.toJsonWriteNull(progress));
    this.notifySession(userId, machineId, notify);
}
Also used : FileTransferNotifyDTO(com.orion.ops.entity.dto.FileTransferNotifyDTO)

Aggregations

FileTransferNotifyDTO (com.orion.ops.entity.dto.FileTransferNotifyDTO)3