Merge "NETCONF-557: Add support for URL capability"
authorJakub Morvay <jakub.morvay@gmail.com>
Tue, 21 Aug 2018 09:15:07 +0000 (09:15 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 21 Aug 2018 09:15:07 +0000 (09:15 +0000)
42 files changed:
netconf/aaa-authn-odl-plugin/src/main/java/org/opendaylight/netconf/authprovider/CredentialServiceAuthProvider.java
netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/CallhomeStatusReporter.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/EditConfig.java
netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NotificationToMdsalWriter.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfOperationRouterImpl.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfChunkAggregator.java
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/ops/CreateSubscription.java
netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/SshProxyClientHandler.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/ProxyDOMRpcService.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/FailedProxyTransactionFacade.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologyUtils.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/MountPointEndToEndTest.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManagerTest.java
netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/AbstractNetconfTopology.java
netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/NetconfConnectorFactoryImpl.java
netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/SendErrorExceptionUtil.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDevice.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/listener/NetconfDeviceCommunicator.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceSalProvider.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapter.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/Execution.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/ScaleUtil.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/SyncExecutionStrategy.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/StressClient.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/schemacache/SchemaSourceCache.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/BrokerFacade.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestCodec.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfImpl.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/AbstractCommonSubscriber.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/codecs/RestCodec.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/handlers/TransactionChainHandler.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JSONRestconfServiceRfc8040Impl.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/CreateStreamUtil.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/PatchDataTransactionUtil.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/RestconfInvokeOperationsUtil.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/TransactionUtil.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/simple/impl/RestconfOperationsServiceImpl.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/AbstractCommonSubscriber.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/utils/parser/ParserIdentifier.java
restconf/sal-rest-docgen-maven/src/main/java/org/opendaylight/netconf/sal/rest/doc/maven/StaticDocGenerator.java
restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/impl/BaseYangSwaggerGenerator.java

index d6e1c95b4f82c144cbdec071a226f070eff1750e..5f7bc777d610ccbd7a60f6ee56e1e2729fcffb42 100644 (file)
@@ -41,7 +41,7 @@ public final class CredentialServiceAuthProvider implements AuthProvider {
         try {
             claim = credService.authenticate(new PasswordCredentialsWrapper(username, password));
         } catch (AuthenticationException e) {
-            LOG.debug("Authentication failed for user '{}' : {}", username, e);
+            LOG.debug("Authentication failed for user '{}'", username, e);
             return false;
         }
 
index 8a4979502b29b1521144d07e71fa3895c254190d..3db60e9fca57f591c24ebb0c52ae9162a897fd0c 100644 (file)
@@ -304,7 +304,7 @@ class CallhomeStatusReporter implements DataTreeChangeListener<Node>, StatusReco
                     return;
                 }
             } catch (GeneralSecurityException e) {
-                LOG.error("Failed decoding a device key with host key: {} {}", keyString, e);
+                LOG.error("Failed decoding a device key with host key: {}", keyString, e);
                 return;
             }
         }
index 190c8bf1e94cfd639ac7177322f6f278099bf15b..28f8857aaeed01a1a1f66a34c382739897ce2ce7 100644 (file)
@@ -119,7 +119,7 @@ public final class EditConfig extends AbstractEdit {
                     mergeParentMixin(rwtx, path, changeData);
                     rwtx.put(LogicalDatastoreType.CONFIGURATION, path, changeData);
                 } catch (final InterruptedException | ExecutionException e) {
-                    LOG.warn("Read from datastore failed when trying to read data for create operation", change, e);
+                    LOG.warn("Read from datastore failed when trying to read data for create operation {}", change, e);
                 }
                 break;
             case REPLACE:
@@ -136,7 +136,7 @@ public final class EditConfig extends AbstractEdit {
                     }
                     rwtx.delete(LogicalDatastoreType.CONFIGURATION, path);
                 } catch (final InterruptedException | ExecutionException e) {
-                    LOG.warn("Read from datastore failed when trying to read data for delete operation", change, e);
+                    LOG.warn("Read from datastore failed when trying to read data for delete operation {}", change, e);
                 }
                 break;
             case REMOVE:
index c5fad3f5b0fcd04111f04fbe7f53a568443d0ba2..ea447e5117e76975d8e815e3876b528044a36600 100644 (file)
@@ -83,9 +83,9 @@ public final class NotificationToMdsalWriter implements AutoCloseable, NetconfNo
 
         try {
             tx.commit().get();
-            LOG.debug("Stream %s registered successfully.", stream.getName());
+            LOG.debug("Stream {} registered successfully.", stream.getName());
         } catch (InterruptedException | ExecutionException e) {
-            LOG.warn("Unable to register stream.", e);
+            LOG.warn("Unable to register stream {}.", stream, e);
         }
     }
 
@@ -99,9 +99,9 @@ public final class NotificationToMdsalWriter implements AutoCloseable, NetconfNo
 
         try {
             tx.commit().get();
-            LOG.debug("Stream %s unregistered successfully.", stream);
+            LOG.debug("Stream {} unregistered successfully.", stream);
         } catch (InterruptedException | ExecutionException e) {
-            LOG.warn("Unable to unregister stream", e);
+            LOG.warn("Unable to unregister stream {}", stream, e);
         }
     }
 }
index 449b0db530585cf752744f92c6bbb3ba387b6435..65a96e7583a8b1d19ecd4231a21788c5745b7a32 100644 (file)
@@ -79,13 +79,13 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter {
                     tag, DocumentedException.ErrorSeverity.ERROR,
                     Collections.singletonMap(tag.toString(), e.getMessage()));
         } catch (final RuntimeException e) {
-            throw handleUnexpectedEx("Unexpected exception during netconf operation sort", e);
+            throw handleUnexpectedEx("sort", e);
         }
 
         try {
             return executeOperationWithHighestPriority(message, netconfOperationExecution);
         } catch (final RuntimeException e) {
-            throw handleUnexpectedEx("Unexpected exception during netconf operation execution", e);
+            throw handleUnexpectedEx("execution", e);
         }
     }
 
@@ -94,8 +94,8 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter {
         netconfOperationServiceSnapshot.close();
     }
 
