diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2017-12-14 13:32:14 +0100 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2017-12-14 13:20:12 +0000 |
commit | 0129a89e08791547b14230626b8f697e95d90ce8 (patch) | |
tree | e04aae981ad28ba1f25faeaed45e9746fb5b966e | |
parent | c3183d3a7eee6d46c690ba5bbe84dcc663abbdb1 (diff) |
Add Logger for RpcRegistryImplstable/1710
Change-Id: I6ef0133f0128fbf5cfb9ed9f0e738af0bda3a852
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
(cherry picked from commit 30332456b6c581085bb17d619ebb74c36e01c357)
-rw-r--r-- | infra/rpc/impl/pom.xml | 9 | ||||
-rw-r--r-- | infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/RpcRegistryBuilder.java | 5 |
2 files changed, 9 insertions, 5 deletions
diff --git a/infra/rpc/impl/pom.xml b/infra/rpc/impl/pom.xml index 09ed17882..b07120c8d 100644 --- a/infra/rpc/impl/pom.xml +++ b/infra/rpc/impl/pom.xml @@ -48,6 +48,10 @@ <artifactId>future-converter-java8-guava</artifactId> <version>0.3.0</version> </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> <!-- tests --> <dependency> @@ -65,10 +69,5 @@ <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <scope>test</scope> - </dependency> </dependencies> </project> diff --git a/infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/RpcRegistryBuilder.java b/infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/RpcRegistryBuilder.java index 0b96be0a3..ca6441ee8 100644 --- a/infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/RpcRegistryBuilder.java +++ b/infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/RpcRegistryBuilder.java @@ -25,6 +25,8 @@ import javax.annotation.Nullable; import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementationNotAvailableException; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.model.api.SchemaPath; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public final class RpcRegistryBuilder { @@ -40,6 +42,7 @@ public final class RpcRegistryBuilder { private static final class RpcRegistryImpl implements RpcRegistry { + private static final Logger LOG = LoggerFactory.getLogger(RpcRegistryImpl.class); private final Map<SchemaPath, RpcService> services; private RpcRegistryImpl(@Nonnull final Map<SchemaPath, RpcService> services) { @@ -51,11 +54,13 @@ public final class RpcRegistryBuilder { public CompletionStage invoke(@Nonnull final SchemaPath schemaPath, @Nullable final DataObject request) { final RpcService rpcService = services.get(schemaPath); if (rpcService == null) { + LOG.error("Missing Rpc service for schemaPath: {}", schemaPath); final CompletableFuture<DataObject> result = new CompletableFuture<>(); result.completeExceptionally( new DOMRpcImplementationNotAvailableException("Service not found: %s", schemaPath)); return result; } + LOG.debug("Delegating rpcRequest: {} to rpcService: {}", request, rpcService); return rpcService.invoke(request); } |