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;
}
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;
}
Aggregations