Search in sources :

Example 1 with ConsistencyCheckerConfiguration

use of org.eclipse.winery.repository.backend.consistencycheck.ConsistencyCheckerConfiguration 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)

Example 2 with ConsistencyCheckerConfiguration

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

the class AdminTopResource method checkConsistency.

@GET
@Path("consistencycheck")
@Produces(MediaType.APPLICATION_JSON)
public ConsistencyErrorLogger checkConsistency(@QueryParam("serviceTemplatesOnly") boolean serviceTemplatesOnly, @QueryParam("checkDocumentation") boolean checkDocumentation) {
    IRepository repo = RepositoryFactory.getRepository();
    EnumSet<ConsistencyCheckerVerbosity> verbosity = EnumSet.of(ConsistencyCheckerVerbosity.NONE);
    ConsistencyCheckerConfiguration config = new ConsistencyCheckerConfiguration(serviceTemplatesOnly, checkDocumentation, verbosity, repo);
    return ConsistencyChecker.checkCorruption(config);
}
Also used : ConsistencyCheckerConfiguration(org.eclipse.winery.repository.backend.consistencycheck.ConsistencyCheckerConfiguration) ConsistencyCheckerVerbosity(org.eclipse.winery.repository.backend.consistencycheck.ConsistencyCheckerVerbosity) IRepository(org.eclipse.winery.repository.backend.IRepository)

Aggregations

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