@Test public void testGetActionApprovedThroughAction() throws Exception { final Authentication authentication = new NiFiAuthenticationToken(new NiFiUserDetails(new Builder().identity(USER_1).build())); SecurityContextHolder.getContext().setAuthentication(authentication); final ActionEntity entity = serviceFacade.getAction(ACTION_ID_1); assertEquals(ACTION_ID_1, entity.getId()); assertTrue(entity.getCanRead()); verify(authorizer, times(1)).authorize(argThat(new ArgumentMatcher<AuthorizationRequest>() { @Override public boolean matches(Object o) { return ((AuthorizationRequest) o).getResource().getIdentifier().endsWith(PROCESSOR_ID_1); } })); verify(authorizer, times(0)).authorize(argThat(new ArgumentMatcher<AuthorizationRequest>() { @Override public boolean matches(Object o) { return ((AuthorizationRequest) o).getResource().equals(ResourceFactory.getControllerResource()); } })); }
@Override public ActionEntity getAction(final Integer actionId) { final Action action = auditService.getAction(actionId); if (action == null) { throw new ResourceNotFoundException(String.format("Unable to find action with id '%s'.", actionId)); } final AuthorizationResult result = authorizeAction(action); final boolean authorized = Result.Approved.equals(result.getResult()); if (!authorized) { throw new AccessDeniedException(result.getExplanation()); } return entityFactory.createActionEntity(dtoFactory.createActionDto(action), authorized); }
StandardNiFiServiceFacade implements NiFiServiceFacade { @Override public ActionEntity getAction(final Integer actionId) { final Action action = auditService.getAction(actionId); if (action == null) { throw new ResourceNotFoundException(String.format("Unable to find action with id '%s'.", actionId)); } final AuthorizationResult result = authorizeAction(action); final boolean authorized = Result.Approved.equals(result.getResult()); if (!authorized) { throw new AccessDeniedException(result.getExplanation()); } return entityFactory.createActionEntity(dtoFactory.createActionDto(action), authorized); } }
StandardNiFiServiceFacade implements NiFiServiceFacade { @Override public ActionEntity getAction(final Integer actionId) { final Action action = auditService.getAction(actionId); if (action == null) { throw new ResourceNotFoundException(String.format("Unable to find action with id '%s'.", actionId)); } final AuthorizationResult result = authorizeAction(action); final boolean authorized = Result.Approved.equals(result.getResult()); if (!authorized) { throw new AccessDeniedException(result.getExplanation()); } return entityFactory.createActionEntity(dtoFactory.createActionDto(action), authorized); }  }
StandardNiFiServiceFacade implements NiFiServiceFacade { @Override public ActionEntity getAction(final Integer actionId) { final Action action = auditService.getAction(actionId); if (action == null) { throw new ResourceNotFoundException(String.format("Unable to find action with id '%s'.", actionId)); } final AuthorizationResult result = authorizeAction(action); final boolean authorized = Result.Approved.equals(result.getResult()); if (!authorized) { throw new AccessDeniedException(result.getExplanation()); } return entityFactory.createActionEntity(dtoFactory.createActionDto(action), authorized); }  @Override void authorizeAccess(final AuthorizeAccess authorizeAccess); @Override void verifyRevision(final Revision revision, final NiFiUser user); @Override void verifyRevisions(final Set<Revision> revisions, final NiFiUser user); @Override Set<Revision> getRevisionsFromGroup(final String groupId, final Function<ProcessGroup, Set<String>> getComponents); @Override Set<Revision> getRevisionsFromSnippet(final String snippetId); @Override void verifyListQueue(final String connectionId); @Override void verifyCreateConnection(final String groupId, final ConnectionDTO connectionDTO); @Override void verifyUpdateConnection(final ConnectionDTO connectionDTO); @Override void verifyDeleteConnection(final String connectionId); @Override void verifyDeleteFunnel(final String funnelId); @Override void verifyUpdateInputPort(final PortDTO inputPortDTO); @Override void verifyDeleteInputPort(final String inputPortId); @Override void verifyUpdateOutputPort(final PortDTO outputPortDTO); @Override void verifyDeleteOutputPort(final String outputPortId); @Override void verifyCreateProcessor(ProcessorDTO processorDTO); @Override void verifyUpdateProcessor(final ProcessorDTO processorDTO); @Override void verifyDeleteProcessor(final String processorId); @Override void verifyScheduleComponents(final String groupId, final ScheduledState state, final Set<String> componentIds); @Override void verifyEnableComponents(String processGroupId, ScheduledState state, Set<String> componentIds); @Override void verifyActivateControllerServices(final String groupId, final ControllerServiceState state, final Collection<String> serviceIds); @Override void verifyDeleteProcessGroup(final String groupId); @Override void verifyUpdateRemoteProcessGroup(final RemoteProcessGroupDTO remoteProcessGroupDTO); @Override void verifyUpdateRemoteProcessGroupInputPort(final String remoteProcessGroupId, final RemoteProcessGroupPortDTO remoteProcessGroupPortDTO); @Override void verifyUpdateRemoteProcessGroupOutputPort(final String remoteProcessGroupId, final RemoteProcessGroupPortDTO remoteProcessGroupPortDTO); @Override void verifyDeleteRemoteProcessGroup(final String remoteProcessGroupId); @Override void verifyCreateControllerService(ControllerServiceDTO controllerServiceDTO); @Override void verifyUpdateControllerService(final ControllerServiceDTO controllerServiceDTO); @Override void verifyUpdateControllerServiceReferencingComponents(final String controllerServiceId, final ScheduledState scheduledState, final ControllerServiceState controllerServiceState); @Override void verifyDeleteControllerService(final String controllerServiceId); @Override void verifyCreateReportingTask(ReportingTaskDTO reportingTaskDTO); @Override void verifyUpdateReportingTask(final ReportingTaskDTO reportingTaskDTO); @Override void verifyDeleteReportingTask(final String reportingTaskId); @Override AccessPolicyEntity updateAccessPolicy(final Revision revision, final AccessPolicyDTO accessPolicyDTO); @Override UserEntity updateUser(final Revision revision, final UserDTO userDTO); @Override UserGroupEntity updateUserGroup(final Revision revision, final UserGroupDTO userGroupDTO); @Override ConnectionEntity updateConnection(final Revision revision, final ConnectionDTO connectionDTO); @Override ProcessorEntity updateProcessor(final Revision revision, final ProcessorDTO processorDTO); @Override LabelEntity updateLabel(final Revision revision, final LabelDTO labelDTO); @Override FunnelEntity updateFunnel(final Revision revision, final FunnelDTO funnelDTO); @Override void verifyUpdateSnippet(final SnippetDTO snippetDto, final Set<String> affectedComponentIds); @Override SnippetEntity updateSnippet(final Set<Revision> revisions, final SnippetDTO snippetDto); @Override PortEntity updateInputPort(final Revision revision, final PortDTO inputPortDTO); @Override PortEntity updateOutputPort(final Revision revision, final PortDTO outputPortDTO); @Override RemoteProcessGroupEntity updateRemoteProcessGroup(final Revision revision, final RemoteProcessGroupDTO remoteProcessGroupDTO); @Override RemoteProcessGroupPortEntity updateRemoteProcessGroupInputPort(
            final Revision revision, final String remoteProcessGroupId, final RemoteProcessGroupPortDTO remoteProcessGroupPortDTO); @Override RemoteProcessGroupPortEntity updateRemoteProcessGroupOutputPort(
            final Revision revision, final String remoteProcessGroupId, final RemoteProcessGroupPortDTO remoteProcessGroupPortDTO); @Override Set<AffectedComponentDTO> getActiveComponentsAffectedByVariableRegistryUpdate(final VariableRegistryDTO variableRegistryDto); @Override Set<AffectedComponentEntity> getComponentsAffectedByVariableRegistryUpdate(final VariableRegistryDTO variableRegistryDto); @Override VariableRegistryEntity updateVariableRegistry(Revision revision, VariableRegistryDTO variableRegistryDto); @Override ProcessGroupEntity updateProcessGroup(final Revision revision, final ProcessGroupDTO processGroupDTO); @Override void verifyUpdateProcessGroup(ProcessGroupDTO processGroupDTO); @Override ScheduleComponentsEntity enableComponents(String processGroupId, ScheduledState state, Map<String, Revision> componentRevisions); @Override ScheduleComponentsEntity scheduleComponents(final String processGroupId, final ScheduledState state, final Map<String, Revision> componentRevisions); @Override ActivateControllerServicesEntity activateControllerServices(final String processGroupId, final ControllerServiceState state, final Map<String, Revision> serviceRevisions); @Override ControllerConfigurationEntity updateControllerConfiguration(final Revision revision, final ControllerConfigurationDTO controllerConfigurationDTO); @Override NodeDTO updateNode(final NodeDTO nodeDTO); @Override CounterDTO updateCounter(final String counterId); @Override void verifyCanClearProcessorState(final String processorId); @Override void clearProcessorState(final String processorId); @Override void verifyCanClearControllerServiceState(final String controllerServiceId); @Override void clearControllerServiceState(final String controllerServiceId); @Override void verifyCanClearReportingTaskState(final String reportingTaskId); @Override void clearReportingTaskState(final String reportingTaskId); @Override ConnectionEntity deleteConnection(final Revision revision, final String connectionId); @Override DropRequestDTO deleteFlowFileDropRequest(final String connectionId, final String dropRequestId); @Override ListingRequestDTO deleteFlowFileListingRequest(final String connectionId, final String listingRequestId); @Override ProcessorEntity deleteProcessor(final Revision revision, final String processorId); @Override ProcessorEntity terminateProcessor(final String processorId); @Override void verifyTerminateProcessor(final String processorId); @Override LabelEntity deleteLabel(final Revision revision, final String labelId); @Override UserEntity deleteUser(final Revision revision, final String userId); @Override UserGroupEntity deleteUserGroup(final Revision revision, final String userGroupId); @Override AccessPolicyEntity deleteAccessPolicy(final Revision revision, final String accessPolicyId); @Override FunnelEntity deleteFunnel(final Revision revision, final String funnelId); @Override void verifyDeleteSnippet(final String snippetId, final Set<String> affectedComponentIds); @Override SnippetEntity deleteSnippet(final Set<Revision> revisions, final String snippetId); @Override PortEntity deleteInputPort(final Revision revision, final String inputPortId); @Override PortEntity deleteOutputPort(final Revision revision, final String outputPortId); @Override ProcessGroupEntity deleteProcessGroup(final Revision revision, final String groupId); @Override RemoteProcessGroupEntity deleteRemoteProcessGroup(final Revision revision, final String remoteProcessGroupId); @Override void deleteTemplate(final String id); @Override ConnectionEntity createConnection(final Revision revision, final String groupId, final ConnectionDTO connectionDTO); @Override DropRequestDTO createFlowFileDropRequest(final String connectionId, final String dropRequestId); @Override ListingRequestDTO createFlowFileListingRequest(final String connectionId, final String listingRequestId); @Override ProcessorEntity createProcessor(final Revision revision, final String groupId, final ProcessorDTO processorDTO); @Override LabelEntity createLabel(final Revision revision, final String groupId, final LabelDTO labelDTO); @Override BulletinEntity createBulletin(final BulletinDTO bulletinDTO, final Boolean canRead); @Override FunnelEntity createFunnel(final Revision revision, final String groupId, final FunnelDTO funnelDTO); @Override AccessPolicyEntity createAccessPolicy(final Revision revision, final AccessPolicyDTO accessPolicyDTO); @Override UserEntity createUser(final Revision revision, final UserDTO userDTO); @Override UserGroupEntity createUserGroup(final Revision revision, final UserGroupDTO userGroupDTO); @Override FlowEntity copySnippet(final String groupId, final String snippetId, final Double originX, final Double originY, final String idGenerationSeed); @Override SnippetEntity createSnippet(final SnippetDTO snippetDTO); @Override PortEntity createInputPort(final Revision revision, final String groupId, final PortDTO inputPortDTO); @Override PortEntity createOutputPort(final Revision revision, final String groupId, final PortDTO outputPortDTO); @Override ProcessGroupEntity createProcessGroup(final Revision revision, final String parentGroupId, final ProcessGroupDTO processGroupDTO); @Override RemoteProcessGroupEntity createRemoteProcessGroup(final Revision revision, final String groupId, final RemoteProcessGroupDTO remoteProcessGroupDTO); @Override boolean isRemoteGroupPortConnected(final String remoteProcessGroupId, final String remotePortId); @Override void verifyCanAddTemplate(String groupId, String name); @Override void verifyComponentTypes(FlowSnippetDTO snippet); @Override void verifyComponentTypes(final VersionedProcessGroup versionedGroup); @Override void verifyImportProcessGroup(final VersionControlInformationDTO versionControlInfo, final VersionedProcessGroup contents, final String groupId); @Override TemplateDTO createTemplate(final String name, final String description, final String snippetId, final String groupId, final Optional<String> idGenerationSeed); @Override TemplateDTO importTemplate(final TemplateDTO templateDTO, final String groupId, final Optional<String> idGenerationSeed); @Override FlowEntity createTemplateInstance(final String groupId, final Double originX, final Double originY, final String templateEncodingVersion,
                                             final FlowSnippetDTO requestSnippet, final String idGenerationSeed); @Override ControllerServiceEntity createControllerService(final Revision revision, final String groupId, final ControllerServiceDTO controllerServiceDTO); @Override ControllerServiceEntity updateControllerService(final Revision revision, final ControllerServiceDTO controllerServiceDTO); @Override ControllerServiceReferencingComponentsEntity updateControllerServiceReferencingComponents(
            final Map<String, Revision> referenceRevisions, final String controllerServiceId, final ScheduledState scheduledState, final ControllerServiceState controllerServiceState); @Override ControllerServiceEntity deleteControllerService(final Revision revision, final String controllerServiceId); @Override RegistryClientEntity createRegistryClient(Revision revision, RegistryDTO registryDTO); @Override RegistryClientEntity getRegistryClient(final String registryId); @Override Set<RegistryClientEntity> getRegistryClients(); @Override Set<RegistryEntity> getRegistriesForUser(final NiFiUser user); @Override Set<BucketEntity> getBucketsForUser(final String registryId, final NiFiUser user); @Override Set<VersionedFlowEntity> getFlowsForUser(String registryId, String bucketId, NiFiUser user); @Override Set<VersionedFlowSnapshotMetadataEntity> getFlowVersionsForUser(String registryId, String bucketId, String flowId, NiFiUser user); @Override RegistryClientEntity updateRegistryClient(Revision revision, RegistryDTO registryDTO); @Override void verifyDeleteRegistry(String registryId); @Override RegistryClientEntity deleteRegistryClient(final Revision revision, final String registryId); @Override ReportingTaskEntity createReportingTask(final Revision revision, final ReportingTaskDTO reportingTaskDTO); @Override ReportingTaskEntity updateReportingTask(final Revision revision, final ReportingTaskDTO reportingTaskDTO); @Override ReportingTaskEntity deleteReportingTask(final Revision revision, final String reportingTaskId); @Override void deleteActions(final Date endDate); @Override ProvenanceDTO submitProvenance(final ProvenanceDTO query); @Override void deleteProvenance(final String queryId); @Override LineageDTO submitLineage(final LineageDTO lineage); @Override void deleteLineage(final String lineageId); @Override ProvenanceEventDTO submitReplay(final Long eventId); @Override SearchResultsDTO searchController(final String query); @Override DownloadableContent getContent(final String connectionId, final String flowFileUuid, final String uri); @Override DownloadableContent getContent(final Long eventId, final String uri, final ContentDirection contentDirection); @Override ProvenanceDTO getProvenance(final String queryId, final Boolean summarize, final Boolean incrementalResults); @Override LineageDTO getLineage(final String lineageId); @Override ProvenanceOptionsDTO getProvenanceSearchOptions(); @Override ProvenanceEventDTO getProvenanceEvent(final Long id); @Override ProcessGroupStatusEntity getProcessGroupStatus(final String groupId, final boolean recursive); @Override ControllerStatusDTO getControllerStatus(); @Override ComponentStateDTO getProcessorState(final String processorId); @Override ComponentStateDTO getControllerServiceState(final String controllerServiceId); @Override ComponentStateDTO getReportingTaskState(final String reportingTaskId); @Override CountersDTO getCounters(); @Override Set<ConnectionEntity> getConnections(final String groupId); @Override ConnectionEntity getConnection(final String connectionId); @Override DropRequestDTO getFlowFileDropRequest(final String connectionId, final String dropRequestId); @Override ListingRequestDTO getFlowFileListingRequest(final String connectionId, final String listingRequestId); @Override FlowFileDTO getFlowFile(final String connectionId, final String flowFileUuid); @Override ConnectionStatusEntity getConnectionStatus(final String connectionId); @Override StatusHistoryEntity getConnectionStatusHistory(final String connectionId); @Override Set<ProcessorEntity> getProcessors(final String groupId, final boolean includeDescendants); @Override TemplateDTO exportTemplate(final String id); @Override TemplateDTO getTemplate(final String id); @Override Set<TemplateEntity> getTemplates(); @Override Set<DocumentedTypeDTO> getWorkQueuePrioritizerTypes(); @Override Set<DocumentedTypeDTO> getProcessorTypes(final String bundleGroup, final String bundleArtifact, final String type); @Override Set<DocumentedTypeDTO> getControllerServiceTypes(final String serviceType, final String serviceBundleGroup, final String serviceBundleArtifact, final String serviceBundleVersion,
                                                            final String bundleGroup, final String bundleArtifact, final String type); @Override Set<DocumentedTypeDTO> getReportingTaskTypes(final String bundleGroup, final String bundleArtifact, final String type); @Override ProcessorEntity getProcessor(final String id); @Override PropertyDescriptorDTO getProcessorPropertyDescriptor(final String id, final String property); @Override ProcessorStatusEntity getProcessorStatus(final String id); @Override StatusHistoryEntity getProcessorStatusHistory(final String id); @Override BulletinBoardDTO getBulletinBoard(final BulletinQueryDTO query); @Override SystemDiagnosticsDTO getSystemDiagnostics(); @Override List<ResourceDTO> getResources(); @Override ControllerDTO getSiteToSiteDetails(); @Override ControllerConfigurationEntity getControllerConfiguration(); @Override ControllerBulletinsEntity getControllerBulletins(); @Override FlowConfigurationEntity getFlowConfiguration(); @Override AccessPolicyEntity getAccessPolicy(final String accessPolicyId); @Override AccessPolicyEntity getAccessPolicy(final RequestAction requestAction, final String resource); @Override UserEntity getUser(final String userId); @Override Set<UserEntity> getUsers(); @Override UserGroupEntity getUserGroup(final String userGroupId); @Override Set<UserGroupEntity> getUserGroups(); @Override Set<LabelEntity> getLabels(final String groupId); @Override LabelEntity getLabel(final String labelId); @Override Set<FunnelEntity> getFunnels(final String groupId); @Override FunnelEntity getFunnel(final String funnelId); @Override Set<PortEntity> getInputPorts(final String groupId); @Override Set<PortEntity> getOutputPorts(final String groupId); @Override Set<ProcessGroupEntity> getProcessGroups(final String parentGroupId); @Override Set<RemoteProcessGroupEntity> getRemoteProcessGroups(final String groupId); @Override PortEntity getInputPort(final String inputPortId); @Override PortStatusEntity getInputPortStatus(final String inputPortId); @Override PortEntity getOutputPort(final String outputPortId); @Override PortStatusEntity getOutputPortStatus(final String outputPortId); @Override RemoteProcessGroupEntity getRemoteProcessGroup(final String remoteProcessGroupId); @Override RemoteProcessGroupStatusEntity getRemoteProcessGroupStatus(final String id); @Override StatusHistoryEntity getRemoteProcessGroupStatusHistory(final String id); @Override CurrentUserEntity getCurrentUser(); @Override ProcessGroupFlowEntity getProcessGroupFlow(final String groupId); @Override ProcessGroupEntity getProcessGroup(final String groupId); @Override VariableRegistryEntity getVariableRegistry(final String groupId, final boolean includeAncestorGroups); @Override VariableRegistryEntity populateAffectedComponents(final VariableRegistryDTO variableRegistryDto); @Override Set<ControllerServiceEntity> getControllerServices(final String groupId, final boolean includeAncestorGroups, final boolean includeDescendantGroups); @Override ControllerServiceEntity getControllerService(final String controllerServiceId); @Override PropertyDescriptorDTO getControllerServicePropertyDescriptor(final String id, final String property); @Override ControllerServiceReferencingComponentsEntity getControllerServiceReferencingComponents(final String controllerServiceId); @Override Set<ReportingTaskEntity> getReportingTasks(); @Override ReportingTaskEntity getReportingTask(final String reportingTaskId); @Override PropertyDescriptorDTO getReportingTaskPropertyDescriptor(final String id, final String property); @Override StatusHistoryEntity getProcessGroupStatusHistory(final String groupId); @Override VersionControlComponentMappingEntity registerFlowWithFlowRegistry(final String groupId, final StartVersionControlRequestEntity requestEntity); @Override VersionedFlow deleteVersionedFlow(final String registryId, final String bucketId, final String flowId); @Override VersionControlInformationEntity getVersionControlInformation(final String groupId); @Override FlowComparisonEntity getLocalModifications(final String processGroupId); @Override VersionedFlow registerVersionedFlow(final String registryId, final VersionedFlow flow); @Override VersionedFlowSnapshot registerVersionedFlowSnapshot(final String registryId, final VersionedFlow flow,
        final VersionedProcessGroup snapshot, final String comments, final int expectedVersion); @Override VersionControlInformationEntity setVersionControlInformation(final Revision revision, final String processGroupId,
            final VersionControlInformationDTO versionControlInfo, final Map<String, String> versionedComponentMapping); @Override VersionControlInformationEntity deleteVersionControl(final Revision revision, final String processGroupId); @Override void verifyCanUpdate(final String groupId, final VersionedFlowSnapshot proposedFlow, final boolean verifyConnectionRemoval, final boolean verifyNotDirty); @Override void verifyCanSaveToFlowRegistry(final String groupId, final String registryId, final String bucketId, final String flowId); @Override void verifyCanRevertLocalModifications(final String groupId, final VersionedFlowSnapshot versionedFlowSnapshot); @Override Set<AffectedComponentEntity> getComponentsAffectedByVersionChange(final String processGroupId, final VersionedFlowSnapshot updatedSnapshot); @Override VersionedFlowSnapshot getVersionedFlowSnapshot(final VersionControlInformationDTO versionControlInfo, final boolean fetchRemoteFlows); @Override String getFlowRegistryName(final String flowRegistryId); @Override ProcessGroupEntity updateProcessGroupContents(final Revision revision, final String groupId, final VersionControlInformationDTO versionControlInfo,
        final VersionedFlowSnapshot proposedFlowSnapshot, final String componentIdSeed, final boolean verifyNotModified, final boolean updateSettings, final boolean updateDescendantVersionedFlows); @Override HistoryDTO getActions(final HistoryQueryDTO historyQueryDto); @Override ActionEntity getAction(final Integer actionId); @Override ComponentHistoryDTO getComponentHistory(final String componentId); @Override ProcessorDiagnosticsEntity getProcessorDiagnostics(final String id); @Override boolean isClustered(); @Override String getNodeId(); @Override ClusterDTO getCluster(); @Override NodeDTO getNode(final String nodeId); @Override void deleteNode(final String nodeId); void setProperties(final NiFiProperties properties); void setControllerFacade(final ControllerFacade controllerFacade); void setRemoteProcessGroupDAO(final RemoteProcessGroupDAO remoteProcessGroupDAO); void setLabelDAO(final LabelDAO labelDAO); void setFunnelDAO(final FunnelDAO funnelDAO); void setSnippetDAO(final SnippetDAO snippetDAO); void setProcessorDAO(final ProcessorDAO processorDAO); void setConnectionDAO(final ConnectionDAO connectionDAO); void setAuditService(final AuditService auditService); void setRevisionManager(final RevisionManager revisionManager); void setDtoFactory(final DtoFactory dtoFactory); void setEntityFactory(final EntityFactory entityFactory); void setInputPortDAO(final PortDAO inputPortDAO); void setOutputPortDAO(final PortDAO outputPortDAO); void setProcessGroupDAO(final ProcessGroupDAO processGroupDAO); void setControllerServiceDAO(final ControllerServiceDAO controllerServiceDAO); void setReportingTaskDAO(final ReportingTaskDAO reportingTaskDAO); void setTemplateDAO(final TemplateDAO templateDAO); void setSnippetUtils(final SnippetUtils snippetUtils); void setAuthorizableLookup(final AuthorizableLookup authorizableLookup); void setAuthorizer(final Authorizer authorizer); void setUserDAO(final UserDAO userDAO); void setUserGroupDAO(final UserGroupDAO userGroupDAO); void setAccessPolicyDAO(final AccessPolicyDAO accessPolicyDAO); void setClusterCoordinator(final ClusterCoordinator coordinator); void setHeartbeatMonitor(final HeartbeatMonitor heartbeatMonitor); void setBulletinRepository(final BulletinRepository bulletinRepository); void setLeaderElectionManager(final LeaderElectionManager leaderElectionManager); void setRegistryDAO(RegistryDAO registryDao); void setFlowRegistryClient(FlowRegistryClient flowRegistryClient); void setAppStateNotifyService(AppStateNotifyService appStateNotifyService); }
