use of se.inera.intyg.infra.logmessages.PdlLogMessage in project webcert by sklintyg.
the class LogResource method getLogMessage.
@GET
@Path("/")
@Produces(MediaType.APPLICATION_JSON)
public PdlLogMessage getLogMessage() {
long originalTimeout = jmsTemplate.getReceiveTimeout();
try {
jmsTemplate.setReceiveTimeout(timeOut);
Message message = jmsTemplate.receive(queue);
String body = ((TextMessage) message).getText();
return objectMapper.readValue(body, PdlLogMessage.class);
} catch (JMSException e) {
throw new RuntimeException("Could not retreive log message: " + e.getMessage(), e);
} catch (IOException e) {
throw new RuntimeException("Could not parse log message: " + e.getMessage(), e);
} finally {
jmsTemplate.setReceiveTimeout(originalTimeout);
}
}
use of se.inera.intyg.infra.logmessages.PdlLogMessage in project webcert by sklintyg.
the class IntygDeleteMessage method build.
public static PdlLogMessage build(String intygId) {
PdlLogMessage pdlLogMessage = new PdlLogMessage(ActivityType.DELETE);
pdlLogMessage.setActivityLevel(intygId);
return pdlLogMessage;
}
use of se.inera.intyg.infra.logmessages.PdlLogMessage in project webcert by sklintyg.
the class IntygPrintMessage method build.
public static PdlLogMessage build(String intygId, String printMethod) {
PdlLogMessage pdlLogMessage = new PdlLogMessage(ActivityType.PRINT);
pdlLogMessage.setActivityLevel(intygId);
pdlLogMessage.setActivityArgs(printMethod);
return pdlLogMessage;
}
use of se.inera.intyg.infra.logmessages.PdlLogMessage in project webcert by sklintyg.
the class LogMessagePopulatorImplTest method buildPdlLogMessage.
private PdlLogMessage buildPdlLogMessage(String activityArgs) {
PdlLogMessage pdlLogMessage = new PdlLogMessage();
pdlLogMessage.setActivityArgs(activityArgs);
return pdlLogMessage;
}
use of se.inera.intyg.infra.logmessages.PdlLogMessage in project webcert by sklintyg.
the class LogMessagePopulatorImplTest method testActivityArgsAppendedFromAdditionalInfoWhenActivityArgsExists.
@Test
public void testActivityArgsAppendedFromAdditionalInfoWhenActivityArgsExists() {
PdlLogMessage logMessage = testee.populateLogMessage(buildLogRequest(ADDITIONAL_INFO), buildPdlLogMessage(ACTIVITY_ARGS), buildLogUser());
assertEquals(ACTIVITY_ARGS + ". " + ADDITIONAL_INFO, logMessage.getActivityArgs());
}
Aggregations