Bug 1392: New yang-common/util classes 40/9240/5
authorThomas Pantelis <tpanteli@brocade.com>
Mon, 14 Jul 2014 16:13:08 +0000 (12:13 -0400)
committerRobert Varga <rovarga@cisco.com>
Mon, 28 Jul 2014 06:15:12 +0000 (08:15 +0200)
commit701adc7aee3280f46b819a62f12324e09b2bc418
tree395a7b64898e3474ba9d397e5c0715e3daa631e5
parent986e74baf1b63ba2fa7ed2d7206a32672f98a0b7
Bug 1392: New yang-common/util classes

Needed for https://git.opendaylight.org/gerrit/#/c/9178/

OperationFailedException:

   Generalized exception class that contains an RpcError list.

MappingCheckedFuture:

   Futures#addCallback and Futures#transform call Future#get but
   CheckedFuture doesn't override the get methods to translate exceptions
   to the checked type. Thus you don't get the checked exception when using
   those Futures methods. This kind of defeats the purpose of CheckedFuture.

   The new MappingCheckedFuture class overrides the get methods to translate exceptions.

ExceptionMapper:

   Generalized class for use with CheckedFuture to translate exceptions to a
   specified exception type.

Change-Id: Idb4c7e8b5c2cf17795de2f3af4278989ac7bd116
Signed-off-by: tpantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/ExceptionMapper.java [new file with mode: 0644]
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/MappingCheckedFuture.java [new file with mode: 0644]
common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/MappingCheckedFutureTest.java [new file with mode: 0644]
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/OperationFailedException.java [new file with mode: 0644]