Fix for bug 211, where direct write and read of augmentation was not processed correctly
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / main / java / org / opendaylight / controller / sal / restconf / impl / BrokerFacade.xtend
index eb1f6165ca23c5bb17deac73f575a06bfc57fc57..df6b58c8971331b74c89418a6e1ee039e1fcdf10 100644 (file)
@@ -1,6 +1,5 @@
 package org.opendaylight.controller.sal.restconf.impl
 
-import javax.ws.rs.WebApplicationException
 import javax.ws.rs.core.Response
 import org.opendaylight.controller.md.sal.common.api.data.DataReader
 import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession
@@ -10,9 +9,12 @@ import org.opendaylight.yangtools.yang.common.QName
 import org.opendaylight.yangtools.yang.common.RpcResult
 import org.opendaylight.yangtools.yang.data.api.CompositeNode
 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier
+import org.slf4j.LoggerFactory
 
 class BrokerFacade implements DataReader<InstanceIdentifier, CompositeNode> {
 
+
+    val static LOG = LoggerFactory.getLogger(BrokerFacade)
     val static BrokerFacade INSTANCE = new BrokerFacade
 
     @Property
@@ -33,18 +35,19 @@ class BrokerFacade implements DataReader<InstanceIdentifier, CompositeNode> {
 
     private def void checkPreconditions() {
         if (context === null || dataService === null) {
-            throw new WebApplicationException(Response.status(Response.Status.SERVICE_UNAVAILABLE)
-                    .entity(RestconfProvider::NOT_INITALIZED_MSG).build())
+            throw new ResponseException(Response.Status.SERVICE_UNAVAILABLE, RestconfProvider::NOT_INITALIZED_MSG)
         }
     }
 
     override readConfigurationData(InstanceIdentifier path) {
         checkPreconditions
+        LOG.info("Read Configuration via Restconf: {}",path)
         return dataService.readConfigurationData(path);
     }
 
     override readOperationalData(InstanceIdentifier path) {
         checkPreconditions
+        LOG.info("Read Operational via Restconf: {}",path)
         return dataService.readOperationalData(path);
     }