use of org.apache.nifi.authorization.resource.ComponentAuthorizable in project nifi by apache.
the class DtoFactory method createComponentReferenceDto.
public ComponentReferenceDTO createComponentReferenceDto(final Authorizable authorizable) {
if (authorizable == null || !(authorizable instanceof ComponentAuthorizable)) {
return null;
}
final ComponentAuthorizable componentAuthorizable = (ComponentAuthorizable) authorizable;
final ComponentReferenceDTO dto = new ComponentReferenceDTO();
dto.setId(componentAuthorizable.getIdentifier());
dto.setParentGroupId(componentAuthorizable.getProcessGroupIdentifier());
dto.setName(authorizable.getResource().getName());
return dto;
}
Aggregations