use of sonia.scm.sse.Registration in project scm-review-plugin by scm-manager.
the class PullRequestResource method events.
@GET
@Path("events")
@SseResponse
@Operation(summary = "Register SSE", hidden = true)
@Produces(MediaType.SERVER_SENT_EVENTS)
public void events(@Context Sse sse, @Context SseEventSink eventSink, @BeanParam EventSubscriptionRequest request) {
Repository repository = service.getRepository(request.getNamespace(), request.getName());
PermissionCheck.checkRead(repository);
PullRequest pullRequest = service.get(repository, request.getPullRequestId());
Channel channel = channelRegistry.channel(new ChannelId(repository, pullRequest));
channel.register(new Registration(request.getSessionId(), sse, eventSink));
}
Aggregations