use of org.everrest.websockets.message.ChannelBroadcastMessage in project che by eclipse.
the class InitializeEventMessenger method send.
protected void send(final LanguageServerInitializeEventDto message) {
try {
final ChannelBroadcastMessage bm = new ChannelBroadcastMessage();
bm.setChannel("languageserver");
bm.setBody(new Gson().toJson(message));
WSConnectionContext.sendMessage(bm);
} catch (EncodeException | IOException e) {
LOG.error(e.getMessage(), e);
}
}
use of org.everrest.websockets.message.ChannelBroadcastMessage in project che by eclipse.
the class PublishDiagnosticsParamsMessenger method onEvent.
public void onEvent(final PublishDiagnosticsParams event) {
try {
if (event instanceof PublishDiagnosticsParamsImpl && event.getUri().startsWith("file:///projects")) {
((PublishDiagnosticsParamsImpl) event).setUri(event.getUri().substring(16));
}
final ChannelBroadcastMessage bm = new ChannelBroadcastMessage();
bm.setChannel("languageserver/textDocument/publishDiagnostics");
bm.setBody(new Gson().toJson(event));
WSConnectionContext.sendMessage(bm);
} catch (EncodeException | IOException e) {
LOG.error(e.getMessage(), e);
}
}
use of org.everrest.websockets.message.ChannelBroadcastMessage in project che by eclipse.
the class VfsWatchBroadcaster method onEvent.
@Override
public void onEvent(VfsWatchEvent event) {
try {
final ChannelBroadcastMessage bm = new ChannelBroadcastMessage();
bm.setChannel(VfsWatchEvent.VFS_CHANNEL);
bm.setBody(DtoFactory.getInstance().toJson(event));
WSConnectionContext.sendMessage(bm);
} catch (Exception e) {
LOG.error(e.getLocalizedMessage(), e);
}
}
use of org.everrest.websockets.message.ChannelBroadcastMessage in project che by eclipse.
the class ShowMessageMessenger method onEvent.
public void onEvent(final MessageParams event) {
try {
final ChannelBroadcastMessage bm = new ChannelBroadcastMessage();
bm.setChannel("languageserver/window/showMessage");
bm.setBody(new Gson().toJson(event));
WSConnectionContext.sendMessage(bm);
} catch (EncodeException | IOException e) {
LOG.error(e.getMessage(), e);
}
}
use of org.everrest.websockets.message.ChannelBroadcastMessage in project che by eclipse.
the class ProjectImportOutputWSLineConsumer method sendMessage.
protected void sendMessage(String line) {
final ChannelBroadcastMessage bm = new ChannelBroadcastMessage();
bm.setChannel("importProject:output");
JsonObject json = new JsonObject();
json.addProperty("num", lineCounter.getAndIncrement());
json.addProperty("line", line);
json.addProperty("project", projectName);
bm.setBody(json.toString());
sendMessageToWS(bm);
}
Aggregations