-    private static DocumentedException handleUnexpectedEx(final String message, final Exception exception) {
-        LOG.error("{}", message, exception);
+    private static DocumentedException handleUnexpectedEx(final String op, final Exception exception) {
+        LOG.error("Unexpected exception during netconf operation {}", op, exception);
         return new DocumentedException("Unexpected error",
                 DocumentedException.ErrorType.APPLICATION,
                 DocumentedException.ErrorTag.OPERATION_FAILED,
index 144b4f5b4c22187b71004a7e1ade5a5bce9b1cab..74bf492292b4c16d0e29d8aa14637d687f82511a 100644 (file)
@@ -21,6 +21,8 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder {
     private static final Logger LOG = LoggerFactory.getLogger(NetconfChunkAggregator.class);
     private static final String GOT_PARAM_WHILE_WAITING_FOR_PARAM = "Got byte {} while waiting for {}";
     private static final String GOT_PARAM_WHILE_WAITING_FOR_PARAM_PARAM = "Got byte {} while waiting for {}-{}";
+    private static final String GOT_PARAM_WHILE_WAITING_FOR_PARAM_PARAM_PARAM =
+        "Got byte {} while waiting for {}-{}-{}";
     public static final int DEFAULT_MAXIMUM_CHUNK_SIZE = 16 * 1024 * 1024;
 
     private enum State {
@@ -66,30 +68,26 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder {
                           final ByteBuf in, final List<Object> out) throws IllegalStateException {
         while (in.isReadable()) {
             switch (state) {
-                case HEADER_ONE:
-                {
+                case HEADER_ONE: {
                     final byte b = in.readByte();
                     checkNewLine(b, "Malformed chunk header encountered (byte 0)");
                     state = State.HEADER_TWO;
                     initChunk();
                     break;
                 }
-                case HEADER_TWO:
-                {
+                case HEADER_TWO: {
                     final byte b = in.readByte();
                     checkHash(b, "Malformed chunk header encountered (byte 1)");
                     state = State.HEADER_LENGTH_FIRST;
                     break;
                 }
-                case HEADER_LENGTH_FIRST:
-                {
+                case HEADER_LENGTH_FIRST: {
                     final byte b = in.readByte();
                     chunkSize = processHeaderLengthFirst(b);
                     state = State.HEADER_LENGTH_OTHER;
                     break;
                 }
-                case HEADER_LENGTH_OTHER:
-                {
+                case HEADER_LENGTH_OTHER: {
                     final byte b = in.readByte();
                     if (b == '\n') {
                         state = State.DATA;
@@ -119,31 +117,27 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder {
                     aggregateChunks(in.readBytes((int) chunkSize));
                     state = State.FOOTER_ONE;
                     break;
-                case FOOTER_ONE:
-                {
+                case FOOTER_ONE: {
                     final byte b = in.readByte();
                     checkNewLine(b,"Malformed chunk footer encountered (byte 0)");
                     state = State.FOOTER_TWO;
                     chunkSize = 0;
                     break;
                 }
-                case FOOTER_TWO:
-                {
+                case FOOTER_TWO: {
                     final byte b = in.readByte();
                     checkHash(b,"Malformed chunk footer encountered (byte 1)");
                     state = State.FOOTER_THREE;
                     break;
                 }
-                case FOOTER_THREE:
-                {
+                case FOOTER_THREE: {
                     final byte b = in.readByte();
                     // In this state, either header-of-new-chunk or message-end is expected
                     // Depends on the next character
                     extractNewChunkOrMessageEnd(b);
                     break;
                 }
-                case FOOTER_FOUR:
-                {
+                case FOOTER_FOUR: {
                     final byte b = in.readByte();
                     checkNewLine(b,"Malformed chunk footer encountered (byte 3)");
                     state = State.HEADER_ONE;
@@ -151,10 +145,8 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder {
                     chunk = null;
                     break;
                 }
-                default :
-                {
+                default:
                     LOG.info("Unknown state.");
-                }
             }
         }
 
@@ -170,7 +162,7 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder {
         } else if (byteToCheck == '#') {
             state = State.FOOTER_FOUR;
         } else {
-            LOG.debug(GOT_PARAM_WHILE_WAITING_FOR_PARAM_PARAM, byteToCheck, (byte) '#', (byte) '1', (byte) '9');
+            LOG.debug(GOT_PARAM_WHILE_WAITING_FOR_PARAM_PARAM_PARAM, byteToCheck, (byte) '#', (byte) '1', (byte) '9');
             throw new IllegalStateException("Malformed chunk footer encountered (byte 2)");
         }
     }
index b0d9cf75baae8599de5cd0722d642b96e4d91fae..3e0983812e7e0093c95184bf23bbece2ac6ee0cf 100644 (file)
@@ -142,7 +142,7 @@ public class CreateSubscription extends AbstractSingletonNetconfOperation
                         currentSession.sendMessage(new NetconfNotification(filtered.get(), eventTime));
                     }
                 } catch (DocumentedException e) {
-                    LOG.warn(e.toString());
+                    LOG.warn("Failed to process notification {}", notification, e);
                     currentSession.sendMessage(notification);
                 }
             } else {
index edd63653f1745d8df5eaae6c8e05b2c0dbd8eb02..49f8b85242535108e9480acd841b8d7a1c777361 100644 (file)
@@ -85,12 +85,10 @@ final class SshProxyClientHandler extends ChannelInboundHandlerAdapter {
 
     @Override
     public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
-        LOG.debug("Internal connection to netconf server was dropped for client: {} on channel: ",
+        LOG.debug("Internal connection to netconf server was dropped for client: {} on channel: {}",
                 netconfHelloMessageAdditionalHeader.getAddress(), ctx.channel());
         callback.onExit(1, "Internal connection to netconf server was dropped for client: "
                 + netconfHelloMessageAdditionalHeader.getAddress() + " on channel: " + ctx.channel());
         super.channelInactive(ctx);
     }
-
-
 }
index b6e56fbef4e1b867aa02d88bba327a9615f39267..17ea6cf2437ab43389beacf2e4fd018c5b4eeb57 100644 (file)
@@ -43,7 +43,7 @@ import scala.concurrent.Future;
 
 public class ProxyDOMRpcService implements DOMRpcService {
 
-    private static final Logger LOG = LoggerFactory.getLogger(NetconfTopologyManager.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ProxyDOMRpcService.class);
 
     private final ExceptionMapper<DOMRpcException> domRpcExceptionMapper =
         new ExceptionMapper<DOMRpcException>("invokeRpc", DOMRpcException.class) {
index 68366c115cf3c82e51ca5958c2345266d27500c8..a9acbe0c04f473811691f239b3746c818d07fc56 100644 (file)
@@ -127,7 +127,7 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector {
 
             @Override
             public void onFailure(@Nullable final Throwable throwable) {
-                LOG.error("{}: Connector failed, {}", remoteDeviceId, throwable);
+                LOG.error("{}: Connector failed", remoteDeviceId, throwable);
             }
         }, MoreExecutors.directExecutor());
     }
index 97d51cb73021e11078b8277c99272ad55bc52981..21e9a096f9218e939a8e7aadc85dcea0be9ddcfd 100644 (file)
@@ -35,7 +35,7 @@ class FailedProxyTransactionFacade implements ProxyTransactionFacade {
     private final RemoteDeviceId id;
     private final Throwable failure;
 
-    FailedProxyTransactionFacade(RemoteDeviceId id, Throwable failure) {
+    FailedProxyTransactionFacade(final RemoteDeviceId id, final Throwable failure) {
         this.id = Objects.requireNonNull(id);
         this.failure = Objects.requireNonNull(failure);
     }
@@ -51,38 +51,41 @@ class FailedProxyTransactionFacade implements ProxyTransactionFacade {
     }
 
     @Override
-    public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(LogicalDatastoreType store,
-            YangInstanceIdentifier path) {
-        LOG.debug("{}: Read {} {} - failure {}", id, store, path, failure);
+    public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
+            final YangInstanceIdentifier path) {
+        LOG.debug("{}: Read {} {} - failure", id, store, path, failure);
         return Futures.immediateFailedCheckedFuture(ReadFailedException.MAPPER.apply(
                 failure instanceof Exception ? (Exception)failure : new ReadFailedException("read", failure)));
     }
 
     @Override
-    public CheckedFuture<Boolean, ReadFailedException> exists(LogicalDatastoreType store, YangInstanceIdentifier path) {
-        LOG.debug("{}: Exists {} {} - failure {}", id, store, path, failure);
+    public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
+            final YangInstanceIdentifier path) {
+        LOG.debug("{}: Exists {} {} - failure", id, store, path, failure);
         return Futures.immediateFailedCheckedFuture(ReadFailedException.MAPPER.apply(
                 failure instanceof Exception ? (Exception)failure : new ReadFailedException("read", failure)));
     }
 
     @Override
-    public void delete(LogicalDatastoreType store, YangInstanceIdentifier path) {
-        LOG.debug("{}: Delete {} {} - failure {}", id, store, path, failure);
+    public void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
+        LOG.debug("{}: Delete {} {} - failure", id, store, path, failure);
     }
 
     @Override
-    public void put(LogicalDatastoreType store, YangInstanceIdentifier path, NormalizedNode<?, ?> data) {
-        LOG.debug("{}: Put {} {} - failure {}", id, store, path, failure);
+    public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path,
+            final NormalizedNode<?, ?> data) {
+        LOG.debug("{}: Put {} {} - failure", id, store, path, failure);
     }
 
     @Override
-    public void merge(LogicalDatastoreType store, YangInstanceIdentifier path, NormalizedNode<?, ?> data) {
-        LOG.debug("{}: Merge {} {} - failure {}", id, store, path, failure);
+    public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path,
+            final NormalizedNode<?, ?> data) {
+        LOG.debug("{}: Merge {} {} - failure", id, store, path, failure);
     }
 
     @Override
     public @NonNull FluentFuture<? extends @NonNull CommitInfo> commit() {
-        LOG.debug("{}: Commit {} {} - failure {}", id, failure);
+        LOG.debug("{}: Commit - failure", id, failure);
         return FluentFuture.from(Futures.immediateFailedFuture(failure instanceof Exception
                 ? AsyncWriteTransaction.SUBMIT_EXCEPTION_MAPPER.apply((Exception)failure)
                         : new TransactionCommitFailedException("commit", failure)));
index a7eb35de687265b349abc8355cc1281e87bee712..4f70d88a7dc88111ddf329adec070554c180f530 100644 (file)
@@ -46,7 +46,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public final class NetconfTopologyUtils {
-    private static Logger LOG = LoggerFactory.getLogger(NetconfTopologyUtils.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfTopologyUtils.class);
 
     private static final String DEFAULT_SCHEMA_REPOSITORY_NAME = "sal-netconf-connector";
 
index a7ad10784f30a6a52801595ca64a584e762bfeb9..c23046e86f72b2aad8cdb0453888c2ad609604d3 100644 (file)
@@ -44,6 +44,7 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map.Entry;
+import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
@@ -623,7 +624,7 @@ public class MountPointEndToEndTest {
     private AbstractConcurrentDataBrokerTest newDataBrokerTest() throws Exception {
         AbstractConcurrentDataBrokerTest dataBrokerTest = new AbstractConcurrentDataBrokerTest(true) {
             @Override
-            protected Iterable<YangModuleInfo> getModuleInfos() throws Exception {
+            protected Set<YangModuleInfo> getModuleInfos() throws Exception {
                 return ImmutableSet.of(BindingReflections.getModuleInfo(NetconfNode.class),
                         BindingReflections.getModuleInfo(NetworkTopology.class),
                         BindingReflections.getModuleInfo(Topology.class),
index d2c3638f696605c9ada1df859efbf9772e99faf2..2a5876ef6f0cefd680aeaab150f2c04eb25d8096 100644 (file)
@@ -32,6 +32,7 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Function;
 import javax.annotation.Nonnull;
@@ -100,7 +101,7 @@ public class NetconfTopologyManagerTest {
 
         ConstantSchemaAbstractDataBrokerTest dataBrokerTest = new ConstantSchemaAbstractDataBrokerTest(false) {
             @Override
-            protected Iterable<YangModuleInfo> getModuleInfos() throws Exception {
+            protected Set<YangModuleInfo> getModuleInfos() throws Exception {
                 return ImmutableSet.of(BindingReflections.getModuleInfo(NetworkTopology.class),
                         BindingReflections.getModuleInfo(Topology.class));
             }
index 818a3895dc0fe2944d3c35a1cfaf47f7393c6922..4bfdcd3c4ca946ff09209612b8f7f199c575e64e 100644 (file)
@@ -290,12 +290,12 @@ public abstract class AbstractNetconfTopology implements NetconfTopology {
         Futures.addCallback(future, new FutureCallback<NetconfDeviceCapabilities>() {
             @Override
             public void onSuccess(final NetconfDeviceCapabilities result) {
-                LOG.debug("Connector for : " + nodeId.getValue() + " started succesfully");
+                LOG.debug("Connector for {} started succesfully", nodeId.getValue());
             }
 
             @Override
             public void onFailure(final Throwable throwable) {
-                LOG.error("Connector for : " + nodeId.getValue() + " failed");
+                LOG.error("Connector for {} failed", nodeId.getValue(), throwable);
                 // remove this node from active connectors?
             }
         }, MoreExecutors.directExecutor());
@@ -303,8 +303,7 @@ public abstract class AbstractNetconfTopology implements NetconfTopology {
         return future;
     }
 
-    protected NetconfConnectorDTO createDeviceCommunicator(final NodeId nodeId,
-                                                           final NetconfNode node) {
+    protected NetconfConnectorDTO createDeviceCommunicator(final NodeId nodeId, final NetconfNode node) {
         //setup default values since default value is not supported in mdsal
         final long defaultRequestTimeoutMillis = node.getDefaultRequestTimeoutMillis() == null
                 ? DEFAULT_REQUEST_TIMEOUT_MILLIS : node.getDefaultRequestTimeoutMillis();
index 781eb2aff1bcdb6240f98e21965bd6479744a76e..996f7c91ca706f26db5f3981aa64c0854d8aa335 100644 (file)
@@ -90,7 +90,7 @@ public class NetconfConnectorFactoryImpl implements NetconfConnectorFactory {
 
             @Override
             public void onFailure(final Throwable throwable) {
-                LOG.error("Node {} creation failed: {}", instanceName, throwable);
+                LOG.error("Node {} creation failed", instanceName, throwable);
             }
         }, MoreExecutors.directExecutor());
         return node;
index f89d2848ef3cae6f52d11a19b1ce5e2b4738b496..1f09f55edcf2a57a338831f4b05d464ff62acfa1 100644 (file)
@@ -31,14 +31,14 @@ public final class SendErrorExceptionUtil {
 
     public static void sendErrorMessage(final NetconfSession session,
             final DocumentedException sendErrorException) {
-        LOG.trace("Sending error {}", sendErrorException.getMessage(), sendErrorException);
+        LOG.trace("Sending error", sendErrorException);
         final Document errorDocument = createDocument(sendErrorException);
         ChannelFuture channelFuture = session.sendMessage(new NetconfMessage(errorDocument));
         channelFuture.addListener(new SendErrorVerifyingListener(sendErrorException));
     }
 
     public static void sendErrorMessage(final Channel channel, final DocumentedException sendErrorException) {
-        LOG.trace("Sending error {}", sendErrorException.getMessage(), sendErrorException);
+        LOG.trace("Sending error", sendErrorException);
         final Document errorDocument = createDocument(sendErrorException);
         ChannelFuture channelFuture = channel.writeAndFlush(new NetconfMessage(errorDocument));
         channelFuture.addListener(new SendErrorVerifyingListener(sendErrorException));
index 993b1230bda2f51e48598ec8de68cc7dcb2a2fcc..633db8581b43c05d9d121d9bb3f74c69f234cf83 100644 (file)
@@ -172,7 +172,7 @@ public class NetconfDevice
 
             @Override
             public void onFailure(final Throwable throwable) {
-                LOG.warn("{}: Unexpected error resolving device sources: {}", id, throwable);
+                LOG.warn("{}: Unexpected error resolving device sources", id, throwable);
                 handleSalInitializationFailure(throwable, listener);
             }
         };
index b962ae20757c034bbef70201a3fd6be0b2bf59c1..df5e43e4c5949bc635e1328e6dee599834763f3e 100644 (file)
@@ -345,8 +345,8 @@ public class NetconfDeviceCommunicator
         sessionLock.lock();
         try {
             if (semaphore != null && !semaphore.tryAcquire()) {
-                LOG.warn("Limit of concurrent rpc messages was reached (limit :" + concurentRpcMsgs
-                    + "). Rpc reply message is needed. Discarding request of Netconf device with id" + id.getName());
+                LOG.warn("Limit of concurrent rpc messages was reached (limit: {}). Rpc reply message is needed. "
+                    + "Discarding request of Netconf device with id {}", concurentRpcMsgs, id.getName());
                 return Futures.immediateFailedFuture(new NetconfDocumentedException(
                         "Limit of rpc messages was reached (Limit :" + concurentRpcMsgs
                         + ") waiting for emptying the queue of Netconf device with id" + id.getName()));
index b215f882d23bf212e811f0fd56495df679c21458..ca84151ae9e208923bf0a4af3353e8cc065dc68f 100644 (file)
@@ -50,7 +50,7 @@ public class NetconfDeviceSalProvider implements AutoCloseable {
 
         @Override
         public void onTransactionChainSuccessful(final TransactionChain<?, ?> chain) {
-            LOG.trace("{}: TransactionChain({}) {} SUCCESSFUL", id, chain);
+            LOG.trace("{}: TransactionChain({}) SUCCESSFUL", id, chain);
         }
     };
 
@@ -123,7 +123,7 @@ public class NetconfDeviceSalProvider implements AutoCloseable {
 
         public synchronized void onTopologyDeviceConnected(final SchemaContext initialCtx,
                 final DOMDataBroker broker, final DOMRpcService rpc,
-                final NetconfDeviceNotificationService newNotificationService, DOMActionService deviceAction) {
+                final NetconfDeviceNotificationService newNotificationService, final DOMActionService deviceAction) {
             Preconditions.checkNotNull(mountService, "Closed");
             Preconditions.checkState(topologyRegistration == null, "Already initialized");
 
index 5bc790363466de47a6b707715bb25efb5d79fb45..62e7341ca8f9db500b8db2fb065dc61d13575327 100644 (file)
@@ -213,14 +213,14 @@ public class NetconfDeviceTopologyAdapter implements AutoCloseable {
     private void createNetworkTopologyIfNotPresent(final WriteTransaction writeTx) {
 
         final NetworkTopology networkTopology = new NetworkTopologyBuilder().build();
-        LOG.trace("{}: Merging {} container to ensure its presence", id,
-                NetworkTopology.QNAME, writeTx.getIdentifier());
+        LOG.trace("{}: Transaction {} merging {} container to ensure its presence", id, writeTx.getIdentifier(),
+            NetworkTopology.QNAME);
         writeTx.merge(LogicalDatastoreType.OPERATIONAL, networkTopologyPath, networkTopology);
 
         final Topology topology =
                 new TopologyBuilder().setTopologyId(new TopologyId(TopologyNetconf.QNAME.getLocalName())).build();
-        LOG.trace("{}: Merging {} container to ensure its presence", id,
-                Topology.QNAME, writeTx.getIdentifier());
+        LOG.trace("{}: Transaction {} merging {} container to ensure its presence", id, writeTx.getIdentifier(),
+                Topology.QNAME);
         writeTx.merge(LogicalDatastoreType.OPERATIONAL, topologyListPath, topology);
     }
 
index 9544559d0dbabc4e0d875437b96a03943cb6b9c5..8a0595fde6038f4828ddb313ed6570b5f2c9f3be 100644 (file)
@@ -5,8 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
-
 package org.opendaylight.netconf.test.tool;
 
 import com.ning.http.client.AsyncCompletionHandler;
@@ -38,7 +36,7 @@ public class Execution implements Callable<Void> {
         private final String destination;
         private final String payload;
 
-        DestToPayload(String destination, String payload) {
+        DestToPayload(final String destination, final String payload) {
             this.destination = destination;
             this.payload = payload;
         }
@@ -52,7 +50,7 @@ public class Execution implements Callable<Void> {
         }
     }
 
-    public Execution(TesttoolParameters params, ArrayList<DestToPayload> payloads) {
+    public Execution(final TesttoolParameters params, final ArrayList<DestToPayload> payloads) {
         this.invokeAsync = params.async;
         this.throttle = params.throttle / params.threadAmount;
 
@@ -100,11 +98,11 @@ public class Execution implements Callable<Void> {
                     } else {
                         LOG.warn("Status code: {}", response.getStatusCode());
                         LOG.warn("url: {}", request.getUrl());
-                        LOG.warn(response.getResponseBody());
+                        LOG.warn("body: {}", response.getResponseBody());
                     }
                 }
             } catch (InterruptedException | ExecutionException | IOException e) {
-                LOG.warn(e.toString());
+                LOG.warn("Failed to execute request", e);
             }
         }
         LOG.info("End sending sync requests");
@@ -121,7 +119,7 @@ public class Execution implements Callable<Void> {
             }
             asyncHttpClient.executeRequest(request, new AsyncCompletionHandler<Response>() {
                 @Override
-                public STATE onStatusReceived(HttpResponseStatus status) throws Exception {
+                public STATE onStatusReceived(final HttpResponseStatus status) throws Exception {
                     super.onStatusReceived(status);
                     if (status.getStatusCode() != 200 && status.getStatusCode() != 204) {
                         if (status.getStatusCode() == 409) {
@@ -137,7 +135,7 @@ public class Execution implements Callable<Void> {
                 }
 
                 @Override
-                public Response onCompleted(Response response) {
+                public Response onCompleted(final Response response) {
                     semaphore.release();
                     return response;
                 }
index f67c96e2f4399de2c4fffaccd43b76a1f5d9f849..7d4d7e4cf19e143b755cf8e5f06ab736ed4f5ed6 100644 (file)
@@ -36,7 +36,7 @@ import org.opendaylight.netconf.test.tool.config.ConfigurationBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@SuppressFBWarnings({"DM_EXIT", "DM_DEFAULT_ENCODING"})
+@SuppressFBWarnings({"DM_EXIT", "DM_DEFAULT_ENCODING", "SLF4J_LOGGER_SHOULD_BE_FINAL"})
 public final class ScaleUtil {
     private static final ScheduledExecutorService EXECUTOR = new LoggingWrapperExecutor(4);
     private static final Semaphore SEMAPHORE = new Semaphore(0);
@@ -178,7 +178,7 @@ public final class ScaleUtil {
         deleteFolder(new File(params.distroFolder.getAbsoluteFile() + "/data"));
     }
 
-    private static void deleteFolder(File folder) {
+    private static void deleteFolder(final File folder) {
         File[] files = folder.listFiles();
         if (files != null) { //some JVMs return null for empty dirs
             for (File f : files) {
@@ -269,19 +269,19 @@ public final class ScaleUtil {
 
     @SuppressWarnings("checkstyle:illegalCatch")
     public static class LoggingWrapperExecutor extends ScheduledThreadPoolExecutor {
-        public LoggingWrapperExecutor(int corePoolSize) {
+        public LoggingWrapperExecutor(final int corePoolSize) {
             super(corePoolSize);
         }
 
         @Override
-        public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) {
+        public <V> ScheduledFuture<V> schedule(final Callable<V> callable, final long delay, final TimeUnit unit) {
             return super.schedule(new LogOnExceptionCallable<>(callable), delay, unit);
         }
 
         private static class LogOnExceptionCallable<T> implements Callable<T> {
             private final Callable<T> theCallable;
 
-            LogOnExceptionCallable(Callable<T> theCallable) {
+            LogOnExceptionCallable(final Callable<T> theCallable) {
                 this.theCallable = theCallable;
             }
 
index d8d6002095d9cf27a4422ff080df9b919d9df29a..1aeb843f5165408ff4f80b14c7b9b1a1bde56e1f 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.test.tool.client.http.perf;
 
 import com.ning.http.client.AsyncHttpClient;
@@ -43,10 +42,10 @@ public class SyncExecutionStrategy implements ExecutionStrategy {
                 if (response.getStatusCode() != 200 && response.getStatusCode() != 204) {
                     LOG.warn("Status code: {}", response.getStatusCode());
                     LOG.warn("url: {}", request.getUrl());
-                    LOG.warn(response.getResponseBody());
+                    LOG.warn("body: {}", response.getResponseBody());
                 }
             } catch (InterruptedException | ExecutionException | IOException e) {
-                LOG.warn(e.toString());
+                LOG.warn("Failed to execute request", e);
             }
         }
         LOG.info("End sending sync requests");
index 763a7b8b67d7c4ad5624edb83a67478027c27ea5..6b51558546d1354363c7d2ad12e4a4771e5dd37d 100644 (file)
@@ -117,12 +117,11 @@ public final class StressClient {
         root.setLevel(params.debug ? Level.DEBUG : Level.INFO);
 
         final int threadAmount = params.threadAmount;
-        LOG.info("thread amount: " + threadAmount);
+        LOG.info("thread amount: {}", threadAmount);
         final int requestsPerThread = params.editCount / params.threadAmount;
-        LOG.info("requestsPerThread: " + requestsPerThread);
+        LOG.info("requestsPerThread: {}", requestsPerThread);
         final int leftoverRequests = params.editCount % params.threadAmount;
-        LOG.info("leftoverRequests: " + leftoverRequests);
-
+        LOG.info("leftoverRequests: {}", leftoverRequests);
 
         LOG.info("Preparing messages");
         // Prepare all msgs up front
@@ -150,7 +149,7 @@ public final class StressClient {
                 padding = leftoverRequests;
             }
             for (int j = 0; j < requestsPerThread + padding; j++) {
-                LOG.debug("id: " + (i * requestsPerThread + j));
+                LOG.debug("id: {}", i * requestsPerThread + j);
                 preparedMessages.add(prepareMessage(i * requestsPerThread + j, editContentString));
             }
         }
index 9ac7b647c0b22412c507331bb752145094809819..c038b6bc6bd525397332d9c60b38814f651d9543 100644 (file)
@@ -76,13 +76,14 @@ public final class SchemaSourceCache<T extends SchemaSourceRepresentation>
 
     @Override
     public synchronized ListenableFuture<? extends T> getSource(final SourceIdentifier sourceIdentifier) {
-        ModelData modelData = cachedSchemas.get(sourceIdentifier.toYangFilename());
+        final String fileName = sourceIdentifier.toYangFilename();
+        ModelData modelData = cachedSchemas.get(fileName);
         if (modelData != null) {
             final SchemaSourceRepresentation restored = restoreAsType(modelData.getId(), modelData.getPath());
             return Futures.immediateFuture(representation.cast(restored));
         }
 
-        LOG.debug("Source {} not found in cache as {}", sourceIdentifier);
+        LOG.debug("Source {} not found in cache as {}", sourceIdentifier, fileName);
         return Futures.immediateFailedFuture(new MissingSchemaSourceException("Source not found", sourceIdentifier));
     }
 
index 49427f1a749ef374b6c73387ee29ea0b0eaa6d9d..ffe11aed7a7f1776d8412467b0c70faaaf1dc2fa 100644 (file)
@@ -100,16 +100,16 @@ public class BrokerFacade implements Closeable {
     private final DOMNotificationService domNotification;
     private final ControllerContext controllerContext;
 
-    private BrokerFacade(DOMRpcService rpcService, DOMDataBroker domDataBroker, DOMNotificationService domNotification,
-            ControllerContext controllerContext) {
+    private BrokerFacade(final DOMRpcService rpcService, final DOMDataBroker domDataBroker,
+            final DOMNotificationService domNotification, final ControllerContext controllerContext) {
         this.rpcService = Objects.requireNonNull(rpcService);
         this.domDataBroker = Objects.requireNonNull(domDataBroker);
         this.domNotification = Objects.requireNonNull(domNotification);
         this.controllerContext = Objects.requireNonNull(controllerContext);
     }
 
-    public static BrokerFacade newInstance(DOMRpcService rpcService, DOMDataBroker domDataBroker,
-            DOMNotificationService domNotification, ControllerContext controllerContext) {
+    public static BrokerFacade newInstance(final DOMRpcService rpcService, final DOMDataBroker domDataBroker,
+            final DOMNotificationService domNotification, final ControllerContext controllerContext) {
         return new BrokerFacade(rpcService, domDataBroker, domNotification, controllerContext);
     }
 
@@ -176,9 +176,7 @@ public class BrokerFacade implements Closeable {
                 return readDataViaTransaction(tx, CONFIGURATION, path, withDefa);
             }
         }
-        final String errMsg = "DOM data broker service isn't available for mount point " + path;
-        LOG.warn(errMsg);
-        throw new RestconfDocumentedException(errMsg);
+        throw dataBrokerUnavailable(path);
     }
 
     /**
@@ -210,9 +208,7 @@ public class BrokerFacade implements Closeable {
                 return readDataViaTransaction(tx, OPERATIONAL, path);
             }
         }
-        final String errMsg = "DOM data broker service isn't available for mount point " + path;
-        LOG.warn(errMsg);
-        throw new RestconfDocumentedException(errMsg);
+        throw dataBrokerUnavailable(path);
     }
 
     /**
@@ -287,9 +283,7 @@ public class BrokerFacade implements Closeable {
                     point);
             return new PutResult(status, future);
         }
-        final String errMsg = "DOM data broker service isn't available for mount point " + path;
-        LOG.warn(errMsg);
-        throw new RestconfDocumentedException(errMsg);
+        throw dataBrokerUnavailable(path);
     }
 
     public PatchStatusContext patchConfigurationDataWithinTransaction(final PatchContext patchContext)
@@ -464,9 +458,7 @@ public class BrokerFacade implements Closeable {
             return postDataViaTransaction(domDataBrokerService.get().newReadWriteTransaction(), CONFIGURATION, path,
                     payload, mountPoint.getSchemaContext(), insert, point);
         }
-        final String errMsg = "DOM data broker service isn't available for mount point " + path;
-        LOG.warn(errMsg);
-        throw new RestconfDocumentedException(errMsg);
+        throw dataBrokerUnavailable(path);
     }
 
     // DELETE configuration
@@ -481,9 +473,7 @@ public class BrokerFacade implements Closeable {
         if (domDataBrokerService.isPresent()) {
             return deleteDataViaTransaction(domDataBrokerService.get().newReadWriteTransaction(), CONFIGURATION, path);
         }
-        final String errMsg = "DOM data broker service isn't available for mount point " + path;
-        LOG.warn(errMsg);
-        throw new RestconfDocumentedException(errMsg);
+        throw dataBrokerUnavailable(path);
     }
 
     // RPC
@@ -948,8 +938,7 @@ public class BrokerFacade implements Closeable {
     private static void checkItemExists(final DOMDataReadWriteTransaction rwTransaction,
             final LogicalDatastoreType store, final YangInstanceIdentifier path) {
         if (!doesItemExist(rwTransaction, store, path)) {
-            final String errMsg = "Operation via Restconf was not executed because data does not exist";
-            LOG.trace("{}:{}", errMsg, path);
+            LOG.trace("Operation via Restconf was not executed because data at {} does not exist", path);
             rwTransaction.cancel();
             throw new RestconfDocumentedException("Data does not exist for path: " + path, ErrorType.PROTOCOL,
                     ErrorTag.DATA_MISSING);
@@ -965,8 +954,7 @@ public class BrokerFacade implements Closeable {
     private static void checkItemDoesNotExists(final DOMDataReadWriteTransaction rwTransaction,
             final LogicalDatastoreType store, final YangInstanceIdentifier path) {
         if (doesItemExist(rwTransaction, store, path)) {
-            final String errMsg = "Operation via Restconf was not executed because data already exists";
-            LOG.trace("{}:{}", errMsg, path);
+            LOG.trace("Operation via Restconf was not executed because data at {} already exists", path);
             rwTransaction.cancel();
             throw new RestconfDocumentedException("Data already exists for path: " + path, ErrorType.PROTOCOL,
                     ErrorTag.DATA_EXISTS);
@@ -1236,6 +1224,11 @@ public class BrokerFacade implements Closeable {
         tx.merge(store, rootNormalizedPath, parentStructure);
     }
 
+    private static RestconfDocumentedException dataBrokerUnavailable(final YangInstanceIdentifier path) {
+        LOG.warn("DOM data broker service is not available for mount point {}", path);
+        return new RestconfDocumentedException("DOM data broker service is not available for mount point " + path);
+    }
+
     private static final class PatchStatusContextHelper {
         PatchStatusContext status;
 
index 513060e7bee6b756be50dc009c0c708f5181ffaf..a3fc3c5b2dddd0977e820c14eb8f9b29cd8f0e9a 100644 (file)
@@ -116,15 +116,12 @@ public final class RestCodec {
                         }
                         return typeAwarecodec.deserialize(String.valueOf(input));
                     } else {
-                        LOG.debug("Codec for type \"" + this.type.getQName().getLocalName()
-                                + "\" is not implemented yet.");
+                        LOG.debug("Codec for type \"{}\" is not implemented yet.", type.getQName().getLocalName());
                         return null;
                     }
                 }
             } catch (final ClassCastException e) { // TODO remove this catch when everyone use codecs
-                LOG.error(
-                        "ClassCastException was thrown when codec is invoked with parameter " + String.valueOf(input),
-                        e);
+                LOG.error("ClassCastException was thrown when codec is invoked with parameter {}", input, e);
                 return null;
             }
         }
@@ -145,17 +142,12 @@ public final class RestCodec {
                     if (typeAwarecodec != null) {
                         return typeAwarecodec.serialize(input);
                     } else {
-                        if (LOG.isDebugEnabled()) {
-                            LOG.debug("Codec for type \"" + this.type.getQName().getLocalName()
-                                + "\" is not implemented yet.");
-                        }
+                        LOG.debug("Codec for type \"{}\" is not implemented yet.", type.getQName().getLocalName());
                         return null;
                     }
                 }
             } catch (final ClassCastException e) { // TODO remove this catch when everyone use codecs
-                LOG.error(
-                        "ClassCastException was thrown when codec is invoked with parameter " + String.valueOf(input),
-                        e);
+                LOG.error("ClassCastException was thrown when codec is invoked with parameter {}", input, e);
                 return input;
             }
         }
@@ -169,7 +161,7 @@ public final class RestCodec {
         private final DOMMountPoint mountPoint;
         private final ControllerContext controllerContext;
 
-        public IdentityrefCodecImpl(final DOMMountPoint mountPoint, ControllerContext controllerContext) {
+        public IdentityrefCodecImpl(final DOMMountPoint mountPoint, final ControllerContext controllerContext) {
             this.mountPoint = mountPoint;
             this.controllerContext = controllerContext;
         }
@@ -350,7 +342,7 @@ public final class RestCodec {
             module = controllerContext.findModuleByNamespace(validNamespace);
         }
         if (module == null) {
-            LOG.info("Module for namespace " + validNamespace + " wasn't found.");
+            LOG.info("Module for namespace {} was not found.", validNamespace);
             return null;
         }
         return module;
index 60800413a433bc2b1e834842d6c40df4505d1d3d..d748ef32c0d1b6194ca2c049031c100fb5a8e984 100644 (file)
@@ -175,12 +175,12 @@ public final class RestconfImpl implements RestconfService {
 
     private final ControllerContext controllerContext;
 
-    private RestconfImpl(BrokerFacade broker, ControllerContext controllerContext) {
+    private RestconfImpl(final BrokerFacade broker, final ControllerContext controllerContext) {
         this.broker = broker;
         this.controllerContext = controllerContext;
     }
 
-    public static RestconfImpl newInstance(BrokerFacade broker, ControllerContext controllerContext) {
+    public static RestconfImpl newInstance(final BrokerFacade broker, final ControllerContext controllerContext) {
         return new RestconfImpl(broker, controllerContext);
     }
 
@@ -213,7 +213,7 @@ public final class RestconfImpl implements RestconfService {
         if (!identifier.contains(ControllerContext.MOUNT)) {
             final String errMsg = "URI has bad format. If modules behind mount point should be showed,"
                     + " URI has to end with " + ControllerContext.MOUNT;
-            LOG.debug(errMsg + " for " + identifier);
+            LOG.debug("{} for {}", errMsg, identifier);
             throw new RestconfDocumentedException(errMsg, ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
         }
 
@@ -258,10 +258,9 @@ public final class RestconfImpl implements RestconfService {
         }
 
         if (module == null) {
-            final String errMsg = "Module with name '" + nameRev.getKey() + "' and revision '"
-                    + nameRev.getValue() + "' was not found.";
-            LOG.debug(errMsg);
-            throw new RestconfDocumentedException(errMsg, ErrorType.PROTOCOL, ErrorTag.UNKNOWN_ELEMENT);
+            LOG.debug("Module with name '{}' and revision '{}' was not found.", nameRev.getKey(), nameRev.getValue());
+            throw new RestconfDocumentedException("Module with name '" + nameRev.getKey() + "' and revision '"
+                    + nameRev.getValue() + "' was not found.", ErrorType.PROTOCOL, ErrorTag.UNKNOWN_ELEMENT);
         }
 
         final Module restconfModule = getRestconfModule();
@@ -323,11 +322,10 @@ public final class RestconfImpl implements RestconfService {
             modules = this.controllerContext.getAllModules(mountPoint);
 
         } else {
-            final String errMsg =
-                    "URI has bad format. If operations behind mount point should be showed, URI has to " + "end with ";
-            LOG.debug(errMsg + ControllerContext.MOUNT + " for " + identifier);
-            throw new RestconfDocumentedException(errMsg + ControllerContext.MOUNT, ErrorType.PROTOCOL,
-                    ErrorTag.INVALID_VALUE);
+            final String errMsg = "URI has bad format. If operations behind mount point should be showed, URI has to "
+                    + " end with " +  ControllerContext.MOUNT;
+            LOG.debug("{} for {}", errMsg, identifier);
+            throw new RestconfDocumentedException(errMsg, ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
         }
 
         return operationsFromModulesToNormalizedContext(modules, mountPoint);
@@ -402,7 +400,7 @@ public final class RestconfImpl implements RestconfService {
         final Splitter splitter = Splitter.on('/').omitEmptyStrings();
         final List<String> pathArgs = splitter.splitToList(moduleNameAndRevision);
         if (pathArgs.size() < 2) {
-            LOG.debug("URI has bad format. It should be \'moduleName/yyyy-MM-dd\' " + identifier);
+            LOG.debug("URI has bad format. It should be \'moduleName/yyyy-MM-dd\' {}", identifier);
             throw new RestconfDocumentedException(
                     "URI has bad format. End of URI should be in format \'moduleName/yyyy-MM-dd\'", ErrorType.PROTOCOL,
                     ErrorTag.INVALID_VALUE);
@@ -411,7 +409,7 @@ public final class RestconfImpl implements RestconfService {
         try {
             return new SimpleImmutableEntry<>(pathArgs.get(0), Revision.of(pathArgs.get(1)));
         } catch (final DateTimeParseException e) {
-            LOG.debug("URI has bad format. It should be \'moduleName/yyyy-MM-dd\' " + identifier);
+            LOG.debug("URI has bad format. It should be \'moduleName/yyyy-MM-dd\' {}", identifier);
             throw new RestconfDocumentedException("URI has bad format. It should be \'moduleName/yyyy-MM-dd\'",
                     ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE, e);
         }
@@ -474,7 +472,7 @@ public final class RestconfImpl implements RestconfService {
 
     @Override
     public NormalizedNodeContext invokeRpc(final String identifier, final String noPayload, final UriInfo uriInfo) {
-        if (noPayload != null && !CharMatcher.WHITESPACE.matchesAllOf(noPayload)) {
+        if (noPayload != null && !CharMatcher.whitespace().matchesAllOf(noPayload)) {
             throw new RestconfDocumentedException("Content must be empty.", ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
         }
 
@@ -491,13 +489,11 @@ public final class RestconfImpl implements RestconfService {
             final String remoteRpcName = identifier.substring(startOfRemoteRpcName);
             identifierEncoded = remoteRpcName;
 
-        } else if (identifier.indexOf("/") != CHAR_NOT_FOUND) {
-            final String slashErrorMsg = String.format(
-                    "Identifier %n%s%ncan\'t contain slash "
-                            + "character (/).%nIf slash is part of identifier name then use %%2F placeholder.",
-                    identifier);
-            LOG.debug(slashErrorMsg);
-            throw new RestconfDocumentedException(slashErrorMsg, ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
+        } else if (identifier.indexOf('/') != CHAR_NOT_FOUND) {
+            LOG.debug("Identifier {} cannot contain slash character (/).", identifier);
+            throw new RestconfDocumentedException(String.format("Identifier %n%s%ncan\'t contain slash character (/).%n"
+                    + "If slash is part of identifier name then use %%2F placeholder.", identifier), ErrorType.PROTOCOL,
+                ErrorTag.INVALID_VALUE);
         } else {
             identifierEncoded = identifier;
             schemaContext = this.controllerContext.getGlobalSchema();
@@ -513,12 +509,12 @@ public final class RestconfImpl implements RestconfService {
         }
 
         if (rpc == null) {
-            LOG.debug("RPC " + identifierDecoded + " does not exist.");
+            LOG.debug("RPC {} does not exist.", identifierDecoded);
             throw new RestconfDocumentedException("RPC does not exist.", ErrorType.RPC, ErrorTag.UNKNOWN_ELEMENT);
         }
 
         if (!rpc.getInput().getChildNodes().isEmpty()) {
-            LOG.debug("RPC " + rpc + " does not need input value.");
+            LOG.debug("RPC {} does not need input value.", rpc);
             throw new RestconfDocumentedException("RPC " + rpc + " does not take any input value.",
                     ErrorType.RPC, ErrorTag.INVALID_VALUE);
         }
@@ -550,11 +546,11 @@ public final class RestconfImpl implements RestconfService {
             if (retValue.getErrors().isEmpty()) {
                 return retValue;
             }
-            LOG.debug("RpcError message", retValue.getErrors());
+            LOG.debug("RpcError message {}", retValue.getErrors());
             throw new RestconfDocumentedException("RpcError message", null, retValue.getErrors());
         } catch (final InterruptedException e) {
             final String errMsg = "The operation was interrupted while executing and did not complete.";
-            LOG.debug("Rpc Interrupt - " + errMsg, e);
+            LOG.debug("Rpc Interrupt - {}", errMsg, e);
             throw new RestconfDocumentedException(errMsg, ErrorType.RPC, ErrorTag.PARTIAL_OPERATION, e);
         } catch (final ExecutionException e) {
             LOG.debug("Execution RpcError: ", e);
@@ -579,7 +575,7 @@ public final class RestconfImpl implements RestconfService {
             }
         } catch (final CancellationException e) {
             final String errMsg = "The operation was cancelled while executing.";
-            LOG.debug("Cancel RpcExecution: " + errMsg, e);
+            LOG.debug("Cancel RpcExecution: {}", errMsg, e);
             throw new RestconfDocumentedException(errMsg, ErrorType.RPC, ErrorTag.PARTIAL_OPERATION);
         }
     }
@@ -604,9 +600,9 @@ public final class RestconfImpl implements RestconfService {
         final Object pathValue = path.isPresent() ? path.get().getValue() : null;
 
         if (!(pathValue instanceof YangInstanceIdentifier)) {
-            final String errMsg = "Instance identifier was not normalized correctly ";
-            LOG.debug(errMsg + rpcQName);
-            throw new RestconfDocumentedException(errMsg, ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED);
+            LOG.debug("Instance identifier {} was not normalized correctly", rpcQName);
+            throw new RestconfDocumentedException("Instance identifier was not normalized correctly",
+                ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED);
         }
 
         final YangInstanceIdentifier pathIdentifier = (YangInstanceIdentifier) pathValue;
@@ -631,9 +627,10 @@ public final class RestconfImpl implements RestconfService {
         }
 
         if (Strings.isNullOrEmpty(streamName)) {
-            final String errMsg = "Path is empty or contains value node which is not Container or List build-in type.";
-            LOG.debug(errMsg + pathIdentifier);
-            throw new RestconfDocumentedException(errMsg, ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
+            LOG.debug("Path is empty or contains value node which is not Container or List built-in type at {}",
+                pathIdentifier);
+            throw new RestconfDocumentedException("Path is empty or contains value node which is not Container or List "
+                    + "built-in type.", ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
         }
 
         final QName outputQname = QName.create(rpcQName, "output");
@@ -655,9 +652,9 @@ public final class RestconfImpl implements RestconfService {
     private static RpcDefinition findRpc(final SchemaContext schemaContext, final String identifierDecoded) {
         final String[] splittedIdentifier = identifierDecoded.split(":");
         if (splittedIdentifier.length != 2) {
-            final String errMsg = identifierDecoded + " couldn't be splitted to 2 parts (module:rpc name)";
-            LOG.debug(errMsg);
-            throw new RestconfDocumentedException(errMsg, ErrorType.APPLICATION, ErrorTag.INVALID_VALUE);
+            LOG.debug("{} could not be split to 2 parts (module:rpc name)", identifierDecoded);
+            throw new RestconfDocumentedException(identifierDecoded + " could not be split to 2 parts "
+                    + "(module:rpc name)", ErrorType.APPLICATION, ErrorTag.INVALID_VALUE);
         }
         for (final Module module : schemaContext.getModules()) {
             if (module.getName().equals(splittedIdentifier[0])) {
@@ -712,10 +709,7 @@ public final class RestconfImpl implements RestconfService {
             data = this.broker.readConfigurationData(normalizedII, withDefa);
         }
         if (data == null) {
-            final String errMsg =
-                    "Request could not be completed because the relevant data model content does not exist ";
-            LOG.debug(errMsg + identifier);
-            throw new RestconfDocumentedException(errMsg, ErrorType.APPLICATION, ErrorTag.DATA_MISSING);
+            throw dataMissing(identifier);
         }
         return new NormalizedNodeContext(iiWithData, data,
                 QueryParametersParser.parseWriterParameters(uriInfo, tagged));
@@ -733,14 +727,18 @@ public final class RestconfImpl implements RestconfService {
             data = this.broker.readOperationalData(normalizedII);
         }
         if (data == null) {
-            final String errMsg =
-                    "Request could not be completed because the relevant data model content does not exist ";
-            LOG.debug(errMsg + identifier);
-            throw new RestconfDocumentedException(errMsg, ErrorType.APPLICATION, ErrorTag.DATA_MISSING);
+            throw dataMissing(identifier);
         }
         return new NormalizedNodeContext(iiWithData, data, QueryParametersParser.parseWriterParameters(uriInfo));
     }
 
+    private static RestconfDocumentedException dataMissing(final String identifier) {
+        LOG.debug("Request could not be completed because the relevant data model content does not exist {}",
+            identifier);
+        return new RestconfDocumentedException("Request could not be completed because the relevant data model content "
+            + "does not exist", ErrorType.APPLICATION, ErrorTag.DATA_MISSING);
+    }
+
     @Override
     public Response updateConfigurationData(final String identifier, final NormalizedNodeContext payload,
             final UriInfo uriInfo) {
@@ -825,13 +823,13 @@ public final class RestconfImpl implements RestconfService {
             } catch (final TransactionCommitFailedException e) {
                 if (e instanceof OptimisticLockFailedException) {
                     if (--tries <= 0) {
-                        LOG.debug("Got OptimisticLockFailedException on last try - failing " + identifier);
+                        LOG.debug("Got OptimisticLockFailedException on last try - failing {}", identifier);
                         throw new RestconfDocumentedException(e.getMessage(), e, e.getErrorList());
                     }
 
-                    LOG.debug("Got OptimisticLockFailedException - trying again " + identifier);
+                    LOG.debug("Got OptimisticLockFailedException - trying again {}", identifier);
                 } else {
-                    LOG.debug("Update failed for " + identifier, e);
+                    LOG.debug("Update failed for {}", identifier, e);
                     throw new RestconfDocumentedException(e.getMessage(), e, e.getErrorList());
                 }
             }
@@ -974,7 +972,7 @@ public final class RestconfImpl implements RestconfService {
         } catch (final RestconfDocumentedException e) {
             throw e;
         } catch (final TransactionCommitFailedException e) {
-            LOG.info("Error creating data " + (uriInfo != null ? uriInfo.getPath() : ""), e);
+            LOG.info("Error creating data {}", uriInfo != null ? uriInfo.getPath() : "", e);
             throw new RestconfDocumentedException(e.getMessage(), e, e.getErrorList());
         }
 
@@ -1002,7 +1000,7 @@ public final class RestconfImpl implements RestconfService {
         try {
             uriBuilder.path(this.controllerContext.toFullRestconfIdentifier(normalizedII, mountPoint));
         } catch (final Exception e) {
-            LOG.info("Location for instance identifier" + normalizedII + "wasn't created", e);
+            LOG.info("Location for instance identifier {} was not created", normalizedII, e);
             return null;
         }
         return uriBuilder.build();
@@ -1207,7 +1205,7 @@ public final class RestconfImpl implements RestconfService {
         return uriToWebsocketServerBuilder.replacePath(streamName).build();
     }
 
-    private String getWsScheme(UriInfo uriInfo) {
+    private String getWsScheme(final UriInfo uriInfo) {
         URI uri = uriInfo.getAbsolutePath();
         if (uri == null) {
             return "ws";
index 877deda59f31cdb1363858a9b116412b55728c7b..41503253bc61bb2f75fe07f0ea0ae10b6dfbc94d 100644 (file)
@@ -65,7 +65,7 @@ abstract class AbstractCommonSubscriber extends AbstractQueryParams implements B
      */
     public void addSubscriber(final Channel subscriber) {
         if (!subscriber.isActive()) {
-            LOG.debug("Channel is not active between websocket server and subscriber {}" + subscriber.remoteAddress());
+            LOG.debug("Channel is not active between websocket server and subscriber {}", subscriber.remoteAddress());
         }
         final Event event = new Event(EventType.REGISTER);
         event.setSubscriber(subscriber);
index fc55698a99399541a717ad88d3a9c26db7084cb9..f4e1f841e1bf8fad27be0eefe3e39668ba167f51 100644 (file)
@@ -103,7 +103,7 @@ public final class RestCodec {
                     if (LOG.isDebugEnabled()) {
                         LOG.debug(
                             "Value is not instance of IdentityrefTypeDefinition but is {}. "
-                                    + "Therefore NULL is used as translation of  - {}",
+                                    + "Therefore NULL is used as translation of - {}",
                             input == null ? "null" : input.getClass(), String.valueOf(input));
                     }
                     return null;
@@ -124,15 +124,12 @@ public final class RestCodec {
                         }
                         return typeAwarecodec.deserialize(String.valueOf(input));
                     } else {
-                        LOG.debug("Codec for type \"" + this.type.getQName().getLocalName()
-                                + "\" is not implemented yet.");
+                        LOG.debug("Codec for type \"{}\" is not implemented yet.", type.getQName().getLocalName());
                         return null;
                     }
                 }
             } catch (final ClassCastException e) { // TODO remove this catch when everyone use codecs
-                LOG.error(
-                        "ClassCastException was thrown when codec is invoked with parameter " + String.valueOf(input),
-                        e);
+                LOG.error("ClassCastException was thrown when codec is invoked with parameter {}", input, e);
                 return null;
             }
         }
@@ -154,20 +151,16 @@ public final class RestCodec {
                         return typeAwarecodec.serialize(input);
                     } else {
                         if (LOG.isDebugEnabled()) {
-                            LOG.debug("Codec for type \"" + this.type.getQName().getLocalName()
-                                + "\" is not implemented yet.");
+                            LOG.debug("Codec for type \"{}\" is not implemented yet.", type.getQName().getLocalName());
                         }
                         return null;
                     }
                 }
             } catch (final ClassCastException e) { // TODO remove this catch when everyone use codecs
-                LOG.error(
-                        "ClassCastException was thrown when codec is invoked with parameter " + String.valueOf(input),
-                        e);
+                LOG.error("ClassCastException was thrown when codec is invoked with parameter {}", input, e);
                 return input;
             }
         }
-
     }
 
     public static class IdentityrefCodecImpl implements IdentityrefCodec<IdentityValuesDTO> {
@@ -355,7 +348,7 @@ public final class RestCodec {
             module = schemaContext.findModules(validNamespace).iterator().next();
         }
         if (module == null) {
-            LOG.info("Module for namespace " + validNamespace + " wasn't found.");
+            LOG.info("Module for namespace {} was not found.", validNamespace);
             return null;
         }
         return module;
index 81cdb08d96bb29c45271f5d7f7dfb1796e95b958..4acea3aad78032369a5ff4fed20ac5f156f05ca9 100644 (file)
@@ -38,7 +38,7 @@ public class TransactionChainHandler implements Handler<DOMTransactionChain>, Au
 
         @Override
         public void onTransactionChainSuccessful(final TransactionChain<?, ?> chain) {
-            LOG.trace("TransactionChain({}) {} SUCCESSFUL", chain);
+            LOG.trace("TransactionChain({}) SUCCESSFUL", chain);
         }
     };
 
index 3e31ea6d5f498af9c884f5fa5b2fd1b4facf56e6..bcb93603d5aa64a984051c385b849398b8948623 100644 (file)
@@ -228,7 +228,7 @@ public class JSONRestconfServiceRfc8040Impl implements JSONRestconfService, Auto
         return JsonNormalizedNodeBodyReader.readFrom(instanceIdentifierContext, entityStream, isPost);
     }
 
-    private  String toJson(final PatchStatusContext patchStatusContext) throws IOException {
+    private static String toJson(final PatchStatusContext patchStatusContext) throws IOException {
         final PatchJsonBodyWriter writer = new PatchJsonBodyWriter();
         final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
         writer.writeTo(patchStatusContext, PatchStatusContext.class, null, EMPTY_ANNOTATIONS,
index 8732c8f002d8156786761cd70337814055ef4f45..e088077d231854d9965a8e59f5be70758228a736 100644 (file)
@@ -179,9 +179,9 @@ public final class CreateStreamUtil {
             pathValue = path.get().getValue();
         }
         if (!(pathValue instanceof YangInstanceIdentifier)) {
-            final String errMsg = "Instance identifier was not normalized correctly ";
-            LOG.debug(errMsg + qualifiedName);
-            throw new RestconfDocumentedException(errMsg, ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED);
+            LOG.debug("Instance identifier {} was not normalized correctly", qualifiedName);
+            throw new RestconfDocumentedException("Instance identifier was not normalized correctly",
+                ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED);
         }
         return (YangInstanceIdentifier) pathValue;
     }
index 7781c71140c2dc9ab11d0f8a87d764dd87643382..2a843ce903689c29ac6e454a9dd4895a61c78cae 100644 (file)
@@ -281,10 +281,9 @@ public final class PatchDataTransactionUtil {
         FutureCallbackTx.addCallback(future, PatchData.PATCH_TX_TYPE, response);
 
         if (!response.result) {
-            final String errMsg = "Operation via Restconf was not executed because data does not exist";
-            LOG.trace("{}:{}", errMsg, path);
-            throw new RestconfDocumentedException(
-                    "Data does not exist", ErrorType.PROTOCOL, ErrorTag.DATA_MISSING, path);
+            LOG.trace("Operation via Restconf was not executed because data at {} does not exist", path);
+            throw new RestconfDocumentedException("Data does not exist", ErrorType.PROTOCOL, ErrorTag.DATA_MISSING,
+                path);
         }
     }
 
@@ -303,10 +302,9 @@ public final class PatchDataTransactionUtil {
         FutureCallbackTx.addCallback(future, PatchData.PATCH_TX_TYPE, response);
 
         if (response.result) {
-            final String errMsg = "Operation via Restconf was not executed because data already exists";
-            LOG.trace("{}:{}", errMsg, path);
-            throw new RestconfDocumentedException(
-                    "Data already exists", ErrorType.PROTOCOL, ErrorTag.DATA_EXISTS, path);
+            LOG.trace("Operation via Restconf was not executed because data at {} already exists", path);
+            throw new RestconfDocumentedException("Data already exists", ErrorType.PROTOCOL, ErrorTag.DATA_EXISTS,
+                path);
         }
     }
 }
index b5d44cd5ac344e481aea1ca187b91dc8e7a4ddab..1f023c4ca74fe794e1bcfc3c996d336c44abf572 100644 (file)
@@ -97,11 +97,11 @@ public final class RestconfInvokeOperationsUtil {
             if (response.getErrors().isEmpty()) {
                 return response;
             }
-            LOG.debug("RpcError message", response.getErrors());
+            LOG.debug("RpcError message {}", response.getErrors());
             throw new RestconfDocumentedException("RPCerror message ", null, response.getErrors());
         } catch (final CancellationException e) {
             final String errMsg = "The operation was cancelled while executing.";
-            LOG.debug("Cancel RpcExecution: " + errMsg, e);
+            LOG.debug("Cancel RpcExecution: {}", errMsg, e);
             throw new RestconfDocumentedException(errMsg, ErrorType.RPC, ErrorTag.PARTIAL_OPERATION, e);
         }
     }
index f6e50c021a31a39101b45ca3f6ca0471794bbebb..50d61dec77c4f74fb0f2530f561d6f92f5f92a1a 100644 (file)
@@ -104,8 +104,7 @@ public final class TransactionUtil {
             transactionChainHandler.reset();
 
             // throw error
-            final String errMsg = "Operation via Restconf was not executed because data does not exist";
-            LOG.trace("{}:{}", errMsg, path);
+            LOG.trace("Operation via Restconf was not executed because data at {} does not exist", path);
             throw new RestconfDocumentedException(
                     "Data does not exist", ErrorType.PROTOCOL, ErrorTag.DATA_MISSING, path);
         }
@@ -135,8 +134,7 @@ public final class TransactionUtil {
             transactionChainHandler.reset();
 
             // throw error
-            final String errMsg = "Operation via Restconf was not executed because data already exists";
-            LOG.trace("{}:{}", errMsg, path);
+            LOG.trace("Operation via Restconf was not executed because data at {} already exists", path);
             throw new RestconfDocumentedException(
                     "Data already exists", ErrorType.PROTOCOL, ErrorTag.DATA_EXISTS, path);
         }
index 51f1f3eccc3b5f64af14694de9373801ac9a131e..f25fc62f3053f727b6303f1449567c0083a8c6cf 100644 (file)
@@ -94,9 +94,9 @@ public class RestconfOperationsServiceImpl implements RestconfOperationsService
             mountPoint = mountPointIdentifier.getMountPoint();
             modules = ref.getModules(mountPoint);
         } else {
-            final String errMsg =
-                    "URI has bad format. If operations behind mount point should be showed, URI has to end with ";
-            LOG.debug(errMsg + RestconfConstants.MOUNT + " for " + identifier);
+            final String errMsg = "URI has bad format. If operations behind mount point should be showed, URI has to "
+                    + " end with " + RestconfConstants.MOUNT;
+            LOG.debug("{} for {}", errMsg, identifier);
             throw new RestconfDocumentedException(errMsg + RestconfConstants.MOUNT, ErrorType.PROTOCOL,
                     ErrorTag.INVALID_VALUE);
         }
index 6e2004eea4b571dc727043d476262dcd21278c25..ebf5da4a0d5e24cccb7142a760e92c3e46c9cb10 100644 (file)
@@ -69,7 +69,7 @@ abstract class AbstractCommonSubscriber extends AbstractQueryParams implements B
      */
     public void addSubscriber(final Channel subscriber) {
         if (!subscriber.isActive()) {
-            LOG.debug("Channel is not active between websocket server and subscriber {}" + subscriber.remoteAddress());
+            LOG.debug("Channel is not active between websocket server and subscriber {}", subscriber.remoteAddress());
         }
         final Event event = new Event(EventType.REGISTER);
         event.setSubscriber(subscriber);
index b5438ff866be2e878739c6a12aebb74b82bbe083..ee26e8372319a1490a5ee5a83ed8938fe8130ea7 100644 (file)
@@ -156,7 +156,7 @@ public final class ParserIdentifier {
         // check if more than one slash is not used as path separator
         if (identifier.contains(
                 String.valueOf(RestconfConstants.SLASH).concat(String.valueOf(RestconfConstants.SLASH)))) {
-            LOG.debug("URI has bad format. It should be \'moduleName/yyyy-MM-dd\' " + identifier);
+            LOG.debug("URI has bad format. It should be \'moduleName/yyyy-MM-dd\' {}", identifier);
             throw new RestconfDocumentedException(
                     "URI has bad format. End of URI should be in format \'moduleName/yyyy-MM-dd\'", ErrorType.PROTOCOL,
                     ErrorTag.INVALID_VALUE);
index 4ce00e647afe8ef2886192d9c685b0e9d63626e2..12baa4717e71ca1552ff39b2a86ad670bef35844 100644 (file)
@@ -76,7 +76,7 @@ public class StaticDocGenerator extends BaseYangSwaggerGeneratorDraft02
         // Create JS file
         File resourcesJsFile = new File(outputDir, "resources.js");
         if (!resourcesJsFile.createNewFile()) {
-            LOG.info("File " + resourcesJsFile + " already exists.");
+            LOG.info("File {} already exists.", resourcesJsFile);
         }
 
         try (BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(resourcesJsFile))) {
index b9f5290eff16f9be2ace3841f469cb13d52bf3d3..a47f502316ecbc5a766d319bcfa6b4d86e6c8f04 100644 (file)
@@ -68,7 +68,7 @@ public abstract class BaseYangSwaggerGenerator {
     private final ObjectMapper mapper = new ObjectMapper();
     private final DOMSchemaService schemaService;
 
-    protected BaseYangSwaggerGenerator(Optional<DOMSchemaService> schemaService) {
+    protected BaseYangSwaggerGenerator(final Optional<DOMSchemaService> schemaService) {
         this.schemaService = schemaService.orElse(null);
         this.mapper.configure(SerializationFeature.INDENT_OUTPUT, true);
     }
@@ -238,7 +238,7 @@ public abstract class BaseYangSwaggerGenerator {
                 models = this.jsonConverter.convertToJsonSchema(module, schemaContext);
                 doc.setModels(models);
                 if (LOG.isDebugEnabled()) {
-                    LOG.debug(this.mapper.writeValueAsString(doc));
+                    LOG.debug("Document: {}", this.mapper.writeValueAsString(doc));
                 }
             } catch (IOException e) {
                 LOG.error("Exception occured in ModelGenerator", e);