Search in sources :

Example 1 with ControllerConfigurationDTO

use of org.apache.nifi.web.api.dto.ControllerConfigurationDTO in project nifi by apache.

the class StandardNiFiServiceFacade method getControllerConfiguration.

@Override
public ControllerConfigurationEntity getControllerConfiguration() {
    final Revision rev = revisionManager.getRevision(FlowController.class.getSimpleName());
    final ControllerConfigurationDTO dto = dtoFactory.createControllerConfigurationDto(controllerFacade);
    final PermissionsDTO permissions = dtoFactory.createPermissionsDto(controllerFacade);
    final RevisionDTO revision = dtoFactory.createRevisionDTO(rev);
    return entityFactory.createControllerConfigurationEntity(dto, revision, permissions);
}
Also used : PermissionsDTO(org.apache.nifi.web.api.dto.PermissionsDTO) FlowController(org.apache.nifi.controller.FlowController) ControllerConfigurationDTO(org.apache.nifi.web.api.dto.ControllerConfigurationDTO) RevisionDTO(org.apache.nifi.web.api.dto.RevisionDTO)

Example 2 with ControllerConfigurationDTO

use of org.apache.nifi.web.api.dto.ControllerConfigurationDTO in project nifi by apache.

the class StandardNiFiServiceFacade method updateControllerConfiguration.

@Override
public ControllerConfigurationEntity updateControllerConfiguration(final Revision revision, final ControllerConfigurationDTO controllerConfigurationDTO) {
    final RevisionUpdate<ControllerConfigurationDTO> updatedComponent = updateComponent(revision, controllerFacade, () -> {
        if (controllerConfigurationDTO.getMaxTimerDrivenThreadCount() != null) {
            controllerFacade.setMaxTimerDrivenThreadCount(controllerConfigurationDTO.getMaxTimerDrivenThreadCount());
        }
        if (controllerConfigurationDTO.getMaxEventDrivenThreadCount() != null) {
            controllerFacade.setMaxEventDrivenThreadCount(controllerConfigurationDTO.getMaxEventDrivenThreadCount());
        }
        return controllerConfigurationDTO;
    }, controller -> dtoFactory.createControllerConfigurationDto(controllerFacade));
    final PermissionsDTO permissions = dtoFactory.createPermissionsDto(controllerFacade);
    final RevisionDTO updateRevision = dtoFactory.createRevisionDTO(updatedComponent.getLastModification());
    return entityFactory.createControllerConfigurationEntity(updatedComponent.getComponent(), updateRevision, permissions);
}
Also used : PermissionsDTO(org.apache.nifi.web.api.dto.PermissionsDTO) ControllerConfigurationDTO(org.apache.nifi.web.api.dto.ControllerConfigurationDTO) RevisionDTO(org.apache.nifi.web.api.dto.RevisionDTO)

Aggregations

ControllerConfigurationDTO (org.apache.nifi.web.api.dto.ControllerConfigurationDTO)2 PermissionsDTO (org.apache.nifi.web.api.dto.PermissionsDTO)2 RevisionDTO (org.apache.nifi.web.api.dto.RevisionDTO)2 FlowController (org.apache.nifi.controller.FlowController)1