X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2FBrokerFacade.java;h=b8d9561a26069aab4fbfc94bd134f729b4dd4a23;hb=ed6eb82da5d9712d15847e07d2836f449dbece93;hp=24e1970ada5fe4122e68d684f576708ad0f3dfe2;hpb=6a1f273b365b774790585796f406490930bc7303;p=controller.git diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/BrokerFacade.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/BrokerFacade.java index 24e1970ada..b8d9561a26 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/BrokerFacade.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/BrokerFacade.java @@ -86,7 +86,9 @@ public class BrokerFacade { if (domDataBrokerService.isPresent()) { return readDataViaTransaction(domDataBrokerService.get().newReadOnlyTransaction(), CONFIGURATION, path); } - throw new RestconfDocumentedException("DOM data broker service isn't available for mount point."); + final String errMsg = "DOM data broker service isn't available for mount point " + path; + LOG.warn(errMsg); + throw new RestconfDocumentedException(errMsg); } // READ operational @@ -100,7 +102,9 @@ public class BrokerFacade { if (domDataBrokerService.isPresent()) { return readDataViaTransaction(domDataBrokerService.get().newReadOnlyTransaction(), OPERATIONAL, path); } - throw new RestconfDocumentedException("DOM data broker service isn't available for mount point."); + final String errMsg = "DOM data broker service isn't available for mount point " + path; + LOG.warn(errMsg); + throw new RestconfDocumentedException(errMsg); } // PUT configuration @@ -117,7 +121,9 @@ public class BrokerFacade { return putDataViaTransaction(domDataBrokerService.get().newReadWriteTransaction(), CONFIGURATION, path, payload, mountPoint.getSchemaContext()); } - throw new RestconfDocumentedException("DOM data broker service isn't available for mount point."); + final String errMsg = "DOM data broker service isn't available for mount point " + path; + LOG.warn(errMsg); + throw new RestconfDocumentedException(errMsg); } // POST configuration @@ -134,7 +140,9 @@ public class BrokerFacade { return postDataViaTransaction(domDataBrokerService.get().newReadWriteTransaction(), CONFIGURATION, path, payload, mountPoint.getSchemaContext()); } - throw new RestconfDocumentedException("DOM data broker service isn't available for mount point."); + final String errMsg = "DOM data broker service isn't available for mount point " + path; + LOG.warn(errMsg); + throw new RestconfDocumentedException(errMsg); } // DELETE configuration @@ -150,7 +158,9 @@ public class BrokerFacade { if (domDataBrokerService.isPresent()) { return deleteDataViaTransaction(domDataBrokerService.get().newWriteOnlyTransaction(), CONFIGURATION, path); } - throw new RestconfDocumentedException("DOM data broker service isn't available for mount point."); + final String errMsg = "DOM data broker service isn't available for mount point " + path; + LOG.warn(errMsg); + throw new RestconfDocumentedException(errMsg); } // RPC @@ -187,6 +197,7 @@ public class BrokerFacade { LOG.debug("Reading result data from transaction."); optional = listenableFuture.get(); } catch (InterruptedException | ExecutionException e) { + LOG.warn("Exception by reading " + datastore.name() + " via Restconf: {}", path, e); throw new RestconfDocumentedException("Problem to get data from transaction.", e.getCause()); } @@ -226,13 +237,13 @@ public class BrokerFacade { try { if (futureDatastoreData.get()) { final String errMsg = "Post Configuration via Restconf was not executed because data already exists"; - LOG.debug(errMsg + ":{}", path); + LOG.trace(errMsg + ":{}", path); rWTransaction.cancel(); throw new RestconfDocumentedException("Data already exists for path: " + path, ErrorType.PROTOCOL, ErrorTag.DATA_EXISTS); } } catch (InterruptedException | ExecutionException e) { - LOG.trace("It wasn't possible to get data loaded from datastore at path " + path); + LOG.warn("It wasn't possible to get data loaded from datastore at path " + path, e); } }