use of se.inera.intyg.webcert.web.web.controller.moduleapi.dto.SignaturTicketResponse in project webcert by sklintyg.
the class UtkastModuleApiController method serverSigneraUtkastMedNias.
/**
* Signera utkast mha NetiD Access Server (nias).
*
* @param intygsId intyg id
* @return SignaturTicketResponse
*/
@POST
@Path("/{intygsTyp}/{intygsId}/{version}/nias/signeraserver")
@Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET)
public SignaturTicketResponse serverSigneraUtkastMedNias(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId, @PathParam("version") long version, @Context HttpServletRequest request) {
verifyIsAuthorizedToSignIntyg(intygsTyp);
SignaturTicket ticket;
try {
ticket = niasSignaturService.startNiasAuthentication(intygsId, version);
} catch (OptimisticLockException | OptimisticLockingFailureException e) {
monitoringLogService.logUtkastConcurrentlyEdited(intygsId, intygsTyp);
throw new WebCertServiceException(WebCertServiceErrorCodeEnum.CONCURRENT_MODIFICATION, e.getMessage());
}
request.getSession(true).removeAttribute(LAST_SAVED_DRAFT);
return new SignaturTicketResponse(ticket);
}
Aggregations