1 package org.opendaylight.controller.sal.restconf.impl
3 import org.opendaylight.yangtools.yang.data.api.CompositeNode
4 import org.opendaylight.controller.sal.rest.api.RestconfService
6 class RestconfImpl implements RestconfService {
8 val static RestconfImpl INSTANCE = new RestconfImpl
14 extension ControllerContext controllerContext
17 if (INSTANCE != null) {
18 throw new IllegalStateException("Already instantiated");
22 static def getInstance() {
26 override readAllData() {
27 // return broker.readOperationalData("".toInstanceIdentifier.getInstanceIdentifier);
28 throw new UnsupportedOperationException("TODO: auto-generated method stub")
31 override getModules() {
32 throw new UnsupportedOperationException("TODO: auto-generated method stub")
36 throw new UnsupportedOperationException("TODO: auto-generated method stub")
40 override readData(String identifier) {
41 val instanceIdentifierWithSchemaNode = identifier.toInstanceIdentifier
42 val data = broker.readOperationalData(instanceIdentifierWithSchemaNode.getInstanceIdentifier);
43 return new StructuredData(data, instanceIdentifierWithSchemaNode.schemaNode)
46 override createConfigurationData(String identifier, CompositeNode payload) {
47 // return broker.commitConfigurationDataCreate(identifier.toInstanceIdentifier.getInstanceIdentifier, payload);
48 throw new UnsupportedOperationException("TODO: auto-generated method stub")
51 override updateConfigurationData(String identifier, CompositeNode payload) {
52 // return broker.commitConfigurationDataCreate(identifier.toInstanceIdentifier.getInstanceIdentifier, payload);
53 throw new UnsupportedOperationException("TODO: auto-generated method stub")
56 override invokeRpc(String identifier, CompositeNode payload) {
57 val rpcResult = broker.invokeRpc(identifier.toRpcQName, payload);
58 return new StructuredData(rpcResult.result, identifier.toInstanceIdentifier.getSchemaNode)