StandardNiFiServiceFacade implements NiFiServiceFacade { @Override public ActionEntity getAction(final Integer actionId) { final Action action = auditService.getAction(actionId); if (action == null) { throw new ResourceNotFoundException(String.format("Unable to find action with id '%s'.", actionId)); } final AuthorizationResult result = authorizeAction(action); final boolean authorized = Result.Approved.equals(result.getResult()); if (!authorized) { throw new AccessDeniedException(result.getExplanation()); } return entityFactory.createActionEntity(dtoFactory.createActionDto(action), authorized); }  @Override void authorizeAccess(final AuthorizeAccess authorizeAccess); @Override void verifyRevision(final Revision revision, final NiFiUser user); @Override void verifyRevisions(final Set<Revision> revisions, final NiFiUser user); @Override Set<Revision> getRevisionsFromGroup(final String groupId, final Function<ProcessGroup, Set<String>> getComponents); @Override Set<Revision> getRevisionsFromSnippet(final String snippetId); @Override void verifyListQueue(final String connectionId); @Override void verifyCreateConnection(final String groupId, final ConnectionDTO connectionDTO); @Override void verifyUpdateConnection(final ConnectionDTO connectionDTO); @Override void verifyDeleteConnection(final String connectionId); @Override void verifyDeleteFunnel(final String funnelId); @Override void verifyUpdateInputPort(final PortDTO inputPortDTO); @Override void verifyDeleteInputPort(final String inputPortId); @Override void verifyUpdateOutputPort(final PortDTO outputPortDTO); @Override void verifyDeleteOutputPort(final String outputPortId); @Override void verifyCreateProcessor(ProcessorDTO processorDTO); @Override void verifyUpdateProcessor(final ProcessorDTO processorDTO); @Override void verifyDeleteProcessor(final String processorId); @Override void verifyScheduleComponents(final String groupId, final ScheduledState state, final Set<String> componentIds); @Override void verifyEnableComponents(String processGroupId, ScheduledState state, Set<String> componentIds); @Override void verifyActivateControllerServices(final String groupId, final ControllerServiceState state, final Collection<String> serviceIds); @Override void verifyDeleteProcessGroup(final String groupId); @Override void verifyUpdateRemoteProcessGroup(final RemoteProcessGroupDTO remoteProcessGroupDTO); @Override void verifyUpdateRemoteProcessGroupInputPort(final String remoteProcessGroupId, final RemoteProcessGroupPortDTO remoteProcessGroupPortDTO); @Override void verifyUpdateRemoteProcessGroupOutputPort(final String remoteProcessGroupId, final RemoteProcessGroupPortDTO remoteProcessGroupPortDTO); @Override void verifyDeleteRemoteProcessGroup(final String remoteProcessGroupId); @Override void verifyCreateControllerService(ControllerServiceDTO controllerServiceDTO); @Override void verifyUpdateControllerService(final ControllerServiceDTO controllerServiceDTO); @Override void verifyUpdateControllerServiceReferencingComponents(final String controllerServiceId, final ScheduledState scheduledState, final ControllerServiceState controllerServiceState); @Override void verifyDeleteControllerService(final String controllerServiceId); @Override void verifyCreateReportingTask(ReportingTaskDTO reportingTaskDTO); @Override void verifyUpdateReportingTask(final ReportingTaskDTO reportingTaskDTO); @Override void verifyDeleteReportingTask(final String reportingTaskId); @Override AccessPolicyEntity updateAccessPolicy(final Revision revision, final AccessPolicyDTO accessPolicyDTO); @Override UserEntity updateUser(final Revision revision, final UserDTO userDTO); @Override UserGroupEntity updateUserGroup(final Revision revision, final UserGroupDTO userGroupDTO); @Override ConnectionEntity updateConnection(final Revision revision, final ConnectionDTO connectionDTO); @Override ProcessorEntity updateProcessor(final Revision revision, final ProcessorDTO processorDTO); @Override LabelEntity updateLabel(final Revision revision, final LabelDTO labelDTO); @Override FunnelEntity updateFunnel(final Revision revision, final FunnelDTO funnelDTO); @Override void verifyUpdateSnippet(final SnippetDTO snippetDto, final Set<String> affectedComponentIds); @Override SnippetEntity updateSnippet(final Set<Revision> revisions, final SnippetDTO snippetDto); @Override PortEntity updateInputPort(final Revision revision, final PortDTO inputPortDTO); @Override PortEntity updateOutputPort(final Revision revision, final PortDTO outputPortDTO); @Override RemoteProcessGroupEntity updateRemoteProcessGroup(final Revision revision, final RemoteProcessGroupDTO remoteProcessGroupDTO); @Override RemoteProcessGroupPortEntity updateRemoteProcessGroupInputPort(
            final Revision revision, final String remoteProcessGroupId, final RemoteProcessGroupPortDTO remoteProcessGroupPortDTO); @Override RemoteProcessGroupPortEntity updateRemoteProcessGroupOutputPort(
            final Revision revision, final String remoteProcessGroupId, final RemoteProcessGroupPortDTO remoteProcessGroupPortDTO); @Override Set<AffectedComponentDTO> getActiveComponentsAffectedByVariableRegistryUpdate(final VariableRegistryDTO variableRegistryDto); @Override Set<AffectedComponentEntity> getComponentsAffectedByVariableRegistryUpdate(final VariableRegistryDTO variableRegistryDto); @Override VariableRegistryEntity updateVariableRegistry(Revision revision, VariableRegistryDTO variableRegistryDto); @Override ProcessGroupEntity updateProcessGroup(final Revision revision, final ProcessGroupDTO processGroupDTO); @Override void verifyUpdateProcessGroup(ProcessGroupDTO processGroupDTO); @Override ScheduleComponentsEntity enableComponents(String processGroupId, ScheduledState state, Map<String, Revision> componentRevisions); @Override ScheduleComponentsEntity scheduleComponents(final String processGroupId, final ScheduledState state, final Map<String, Revision> componentRevisions); @Override ActivateControllerServicesEntity activateControllerServices(final String processGroupId, final ControllerServiceState state, final Map<String, Revision> serviceRevisions); @Override ControllerConfigurationEntity updateControllerConfiguration(final Revision revision, final ControllerConfigurationDTO controllerConfigurationDTO); @Override NodeDTO updateNode(final NodeDTO nodeDTO); @Override CounterDTO updateCounter(final String counterId); @Override void verifyCanClearProcessorState(final String processorId); @Override void clearProcessorState(final String processorId); @Override void verifyCanClearControllerServiceState(final String controllerServiceId); @Override void clearControllerServiceState(final String controllerServiceId); @Override void verifyCanClearReportingTaskState(final String reportingTaskId); @Override void clearReportingTaskState(final String reportingTaskId); @Override ConnectionEntity deleteConnection(final Revision revision, final String connectionId); @Override DropRequestDTO deleteFlowFileDropRequest(final String connectionId, final String dropRequestId); @Override ListingRequestDTO deleteFlowFileListingRequest(final String connectionId, final String listingRequestId); @Override ProcessorEntity deleteProcessor(final Revision revision, final String processorId); @Override ProcessorEntity terminateProcessor(final String processorId); @Override void verifyTerminateProcessor(final String processorId); @Override LabelEntity deleteLabel(final Revision revision, final String labelId); @Override UserEntity deleteUser(final Revision revision, final String userId); @Override UserGroupEntity deleteUserGroup(final Revision revision, final String userGroupId); @Override AccessPolicyEntity deleteAccessPolicy(final Revision revision, final String accessPolicyId); @Override FunnelEntity deleteFunnel(final Revision revision, final String funnelId); @Override void verifyDeleteSnippet(final String snippetId, final Set<String> affectedComponentIds); @Override SnippetEntity deleteSnippet(final Set<Revision> revisions, final String snippetId); @Override PortEntity deleteInputPort(final Revision revision, final String inputPortId); @Override PortEntity deleteOutputPort(final Revision revision, final String outputPortId); @Override ProcessGroupEntity deleteProcessGroup(final Revision revision, final String groupId); @Override RemoteProcessGroupEntity deleteRemoteProcessGroup(final Revision revision, final String remoteProcessGroupId); @Override void deleteTemplate(final String id); @Override ConnectionEntity createConnection(final Revision revision, final String groupId, final ConnectionDTO connectionDTO); @Override DropRequestDTO createFlowFileDropRequest(final String connectionId, final String dropRequestId); @Override ListingRequestDTO createFlowFileListingRequest(final String connectionId, final String listingRequestId); @Override ProcessorEntity createProcessor(final Revision revision, final String groupId, final ProcessorDTO processorDTO); @Override LabelEntity createLabel(final Revision revision, final String groupId, final LabelDTO labelDTO); @Override BulletinEntity createBulletin(final BulletinDTO bulletinDTO, final Boolean canRead); @Override FunnelEntity createFunnel(final Revision revision, final String groupId, final FunnelDTO funnelDTO); @Override AccessPolicyEntity createAccessPolicy(final Revision revision, final AccessPolicyDTO accessPolicyDTO); @Override UserEntity createUser(final Revision revision, final UserDTO userDTO); @Override UserGroupEntity createUserGroup(final Revision revision, final UserGroupDTO userGroupDTO); @Override FlowEntity copySnippet(final String groupId, final String snippetId, final Double originX, final Double originY, final String idGenerationSeed); @Override SnippetEntity createSnippet(final SnippetDTO snippetDTO); @Override PortEntity createInputPort(final Revision revision, final String groupId, final PortDTO inputPortDTO); @Override PortEntity createOutputPort(final Revision revision, final String groupId, final PortDTO outputPortDTO); @Override ProcessGroupEntity createProcessGroup(final Revision revision, final String parentGroupId, final ProcessGroupDTO processGroupDTO); @Override RemoteProcessGroupEntity createRemoteProcessGroup(final Revision revision, final String groupId, final RemoteProcessGroupDTO remoteProcessGroupDTO); @Override boolean isRemoteGroupPortConnected(final String remoteProcessGroupId, final String remotePortId); @Override void verifyCanAddTemplate(String groupId, String name); @Override void verifyComponentTypes(FlowSnippetDTO snippet); @Override void verifyComponentTypes(final VersionedProcessGroup versionedGroup); @Override void verifyImportProcessGroup(final VersionControlInformationDTO versionControlInfo, final VersionedProcessGroup contents, final String groupId); @Override TemplateDTO createTemplate(final String name, final String description, final String snippetId, final String groupId, final Optional<String> idGenerationSeed); @Override TemplateDTO importTemplate(final TemplateDTO templateDTO, final String groupId, final Optional<String> idGenerationSeed); @Override FlowEntity createTemplateInstance(final String groupId, final Double originX, final Double originY, final String templateEncodingVersion,
                                             final FlowSnippetDTO requestSnippet, final String idGenerationSeed); @Override ControllerServiceEntity createControllerService(final Revision revision, final String groupId, final ControllerServiceDTO controllerServiceDTO); @Override ControllerServiceEntity updateControllerService(final Revision revision, final ControllerServiceDTO controllerServiceDTO); @Override ControllerServiceReferencingComponentsEntity updateControllerServiceReferencingComponents(
            final Map<String, Revision> referenceRevisions, final String controllerServiceId, final ScheduledState scheduledState, final ControllerServiceState controllerServiceState); @Override ControllerServiceEntity deleteControllerService(final Revision revision, final String controllerServiceId); @Override RegistryClientEntity createRegistryClient(Revision revision, RegistryDTO registryDTO); @Override RegistryClientEntity getRegistryClient(final String registryId); @Override Set<RegistryClientEntity> getRegistryClients(); @Override Set<RegistryEntity> getRegistriesForUser(final NiFiUser user); @Override Set<BucketEntity> getBucketsForUser(final String registryId, final NiFiUser user); @Override Set<VersionedFlowEntity> getFlowsForUser(String registryId, String bucketId, NiFiUser user); @Override Set<VersionedFlowSnapshotMetadataEntity> getFlowVersionsForUser(String registryId, String bucketId, String flowId, NiFiUser user); @Override RegistryClientEntity updateRegistryClient(Revision revision, RegistryDTO registryDTO); @Override void verifyDeleteRegistry(String registryId); @Override RegistryClientEntity deleteRegistryClient(final Revision revision, final String registryId); @Override ReportingTaskEntity createReportingTask(final Revision revision, final ReportingTaskDTO reportingTaskDTO); @Override ReportingTaskEntity updateReportingTask(final Revision revision, final ReportingTaskDTO reportingTaskDTO); @Override ReportingTaskEntity deleteReportingTask(final Revision revision, final String reportingTaskId); @Override void deleteActions(final Date endDate); @Override ProvenanceDTO submitProvenance(final ProvenanceDTO query); @Override void deleteProvenance(final String queryId); @Override LineageDTO submitLineage(final LineageDTO lineage); @Override void deleteLineage(final String lineageId); @Override ProvenanceEventDTO submitReplay(final Long eventId); @Override SearchResultsDTO searchController(final String query); @Override DownloadableContent getContent(final String connectionId, final String flowFileUuid, final String uri); @Override DownloadableContent getContent(final Long eventId, final String uri, final ContentDirection contentDirection); @Override ProvenanceDTO getProvenance(final String queryId, final Boolean summarize, final Boolean incrementalResults); @Override LineageDTO getLineage(final String lineageId); @Override ProvenanceOptionsDTO getProvenanceSearchOptions(); @Override ProvenanceEventDTO getProvenanceEvent(final Long id); @Override ProcessGroupStatusEntity getProcessGroupStatus(final String groupId, final boolean recursive); @Override ControllerStatusDTO getControllerStatus(); @Override ComponentStateDTO getProcessorState(final String processorId); @Override ComponentStateDTO getControllerServiceState(final String controllerServiceId); @Override ComponentStateDTO getReportingTaskState(final String reportingTaskId); @Override CountersDTO getCounters(); @Override Set<ConnectionEntity> getConnections(final String groupId); @Override ConnectionEntity getConnection(final String connectionId); @Override DropRequestDTO getFlowFileDropRequest(final String connectionId, final String dropRequestId); @Override ListingRequestDTO getFlowFileListingRequest(final String connectionId, final String listingRequestId); @Override FlowFileDTO getFlowFile(final String connectionId, final String flowFileUuid); @Override ConnectionStatusEntity getConnectionStatus(final String connectionId); @Override StatusHistoryEntity getConnectionStatusHistory(final String connectionId); @Override Set<ProcessorEntity> getProcessors(final String groupId, final boolean includeDescendants); @Override TemplateDTO exportTemplate(final String id); @Override TemplateDTO getTemplate(final String id); @Override Set<TemplateEntity> getTemplates(); @Override Set<DocumentedTypeDTO> getWorkQueuePrioritizerTypes(); @Override Set<DocumentedTypeDTO> getProcessorTypes(final String bundleGroup, final String bundleArtifact, final String type); @Override Set<DocumentedTypeDTO> getControllerServiceTypes(final String serviceType, final String serviceBundleGroup, final String serviceBundleArtifact, final String serviceBundleVersion,
                                                            final String bundleGroup, final String bundleArtifact, final String type); @Override Set<DocumentedTypeDTO> getReportingTaskTypes(final String bundleGroup, final String bundleArtifact, final String type); @Override ProcessorEntity getProcessor(final String id); @Override PropertyDescriptorDTO getProcessorPropertyDescriptor(final String id, final String property); @Override ProcessorStatusEntity getProcessorStatus(final String id); @Override StatusHistoryEntity getProcessorStatusHistory(final String id); @Override BulletinBoardDTO getBulletinBoard(final BulletinQueryDTO query); @Override SystemDiagnosticsDTO getSystemDiagnostics(); @Override List<ResourceDTO> getResources(); @Override ControllerDTO getSiteToSiteDetails(); @Override ControllerConfigurationEntity getControllerConfiguration(); @Override ControllerBulletinsEntity getControllerBulletins(); @Override FlowConfigurationEntity getFlowConfiguration(); @Override AccessPolicyEntity getAccessPolicy(final String accessPolicyId); @Override AccessPolicyEntity getAccessPolicy(final RequestAction requestAction, final String resource); @Override UserEntity getUser(final String userId); @Override Set<UserEntity> getUsers(); @Override UserGroupEntity getUserGroup(final String userGroupId); @Override Set<UserGroupEntity> getUserGroups(); @Override Set<LabelEntity> getLabels(final String groupId); @Override LabelEntity getLabel(final String labelId); @Override Set<FunnelEntity> getFunnels(final String groupId); @Override FunnelEntity getFunnel(final String funnelId); @Override Set<PortEntity> getInputPorts(final String groupId); @Override Set<PortEntity> getOutputPorts(final String groupId); @Override Set<ProcessGroupEntity> getProcessGroups(final String parentGroupId); @Override Set<RemoteProcessGroupEntity> getRemoteProcessGroups(final String groupId); @Override PortEntity getInputPort(final String inputPortId); @Override PortStatusEntity getInputPortStatus(final String inputPortId); @Override PortEntity getOutputPort(final String outputPortId); @Override PortStatusEntity getOutputPortStatus(final String outputPortId); @Override RemoteProcessGroupEntity getRemoteProcessGroup(final String remoteProcessGroupId); @Override RemoteProcessGroupStatusEntity getRemoteProcessGroupStatus(final String id); @Override StatusHistoryEntity getRemoteProcessGroupStatusHistory(final String id); @Override CurrentUserEntity getCurrentUser(); @Override ProcessGroupFlowEntity getProcessGroupFlow(final String groupId); @Override ProcessGroupEntity getProcessGroup(final String groupId); @Override VariableRegistryEntity getVariableRegistry(final String groupId, final boolean includeAncestorGroups); @Override VariableRegistryEntity populateAffectedComponents(final VariableRegistryDTO variableRegistryDto); @Override Set<ControllerServiceEntity> getControllerServices(final String groupId, final boolean includeAncestorGroups, final boolean includeDescendantGroups); @Override ControllerServiceEntity getControllerService(final String controllerServiceId); @Override PropertyDescriptorDTO getControllerServicePropertyDescriptor(final String id, final String property); @Override ControllerServiceReferencingComponentsEntity getControllerServiceReferencingComponents(final String controllerServiceId); @Override Set<ReportingTaskEntity> getReportingTasks(); @Override ReportingTaskEntity getReportingTask(final String reportingTaskId); @Override PropertyDescriptorDTO getReportingTaskPropertyDescriptor(final String id, final String property); @Override StatusHistoryEntity getProcessGroupStatusHistory(final String groupId); @Override VersionControlComponentMappingEntity registerFlowWithFlowRegistry(final String groupId, final StartVersionControlRequestEntity requestEntity); @Override VersionedFlow deleteVersionedFlow(final String registryId, final String bucketId, final String flowId); @Override VersionControlInformationEntity getVersionControlInformation(final String groupId); @Override FlowComparisonEntity getLocalModifications(final String processGroupId); @Override VersionedFlow registerVersionedFlow(final String registryId, final VersionedFlow flow); @Override VersionedFlowSnapshot registerVersionedFlowSnapshot(final String registryId, final VersionedFlow flow,
        final VersionedProcessGroup snapshot, final String comments, final int expectedVersion); @Override VersionControlInformationEntity setVersionControlInformation(final Revision revision, final String processGroupId,
            final VersionControlInformationDTO versionControlInfo, final Map<String, String> versionedComponentMapping); @Override VersionControlInformationEntity deleteVersionControl(final Revision revision, final String processGroupId); @Override void verifyCanUpdate(final String groupId, final VersionedFlowSnapshot proposedFlow, final boolean verifyConnectionRemoval, final boolean verifyNotDirty); @Override void verifyCanSaveToFlowRegistry(final String groupId, final String registryId, final String bucketId, final String flowId); @Override void verifyCanRevertLocalModifications(final String groupId, final VersionedFlowSnapshot versionedFlowSnapshot); @Override Set<AffectedComponentEntity> getComponentsAffectedByVersionChange(final String processGroupId, final VersionedFlowSnapshot updatedSnapshot); @Override VersionedFlowSnapshot getVersionedFlowSnapshot(final VersionControlInformationDTO versionControlInfo, final boolean fetchRemoteFlows); @Override String getFlowRegistryName(final String flowRegistryId); @Override ProcessGroupEntity updateProcessGroupContents(final Revision revision, final String groupId, final VersionControlInformationDTO versionControlInfo,
        final VersionedFlowSnapshot proposedFlowSnapshot, final String componentIdSeed, final boolean verifyNotModified, final boolean updateSettings, final boolean updateDescendantVersionedFlows); @Override HistoryDTO getActions(final HistoryQueryDTO historyQueryDto); @Override ActionEntity getAction(final Integer actionId); @Override ComponentHistoryDTO getComponentHistory(final String componentId); @Override ProcessorDiagnosticsEntity getProcessorDiagnostics(final String id); @Override boolean isClustered(); @Override String getNodeId(); @Override ClusterDTO getCluster(); @Override NodeDTO getNode(final String nodeId); @Override void deleteNode(final String nodeId); void setProperties(final NiFiProperties properties); void setControllerFacade(final ControllerFacade controllerFacade); void setRemoteProcessGroupDAO(final RemoteProcessGroupDAO remoteProcessGroupDAO); void setLabelDAO(final LabelDAO labelDAO); void setFunnelDAO(final FunnelDAO funnelDAO); void setSnippetDAO(final SnippetDAO snippetDAO); void setProcessorDAO(final ProcessorDAO processorDAO); void setConnectionDAO(final ConnectionDAO connectionDAO); void setAuditService(final AuditService auditService); void setRevisionManager(final RevisionManager revisionManager); void setDtoFactory(final DtoFactory dtoFactory); void setEntityFactory(final EntityFactory entityFactory); void setInputPortDAO(final PortDAO inputPortDAO); void setOutputPortDAO(final PortDAO outputPortDAO); void setProcessGroupDAO(final ProcessGroupDAO processGroupDAO); void setControllerServiceDAO(final ControllerServiceDAO controllerServiceDAO); void setReportingTaskDAO(final ReportingTaskDAO reportingTaskDAO); void setTemplateDAO(final TemplateDAO templateDAO); void setSnippetUtils(final SnippetUtils snippetUtils); void setAuthorizableLookup(final AuthorizableLookup authorizableLookup); void setAuthorizer(final Authorizer authorizer); void setUserDAO(final UserDAO userDAO); void setUserGroupDAO(final UserGroupDAO userGroupDAO); void setAccessPolicyDAO(final AccessPolicyDAO accessPolicyDAO); void setClusterCoordinator(final ClusterCoordinator coordinator); void setHeartbeatMonitor(final HeartbeatMonitor heartbeatMonitor); void setBulletinRepository(final BulletinRepository bulletinRepository); void setLeaderElectionManager(final LeaderElectionManager leaderElectionManager); void setRegistryDAO(RegistryDAO registryDao); void setFlowRegistryClient(FlowRegistryClient flowRegistryClient); void setAppStateNotifyService(AppStateNotifyService appStateNotifyService);  }