use of org.eclipse.winery.repository.rest.datatypes.GitData in project winery by eclipse.
the class GitWebSocket method onMessage.
@OnMessage
public void onMessage(String message, Session session) {
try {
GitData data = JacksonProvider.mapper.readValue(message, GitData.class);
Map<String, Map<DiffEntry, String>> repoEntryList = new HashMap<>();
if (RepositoryFactory.getRepository() instanceof MultiRepository) {
IRepository gitRepo;
for (IRepository repo : ((MultiRepository) RepositoryFactory.getRepository()).getRepositories()) {
gitRepo = repo;
if (gitRepo instanceof GitBasedRepository) {
handleGitRepository((GitBasedRepository) gitRepo, data, repoEntryList);
}
}
setGitDifferences(repoEntryList);
} else if (RepositoryFactory.getRepository() instanceof GitBasedRepository) {
handleGitRepository((GitBasedRepository) RepositoryFactory.getRepository(), data, repoEntryList);
setGitDifferences(repoEntryList);
}
} catch (IOException e) {
writeInSession(session, "{ \"error\": \"Could not parse message!\" }");
}
}
Aggregations