use of org.apache.nifi.web.api.dto.BannerDTO in project nifi by apache.
the class FlowResource method getBanners.
/**
* Retrieves the banners for this NiFi.
*
* @return A bannerEntity.
*/
@GET
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.APPLICATION_JSON)
@Path("banners")
@ApiOperation(value = "Retrieves the banners for this NiFi", response = BannerEntity.class, authorizations = { @Authorization(value = "Read - /flow") })
@ApiResponses(value = { @ApiResponse(code = 400, message = "NiFi was unable to complete the request because it was invalid. The request should not be retried without modification."), @ApiResponse(code = 401, message = "Client could not be authenticated."), @ApiResponse(code = 403, message = "Client is not authorized to make this request."), @ApiResponse(code = 409, message = "The request was valid but NiFi was not in the appropriate state to process it. Retrying the same request later may be successful.") })
public Response getBanners() {
authorizeFlow();
// get the banner from the properties - will come from the NCM when clustered
final String bannerText = getProperties().getBannerText();
// create the DTO
final BannerDTO bannerDTO = new BannerDTO();
bannerDTO.setHeaderText(bannerText);
bannerDTO.setFooterText(bannerText);
// create the response entity
final BannerEntity entity = new BannerEntity();
entity.setBanners(bannerDTO);
// generate the response
return generateOkResponse(entity).build();
}
Aggregations