Given I have the following Map
and call to writeMetadata(...)
:
Map<Report, TransferStatus> transferStatusMap = sftpService.transfer(reportDeliverables);
dbMetadataWriter.writeMetadata(successReports);
ENUM
as:
public enum TransferStatus {
SUCCESS,
FAILURE
}
Firstly, how can I create the successReport
list with all Report
with status TransferStatus.SUCCESS
with Java 8?
Secondly, before call to dbMetadataWriter.writeMetadata(successReports);
there should be a check to see if any values with success exist.
and finally, in general how should failed transfers be handled? Practically, what is best practice?