Search in sources :

Example 1 with ConsistencyErrorLogger

use of org.eclipse.winery.repository.backend.consistencycheck.ConsistencyErrorLogger in project winery by eclipse.

the class ConsistencyCheckWebSocket method onMessage.

@OnMessage
public void onMessage(String message, Session session) throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    ConsistencyCheckerConfiguration config = mapper.readValue(message, ConsistencyCheckerConfiguration.class);
    ConsistencyErrorLogger errorList = ConsistencyChecker.checkCorruption(config, this);
    // Transform object to JSON and send it.
    this.session.getBasicRemote().sendText(mapper.writeValueAsString(errorList));
    // Close the connection after the check has passed.
    onClose(session);
}
Also used : ConsistencyCheckerConfiguration(org.eclipse.winery.repository.backend.consistencycheck.ConsistencyCheckerConfiguration) ConsistencyErrorLogger(org.eclipse.winery.repository.backend.consistencycheck.ConsistencyErrorLogger) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ConsistencyCheckerConfiguration (org.eclipse.winery.repository.backend.consistencycheck.ConsistencyCheckerConfiguration)1 ConsistencyErrorLogger (org.eclipse.winery.repository.backend.consistencycheck.ConsistencyErrorLogger)1