Cleanup message logging in netconf handlers
[controller.git] / opendaylight / netconf / netconf-impl / src / main / java / org / opendaylight / controller / netconf / impl / mapping / operations / DefaultStartExi.java
index 3f0ae27dbbcea4e1226694eedd3aaab4a05ce586..5593c22fad1e233b9ee9ce2a1eb88cf3451144e6 100644 (file)
@@ -28,14 +28,16 @@ public class DefaultStartExi extends AbstractSingletonNetconfOperation implement
     private static final Logger LOG = LoggerFactory.getLogger(DefaultStartExi.class);
     private NetconfServerSession netconfSession;
 
-    public DefaultStartExi(String netconfSessionIdForReporting) {
+    public DefaultStartExi(final String netconfSessionIdForReporting) {
         super(netconfSessionIdForReporting);
     }
 
     @Override
-    public Document handle(Document message,
-                           NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException {
-        LOG.debug("Received start-exi message {} ", XmlUtil.toString(message));
+    public Document handle(final Document message,
+                           final NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException {
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Received start-exi message {} ", XmlUtil.toString(message));
+        }
 
         try {
             netconfSession.startExiCommunication(new NetconfMessage(message));
@@ -48,7 +50,7 @@ public class DefaultStartExi extends AbstractSingletonNetconfOperation implement
     }
 
     @Override
-    protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException {
+    protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) throws NetconfDocumentedException {
         Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);
         LOG.trace("{} operation successful", START_EXI);
         return getSchemaResult;
@@ -65,7 +67,7 @@ public class DefaultStartExi extends AbstractSingletonNetconfOperation implement
     }
 
     @Override
-    public void setNetconfSession(NetconfServerSession s) {
+    public void setNetconfSession(final NetconfServerSession s) {
         netconfSession = s;
     }
 }