Fix RestconfOperationsService.getOperations(UriInfo)
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / rests / services / api / RestconfOperationsService.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.GET;
11 import javax.ws.rs.Path;
12 import javax.ws.rs.PathParam;
13 import javax.ws.rs.Produces;
14 import javax.ws.rs.core.Context;
15 import javax.ws.rs.core.MediaType;
16 import javax.ws.rs.core.UriInfo;
17 import org.opendaylight.restconf.common.context.NormalizedNodeContext;
18 import org.opendaylight.restconf.nb.rfc8040.MediaTypes;
19
20 /**
21  * Container that provides access to the data-model specific operations supported by the server.
22  */
23 public interface RestconfOperationsService {
24     /**
25      * List RPC and action operations in RFC7951 format.
26      *
27      * @return A string containing a JSON document conforming to both RFC8040 and RFC7951.
28      */
29     @GET
30     @Path("/operations")
31     @Produces({ MediaTypes.APPLICATION_YANG_DATA_JSON, MediaType.APPLICATION_JSON })
32     String getOperationsJSON();
33
34     /**
35      * List RPC and action operations in RFC8040 XML format.
36      *
37      * @return A string containing a JSON document conforming to both RFC8040 section 11.3.1 and page 84.
38      */
39     @GET
40     @Path("/operations")
41     @Produces({ MediaTypes.APPLICATION_YANG_DATA_XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
42     String getOperationsXML();
43
44     /**
45      * Valid for mount points. List of operations supported by the server.
46      *
47      * @param identifier path parameter
48      * @param uriInfo URI information
49      * @return {@link NormalizedNodeContext}
50      */
51     @GET
52     @Path("/operations/{identifier:.+}")
53     @Produces({
54         MediaTypes.APPLICATION_YANG_DATA_JSON,
55         MediaTypes.APPLICATION_YANG_DATA_XML,
56         MediaType.APPLICATION_JSON,
57         MediaType.APPLICATION_XML,
58         MediaType.TEXT_XML
59     })
60     NormalizedNodeContext getOperations(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
61 }