Java Code Examples for org.apache.nifi.controller.FlowController#getFlowManager()

The following examples show how to use org.apache.nifi.controller.FlowController#getFlowManager() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProcessorLifecycleIT.java    From nifi with Apache License 2.0 5 votes vote down vote up
private FlowManagerAndSystemBundle buildFlowControllerForTest(final String propKey, final String propValue) throws Exception {
    final Map<String, String> addProps = new HashMap<>();
    addProps.put(NiFiProperties.ADMINISTRATIVE_YIELD_DURATION, "1 sec");
    addProps.put(NiFiProperties.STATE_MANAGEMENT_CONFIG_FILE, "target/test-classes/state-management.xml");
    addProps.put(NiFiProperties.STATE_MANAGEMENT_LOCAL_PROVIDER_ID, "local-provider");
    addProps.put(NiFiProperties.PROVENANCE_REPO_IMPLEMENTATION_CLASS, MockProvenanceRepository.class.getName());
    addProps.put("nifi.remote.input.socket.port", "");
    addProps.put("nifi.remote.input.secure", "");
    if (propKey != null && propValue != null) {
        addProps.put(propKey, propValue);
    }
    final NiFiProperties nifiProperties = NiFiProperties.createBasicNiFiProperties(propsFile, addProps);

    final Bundle systemBundle = SystemBundle.create(nifiProperties);
    final ExtensionDiscoveringManager extensionManager = new StandardExtensionDiscoveringManager();
    extensionManager.discoverExtensions(systemBundle, Collections.emptySet());

    final FlowController flowController = FlowController.createStandaloneInstance(mock(FlowFileEventRepository.class), nifiProperties,
        mock(Authorizer.class), mock(AuditService.class), null, new VolatileBulletinRepository(),
        new FileBasedVariableRegistry(nifiProperties.getVariableRegistryPropertiesPaths()),
        mock(FlowRegistryClient.class), extensionManager);

    final FlowManager flowManager = flowController.getFlowManager();
    this.processScheduler = flowController.getProcessScheduler();

    return new FlowManagerAndSystemBundle(flowManager, systemBundle);
}
 
Example 2
Source File: StandardParameterContextDAO.java    From nifi with Apache License 2.0 4 votes vote down vote up
public void setFlowController(final FlowController flowController) {
    this.flowManager = flowController.getFlowManager();
}
 
Example 3
Source File: StandardControllerServiceProvider.java    From nifi with Apache License 2.0 4 votes vote down vote up
public StandardControllerServiceProvider(final FlowController flowController, final StandardProcessScheduler scheduler, final BulletinRepository bulletinRepo) {
    this.flowController = flowController;
    this.processScheduler = scheduler;
    this.bulletinRepo = bulletinRepo;
    this.flowManager = flowController.getFlowManager();
}