Search in sources :

Example 16 with MetadataHateoas

use of nikita.model.noark5.v4.hateoas.metadata.MetadataHateoas in project nikita-noark5-core by HiOA-ABI.

the class FondsStatusController method findAll.

// API - All GET Requests (CRUD - READ)
// Retrieves all fondsStatus
// GET [contextPath][api]/metadata/arkivstatus/
@ApiOperation(value = "Retrieves all FondsStatus ", response = FondsStatus.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "FondsStatus codes found", response = FondsStatus.class), @ApiResponse(code = 404, message = "No FondsStatus found"), @ApiResponse(code = 401, message = API_MESSAGE_UNAUTHENTICATED_USER), @ApiResponse(code = 403, message = API_MESSAGE_UNAUTHORISED_FOR_USER), @ApiResponse(code = 500, message = API_MESSAGE_INTERNAL_SERVER_ERROR) })
@Counted
@Timed
@RequestMapping(method = RequestMethod.GET, value = FONDS_STATUS)
public ResponseEntity<MetadataHateoas> findAll(HttpServletRequest request) {
    MetadataHateoas metadataHateoas = new MetadataHateoas(new ArrayList<>(fondsStatusService.findAllAsList()), FONDS_STATUS);
    metadataHateoasHandler.addLinks(metadataHateoas, request, new Authorisation());
    return ResponseEntity.status(HttpStatus.OK).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).body(metadataHateoas);
}
Also used : Authorisation(no.arkivlab.hioa.nikita.webapp.security.Authorisation) MetadataHateoas(nikita.model.noark5.v4.hateoas.metadata.MetadataHateoas) Counted(com.codahale.metrics.annotation.Counted) Timed(com.codahale.metrics.annotation.Timed) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

Counted (com.codahale.metrics.annotation.Counted)15 Timed (com.codahale.metrics.annotation.Timed)15 ApiOperation (io.swagger.annotations.ApiOperation)15 ApiResponses (io.swagger.annotations.ApiResponses)15 MetadataHateoas (nikita.model.noark5.v4.hateoas.metadata.MetadataHateoas)15 Authorisation (no.arkivlab.hioa.nikita.webapp.security.Authorisation)12 DocumentMedium (nikita.model.noark5.v4.metadata.DocumentMedium)4 CorrespondencePartType (nikita.model.noark5.v4.metadata.CorrespondencePartType)3 FondsStatus (nikita.model.noark5.v4.metadata.FondsStatus)3 IMetadataEntity (nikita.model.noark5.v4.interfaces.entities.IMetadataEntity)1 NikitaException (nikita.util.exceptions.NikitaException)1