Fix Server-Sent Events routing
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / rests / services / api / RestconfDataStreamService.java
1 /*
2  * Copyright (c) 2020 Lumina Networks, Inc. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.restconf.nb.rfc8040.rests.services.api;
9
10 import javax.ws.rs.Encoded;
11 import javax.ws.rs.GET;
12 import javax.ws.rs.Path;
13 import javax.ws.rs.PathParam;
14 import javax.ws.rs.Produces;
15 import javax.ws.rs.core.Context;
16 import javax.ws.rs.core.MediaType;
17 import javax.ws.rs.core.UriInfo;
18 import javax.ws.rs.sse.Sse;
19 import javax.ws.rs.sse.SseEventSink;
20
21 /**
22  * Access to notification streams via Server-Sent Events.
23  */
24 @Path("/")
25 public interface RestconfDataStreamService {
26     /**
27      * Get target data resource.
28      *
29      * @param identifier path to target
30      * @param uriInfo URI info
31      */
32     @GET
33     @Path("/{identifier:.+}")
34     @Produces(MediaType.SERVER_SENT_EVENTS)
35     void getSSE(@Encoded @PathParam("identifier") String identifier, @Context UriInfo uriInfo,
36         @Context SseEventSink sink, @Context Sse sse);
37 }