@Override public ProvenanceEventRecord getProvenanceEvent(long eventId) { try { return provenanceRepository.getEvent(eventId); } catch (IOException e) { logger.error("Failed to get provenance event for {} due to {}", new Object[]{eventId, e}, e); return null; } }
public ProvenanceEventRecord replayFlowFile(final long provenanceEventRecordId, final NiFiUser user) throws IOException { final ProvenanceEventRecord record = provenanceRepository.getEvent(provenanceEventRecordId, user); if (record == null) { throw new IllegalStateException("Cannot find Provenance Event with ID " + provenanceEventRecordId); } return replayFlowFile(record, user); }
/** * Submits a replay request for the specified event id. * * @param eventId event id * @return provenance event */ public ProvenanceEventDTO submitReplay(final Long eventId) { try { final NiFiUser user = NiFiUserUtils.getNiFiUser(); if (user == null) { throw new WebApplicationException(new Throwable("Unable to access details for current user.")); } // lookup the original event final ProvenanceEventRecord originalEvent = flowController.getProvenanceRepository().getEvent(eventId, user); if (originalEvent == null) { throw new ResourceNotFoundException("Unable to find the specified event."); } // authorize the replay authorizeReplay(originalEvent); // replay the flow file final ProvenanceEventRecord event = flowController.replayFlowFile(originalEvent, user); // convert the event record return createProvenanceEventDto(event, false); } catch (final IOException ioe) { throw new NiFiCoreException("An error occurred while getting the specified event.", ioe); } }
/** * Get the provenance event with the specified event id. * * @param eventId event id * @return the provenance event with the specified event id */ public ProvenanceEventDTO getProvenanceEvent(final Long eventId) { try { final ProvenanceEventRecord event = flowController.getProvenanceRepository().getEvent(eventId, NiFiUserUtils.getNiFiUser()); if (event == null) { throw new ResourceNotFoundException("Unable to find the specified event."); } // convert the event return createProvenanceEventDto(event, false); } catch (final IOException ioe) { throw new NiFiCoreException("An error occurred while getting the specified event.", ioe); } }
final ProvenanceEventRecord event = flowController.getProvenanceRepository().getEvent(eventId, user); if (event == null) { throw new ResourceNotFoundException("Unable to find the specified event.");
@Override public ProvenanceEventRecord getProvenanceEvent(long eventId) { try { return provenanceRepository.getEvent(eventId); } catch (IOException e) { logger.error("Failed to get provenance event for {} due to {}", new Object[]{eventId, e}, e); return null; } }