return;
}
log.info("Deleting scan with ID " + scan.getId());
ChannelType type = scan.getApplicationChannel().getChannelType();
if (scan.getApplication().getRemoteProviderApplications() != null) {
for (RemoteProviderApplication app : scan.getApplication().getRemoteProviderApplications()) {
if (app != null && app.getRemoteProviderType() != null &&
app.getRemoteProviderType().getChannelType() != null &&
app.getRemoteProviderType().getChannelType().getId() != null &&
app.getRemoteProviderType().getChannelType().getId().equals(type.getId()) &&
app.getLastImportTime() != null && scan.getImportTime() != null &&
app.getLastImportTime().equals(scan.getImportTime()) &&
app.getApplicationChannel() != null && app.getApplicationChannel().getScanList() != null){
// This means that we are deleting the last scan for the importer and that we need to update the
// last import time so that we can import more scans.