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 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 GitWebSocketMessenger method onEvent.
@Override
public void onEvent(GitCheckoutEvent event) {
try {
final ChannelBroadcastMessage bm = new ChannelBroadcastMessage();
final String channel = String.format(CHANNEL, event.getWorkspaceId(), event.getProjectName());
bm.setChannel(channel);
bm.setBody(DtoFactory.getInstance().toJson(event));
WSConnectionContext.sendMessage(bm);
} catch (Exception e) {
LOG.error(e.getMessage(), e);
}
}
use of org.everrest.websockets.message.ChannelBroadcastMessage in project che by eclipse.
the class DebuggerWebSocketMessenger method onEvent.
@Override
public void onEvent(DebuggerMessage msg) {
try {
final ChannelBroadcastMessage bm = new ChannelBroadcastMessage();
final String channel = String.format(CHANNEL, msg.getDebuggerType());
bm.setChannel(channel);
bm.setBody(DtoFactory.getInstance().toJson(asDto(msg.getDebuggerEvent())));
WSConnectionContext.sendMessage(bm);
} catch (Exception e) {
LOG.error(e.getMessage(), e);
}
}
Aggregations