package Ġorg . ny pl . simpl ified . books . controller Ċ Ċ import Ġcom . io 7 m . j functional . Some Ċ Ċ import Ġorg . ny pl . simpl ified . books . api . Book ID Ċ import Ġorg . ny pl . simpl ified . books . book _ database . api . Book Database Type Ċ import Ġorg . ny pl . simpl ified . books . book _ registry . Book Registry Type Ċ import Ġorg . ny pl . simpl ified . books . book _ registry . Book Status Ċ import Ġorg . ny pl . simpl ified . books . book _ registry . Book With Status Ċ import Ġorg . slf 4 j . LoggerFactory Ċ Ċ import Ġjava . util . concurrent . Callable Ċ Ċ class ĠBook Re voke Failed Dismiss Task ( ĊĠ Ġprivate Ġval Ġbook Database : ĠBook Database Type , ĊĠ Ġprivate Ġval Ġbook Registry : ĠBook Registry Type , ĊĠ Ġprivate Ġval Ġbook Id : ĠBook ID Ċ ) Ġ: ĠCallable < Unit > Ġ{ ĊĊĠ Ġprivate Ġval Ġlogger Ġ= ĊĠĠĠ ĠLoggerFactory . getLogger ( Book Re voke Failed Dismiss Task :: class . java ) ĊĊĠ Ġ@ Throws ( Exception :: class ) ĊĠ Ġoverride Ġfun Ġcall () Ġ{ ĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠ Ġthis . logger . debug ("[ {}] Ġre voke Ġfailure Ġdismiss ", Ġthis . book Id . brief ()) ĊĊĠĠĠĠĠ Ġval Ġstatus Opt Ġ= Ġthis . book Registry . book Status ( this . book Id ) ĊĠĠĠĠĠ Ġif Ġ( status Opt Ġis ĠSome < Book Status >) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġstatus Ġ= Ġstatus Opt . get () ĊĠĠĠĠĠĠĠ Ġthis . logger . debug ("[ {}] Ġstatus Ġof Ġbook Ġis Ġcurrently Ġ{}", Ġthis . book Id . brief (), Ġstatus ) ĊĠĠĠĠĠĠĠ Ġval Ġentry Ġ= Ġthis . book Database . entry ( this . book Id ) ĊĠĠĠĠĠĠĠ Ġval Ġbook Ġ= Ġentry . book ĊĠĠĠĠĠĠĠ Ġval Ġnew Status Ġ= ĠBook Status . from Book ( book ) ĊĠĠĠĠĠĠĠ Ġthis . book Registry . update ( Book With Status ( book , Ġnew Status )) ĊĠĠĠĠĠĠĠ Ġthis . logger . debug ("[ {}] Ġstatus Ġof Ġbook Ġis Ġnow Ġ{}", Ġthis . book Id . brief (), Ġnew Status ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ġfinally Ġ{ ĊĠĠĠĠĠ Ġthis . logger . debug ("[ {}] Ġre voke Ġfailure Ġdismiss Ġfinished ", Ġthis . book Id . brief ()) ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