IdManager RPCs switched to using FutureRpcResults 50/64450/10
authorMichael Vorburger <vorburger@redhat.com>
Wed, 18 Oct 2017 12:52:15 +0000 (14:52 +0200)
committerMichael Vorburger <vorburger@redhat.com>
Thu, 2 Nov 2017 22:03:51 +0000 (22:03 +0000)
commit576053778dc1226c90661d21bb4c3d850f403ce9
tree2c180ac5758adbc44a2a41f6c13b962706a4ebbc
parent11e01f7abfa0204c5efdc894be48dfd41937d023
IdManager RPCs switched to using FutureRpcResults

This change preserves the logging of idmanager failures exactly as-is.

This first change does intentionally not yet change idmanager's behavior
and should have no impacts to users; it just simplifies the code.  (But
this means that it sort of "abuses" the FutureRpcResults, because it
does not implement real async operations returning real futures, but is
forced to be synchronous.  The idea is to raise a separate follow-up
change after this has gone in, which will make all operations async; and
there defer the sync get to the callers (or not) - after checking that
all of them really do @CheckReturnValue.)

FutureRpcResults now also logs every RPC entry point.  This is at at
level TRACE by default, but can be customized; just like success and
failure log levels can.

FutureRpcResults is also extended with a syntactic sugar short-cut
directly accepting the YANG Builder for Output often found in such RPCs.

Change-Id: If8def50e4d2e9381af045a3af725ba90e3ff7725
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
idmanager/idmanager-impl/src/main/java/org/opendaylight/genius/idmanager/IdManager.java
mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/genius/infra/FutureRpcResults.java
mdsalutil/mdsalutil-testutils/src/test/java/org/opendaylight/genius/infra/tests/FutureRpcResultsTest.java