Eliminate NormalizedNodePayload.headers
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / rfc8040 / rests / services / api / RestconfStreamsSubscriptionService.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  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.core.Context;
15 import javax.ws.rs.core.Response;
16 import javax.ws.rs.core.UriInfo;
17 import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload;
18 import org.opendaylight.restconf.nb.rfc8040.rests.utils.RestconfStreamsConstants;
19
20 /**
21  * Subscribing to streams.
22  */
23 public interface RestconfStreamsSubscriptionService {
24     /**
25      * Subscribing to receive notification from stream support.
26      *
27      * @param identifier name of stream
28      * @param uriInfo URI info
29      * @return a response containing {@link NormalizedNodePayload}
30      */
31     // FIXME: this is a REST violation: GET does not transfer state! This should work in terms of
32     //        https://www.rfc-editor.org/rfc/rfc8639#section-2.4, i.e. when we have that, aggressively deprecate
33     //        and remove this special case. Besides it routes to a very bad thing in RestconfDataServiceImpl
34     @GET
35     @Path("data/" + RestconfStreamsConstants.STREAMS_PATH  + "/stream/{identifier:.+}")
36     Response subscribeToStream(@Encoded @PathParam("identifier") String identifier, @Context UriInfo uriInfo);
37 }