@Override public String getSourceQueueIdentifier() { return record.getSourceQueueIdentifier(); }
@Override public String getSourceQueueIdentifier() { return event.getSourceQueueIdentifier(); }
if (event.getSourceQueueIdentifier() == null) { return "Cannot replay data from Provenance Event because the event does not specify the Source FlowFile Queue"; FlowFileQueue queue = null; for (final Connection connection : connections) { if (event.getSourceQueueIdentifier().equals(connection.getIdentifier())) { queue = connection.getFlowFileQueue(); break; return "Cannot replay data from Provenance Event because the Source FlowFile Queue with ID " + event.getSourceQueueIdentifier() + " no longer exists";
/** * Authorizes access to replay for a specified provenance event. * * @param event event */ private void authorizeReplay(final ProvenanceEventRecord event) { // if the connection id isn't specified, then the replay wouldn't be available anyways and we have nothing to authorize against so deny it` if (event.getSourceQueueIdentifier() == null) { throw new AccessDeniedException("The connection id in the provenance event is unknown."); } final NiFiUser user = NiFiUserUtils.getNiFiUser(); final Authorizable dataAuthorizable = getDataAuthorizable(event); // ensure we can read and write the data final Map<String, String> eventAttributes = event.getAttributes(); dataAuthorizable.authorize(authorizer, RequestAction.READ, user, eventAttributes); dataAuthorizable.authorize(authorizer, RequestAction.WRITE, user, eventAttributes); }
writeNullableString(out, record.getSourceQueueIdentifier(), "SourceQueueIdentifier");
/** * Authorizes access to replay a specified provenance event. Whether to check read data permission can be specified. The context this * method is invoked may have already verified these permissions. Using a flag here as it forces the caller to acknowledge this fact * limiting the possibility of overlooking it. * * @param event event * @param checkReadDataPermissions whether to verify read data permissions */ private AuthorizationResult checkAuthorizationForReplay(final ProvenanceEventRecord event, final boolean checkReadDataPermissions) { // if the connection id isn't specified, then the replay wouldn't be available anyways and we have nothing to authorize against so deny it` if (event.getSourceQueueIdentifier() == null) { return AuthorizationResult.denied("The connection id in the provenance event is unknown."); } final NiFiUser user = NiFiUserUtils.getNiFiUser(); final Authorizable dataAuthorizable = getDataAuthorizable(event); final Map<String, String> eventAttributes = event.getAttributes(); if (checkReadDataPermissions) { // ensure we can read the data final AuthorizationResult result = dataAuthorizable.checkAuthorization(authorizer, RequestAction.READ, user, eventAttributes); if (!Result.Approved.equals(result.getResult())) { return result; } } // ensure we can write the data; read the data should have been checked already return dataAuthorizable.checkAuthorization(authorizer, RequestAction.WRITE, user, eventAttributes); }
if (event.getSourceQueueIdentifier() == null) { throw new IllegalArgumentException("Cannot replay data from Provenance Event because the event does not specify the Source FlowFile Queue"); FlowFileQueue queue = null; for (final Connection connection : connections) { if (event.getSourceQueueIdentifier().equals(connection.getIdentifier())) { queue = connection.getFlowFileQueue(); break; throw new IllegalStateException("Cannot replay data from Provenance Event because the Source FlowFile Queue with ID " + event.getSourceQueueIdentifier() + " no longer exists");
addField(doc, SearchableFields.ContentClaimContainer, record.getContentClaimContainer()); addField(doc, SearchableFields.ContentClaimIdentifier, record.getContentClaimIdentifier()); addField(doc, SearchableFields.SourceQueueIdentifier, record.getSourceQueueIdentifier()); addField(doc, SearchableFields.TransitURI, record.getTransitUri());
dto.setReplayExplanation(contentAvailability.isReplayable() && !Result.Approved.equals(replayAuthorized.getResult()) ? replayAuthorized.getExplanation() : contentAvailability.getReasonNotReplayable()); dto.setSourceConnectionIdentifier(event.getSourceQueueIdentifier()); } else { dto.setReplayAvailable(false);
return event.getRelationship(); case EventFieldNames.SOURCE_QUEUE_IDENTIFIER: return createLookupValue(event.getSourceQueueIdentifier(), queueIdMap); case EventFieldNames.SOURCE_SYSTEM_FLOWFILE_IDENTIFIER: return event.getSourceSystemFlowFileIdentifier();
return event.getRelationship(); case EventFieldNames.SOURCE_QUEUE_IDENTIFIER: return event.getSourceQueueIdentifier(); case EventFieldNames.SOURCE_SYSTEM_FLOWFILE_IDENTIFIER: return event.getSourceSystemFlowFileIdentifier();
previousSize = event.getPreviousFileSize(); sourceQueueIdentifier = event.getSourceQueueIdentifier();
previousSize = event.getPreviousFileSize(); sourceQueueIdentifier = event.getSourceQueueIdentifier();