Package org.qubership.atp.ram.services
Class GridFsService
java.lang.Object
org.qubership.atp.ram.services.GridFsService
-
Constructor Summary
ConstructorsConstructorDescriptionGridFsService(GridFsRepository repository, LogRecordRepository lrRepository) -
Method Summary
Modifier and TypeMethodDescriptionvoidDelete files which created earlier than expired period.downloadFile(UUID logRecordId) Find file in storage and return its data.downloadFileByName(UUID logRecordId, String filename) Find file in storage and return its data.downloadFileIntoString(UUID logRecordId) Find file in storage and return its data as string.downloadFileIntoStringByName(UUID logRecordId, String filename) Find file in storage and return its data as string.downloadFilesByLogRecords(List<LogRecord> logRecords) intgetCountScreen(List<LogRecord> logRecords) Get count of screenshots for TR.getReportById(UUID reportId) getScreenShot(UUID logRecordId) Method gets screenshot or snapshot from GridFs, thruGridFsRepository.getFileData(UUID)ScreenShot as Base64 or Snapshot in case it present in database.voidremoveFilesByRecordUuidList(List<UUID> logRecordUuidList) save(String image, String creationTime, String contentType, UUID logRecordId, InputStream inputStream, String fileName, String snapshotSource) save(String type, String creationTime, String contentType, UUID logRecordId, String content, String fileName) Store string content in gridFs repository.save(String type, String creationTime, String contentType, UUID logRecordId, UUID testRunId, String content, String fileName) Store string content in gridFs repository.voidsaveMandatoryChecksReport(UUID reportId, UUID executionRequestId, InputStream fileInputStream, String fileName) Save mandatory checks report.saveSsmMetricReport(String fileName, String type, String contentType, InputStream inputStream, UUID executionRequestId, UUID logRecordId) Upload SSM metrics report file into GridFS storage.
-
Constructor Details
-
GridFsService
-
-
Method Details
-
getScreenShot
Method gets screenshot or snapshot from GridFs, thruGridFsRepository.getFileData(UUID)ScreenShot as Base64 or Snapshot in case it present in database.- Parameters:
logRecordId- of step, which for you would like get ScreenShot- Returns:
- empty string if ScreenShot/Snapshot isn't present in db. Else - ScreenShot as Base64 or Snapshot
-
downloadFile
Find file in storage and return its data.- Parameters:
logRecordId- if of logRecord- Returns:
- data of the file
-
downloadFileIntoString
Find file in storage and return its data as string.- Parameters:
logRecordId- related with file- Returns:
- data of the file as string
-
downloadFileByName
Find file in storage and return its data.- Parameters:
logRecordId- if of logRecord- Returns:
- data of the file
-
downloadFileIntoStringByName
Find file in storage and return its data as string.- Parameters:
logRecordId- if of logRecord- Returns:
- data of the file as string
-
downloadFilesByLogRecords
-
removeFilesByRecordUuidList
-
save
-
save
public String save(String type, String creationTime, String contentType, UUID logRecordId, String content, String fileName) Store string content in gridFs repository.- Parameters:
type- Source type.creationTime- Save date.contentType- Source content type.logRecordId- LogRecord id.content- Stored content..fileName- File name.- Returns:
- File id.
-
save
public String save(String type, String creationTime, String contentType, UUID logRecordId, UUID testRunId, String content, String fileName) Store string content in gridFs repository.- Parameters:
type- Source typecreationTime- Save datecontentType- Source content typelogRecordId- LogRecord idtestRunId- TestRun idcontent- Stored contentfileName- File name- Returns:
- String object id of created file.
-
getReportById
- Throws:
FileNotFoundException
-
saveMandatoryChecksReport
public void saveMandatoryChecksReport(UUID reportId, UUID executionRequestId, InputStream fileInputStream, String fileName) Save mandatory checks report.- Parameters:
executionRequestId- execution request identifierfileInputStream- file input streamfileName- file name
-
getCountScreen
Get count of screenshots for TR.- Parameters:
logRecords- all LogRecords from TR.- Returns:
- count of screenshots.
-
deleteExpiredFiles
public void deleteExpiredFiles()Delete files which created earlier than expired period. -
saveSsmMetricReport
public UUID saveSsmMetricReport(String fileName, String type, String contentType, InputStream inputStream, UUID executionRequestId, UUID logRecordId) Upload SSM metrics report file into GridFS storage.
-