Search in sources :

Example 1 with FlowBreadcrumbEntity

use of org.apache.nifi.web.api.entity.FlowBreadcrumbEntity in project nifi by apache.

the class EntityFactory method createFlowBreadcrumbEntity.

public FlowBreadcrumbEntity createFlowBreadcrumbEntity(final FlowBreadcrumbDTO dto, final PermissionsDTO permissions) {
    final FlowBreadcrumbEntity entity = new FlowBreadcrumbEntity();
    if (dto != null) {
        entity.setPermissions(permissions);
        entity.setId(dto.getId());
        if (dto.getVersionControlInformation() != null) {
            entity.setVersionedFlowState(dto.getVersionControlInformation().getState());
        }
        if (permissions != null && permissions.getCanRead()) {
            entity.setBreadcrumb(dto);
        }
    }
    return entity;
}
Also used : FlowBreadcrumbEntity(org.apache.nifi.web.api.entity.FlowBreadcrumbEntity)

Example 2 with FlowBreadcrumbEntity

use of org.apache.nifi.web.api.entity.FlowBreadcrumbEntity in project nifi by apache.

the class DtoFactory method createBreadcrumbEntity.

/**
 * Creates a FlowBreadcrumbEntity from the specified parent ProcessGroup.
 *
 * @param group group
 * @return dto
 */
private FlowBreadcrumbEntity createBreadcrumbEntity(final ProcessGroup group) {
    if (group == null) {
        return null;
    }
    final FlowBreadcrumbDTO dto = createBreadcrumbDto(group);
    final PermissionsDTO permissions = createPermissionsDto(group);
    final FlowBreadcrumbEntity entity = entityFactory.createFlowBreadcrumbEntity(dto, permissions);
    if (group.getParent() != null) {
        entity.setParentBreadcrumb(createBreadcrumbEntity(group.getParent()));
    }
    return entity;
}
Also used : FlowBreadcrumbEntity(org.apache.nifi.web.api.entity.FlowBreadcrumbEntity) FlowBreadcrumbDTO(org.apache.nifi.web.api.dto.flow.FlowBreadcrumbDTO)

Aggregations

FlowBreadcrumbEntity (org.apache.nifi.web.api.entity.FlowBreadcrumbEntity)2 FlowBreadcrumbDTO (org.apache.nifi.web.api.dto.flow.FlowBreadcrumbDTO)1