use of se.riv.itintegration.monitoring.v1.PingForConfigurationResponseType in project webcert by sklintyg.
the class PingForConfigurationResponderImpl method pingForConfiguration.
// CHECKSTYLE:OFF LineLength
@Override
public PingForConfigurationResponseType pingForConfiguration(@WebParam(partName = "LogicalAddress", name = "LogicalAddress", targetNamespace = "urn:riv:itintegration:registry:1", header = true) String logicalAddress, @WebParam(partName = "parameters", name = "PingForConfiguration", targetNamespace = "urn:riv:itintegration:monitoring:PingForConfigurationResponder:1") PingForConfigurationType parameters) {
// CHECKSTYLE:ON LineLength
PingForConfigurationResponseType response = new PingForConfigurationResponseType();
response.setPingDateTime(new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));
LOG.info("Version String: " + projectVersion);
response.setVersion(projectVersion);
HealthStatus db = healthCheck.checkDB();
HealthStatus jms = healthCheck.checkJMS();
HealthStatus queueSize = healthCheck.checkSignatureQueue();
HealthStatus pingIntygstjanst = healthCheck.checkIntygstjanst();
HealthStatus pingPrivatlakarportal = healthCheck.checkPrivatlakarportal();
HealthStatus uptime = healthCheck.checkUptime();
HealthStatus nbrOfUsers = healthCheck.checkNbrOfUsers();
addConfiguration(response, "buildNumber", buildNumberString);
addConfiguration(response, "buildTime", buildTimeString);
addConfiguration(response, "systemUptime", DurationFormatUtils.formatDurationWords(uptime.getMeasurement(), true, true));
addConfiguration(response, "dbStatus", db.isOk() ? "ok" : "error");
addConfiguration(response, "jmsStatus", jms.isOk() ? "ok" : "error");
addConfiguration(response, "intygstjanst", pingIntygstjanst.isOk() ? "ok" : "no connection");
addConfiguration(response, "privatlakarportal", pingPrivatlakarportal.isOk() ? "ok" : "no connection");
addConfiguration(response, "signatureQueueSize", Long.toString(queueSize.getMeasurement()));
addConfiguration(response, "nbrOfUsers", Long.toString(nbrOfUsers.getMeasurement()));
return response;
}
use of se.riv.itintegration.monitoring.v1.PingForConfigurationResponseType in project webcert by sklintyg.
the class HealthCheckServiceImplTest method testCheckPrivatlakarportal.
@Test
public void testCheckPrivatlakarportal() {
when(privatlakarportalPingForConfiguration.pingForConfiguration(eq(PP_LOGICAL_ADDRESS), any(PingForConfigurationType.class))).thenReturn(new PingForConfigurationResponseType());
HealthStatus res = service.checkPrivatlakarportal();
assertNotNull(res);
assertTrue(res.isOk());
assertNotNull(res.getMeasurement());
verify(privatlakarportalPingForConfiguration).pingForConfiguration(eq(PP_LOGICAL_ADDRESS), any(PingForConfigurationType.class));
}
use of se.riv.itintegration.monitoring.v1.PingForConfigurationResponseType in project webcert by sklintyg.
the class HealthCheckServiceImpl method pingIntygstjanst.
private boolean pingIntygstjanst() {
try {
PingForConfigurationType parameters = new PingForConfigurationType();
PingForConfigurationResponseType pingResponse = intygstjanstPingForConfiguration.pingForConfiguration(itLogicalAddress, parameters);
return pingResponse != null;
} catch (Exception e) {
LOG.error("pingIntygstjanst failed with exception: " + e.getMessage());
return false;
}
}
Aggregations