package Ġorg . ny pl . simpl ified . books . controller Ċ Ċ import Ġcom . io 7 m . j functional . Some Ċ import Ġcom . io 7 m . jun reachable . Un reachable Code Exception Ċ import Ġorg . joda . time . Duration Ċ import Ġorg . ny pl . dr m . core . A dobe A dept Executor Type Ċ import Ġorg . ny pl . dr m . core . A dobe A dept Loan Ċ import Ġorg . ny pl . simpl ified . accounts . api . Account Authentication A dobe Post Activation Credentials Ċ import Ġorg . ny pl . simpl ified . accounts . api . AccountID Ċ import Ġorg . ny pl . simpl ified . accounts . database . api . Account Type Ċ import Ġorg . ny pl . simpl ified . adobe . extensions . A dobe DRM Extensions Ċ import Ġorg . ny pl . simpl ified . books . api . Book ID Ċ import Ġorg . ny pl . simpl ified . books . book _ database . api . Book DRM Information Handle Ċ import Ġorg . ny pl . simpl ified . books . book _ database . api . Book Database Entry Format Handle . Book Database Entry Format Handle Audio Book Ċ import Ġorg . ny pl . simpl ified . books . book _ database . api . Book Database Entry Format Handle . Book Database Entry Format Handle EP UB Ċ import Ġorg . ny pl . simpl ified . books . book _ database . api . Book Database Entry Format Handle . Book Database Entry Format Handle PDF Ċ import Ġorg . ny pl . simpl ified . books . book _ database . api . Book Database Entry 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 . ny pl . simpl ified . books . controller . api . Book Re voke Exception Bad Feed Ċ import Ġorg . ny pl . simpl ified . books . controller . api . Book Re voke Exception Device Not Activated Ċ import Ġorg . ny pl . simpl ified . books . controller . api . Book Re voke Exception Not Rev oc able Ċ import Ġorg . ny pl . simpl ified . books . controller . api . Book Re voke String Resources Type Ċ import Ġorg . ny pl . simpl ified . feeds . api . Feed Ċ import Ġorg . ny pl . simpl ified . feeds . api . Feed Entry . Feed Entry Cor rupt Ċ import Ġorg . ny pl . simpl ified . feeds . api . Feed Entry . Feed Entry OP DS Ċ import Ġorg . ny pl . simpl ified . feeds . api . Feed HTTP Transport Exception Ċ import Ġorg . ny pl . simpl ified . feeds . api . Feed Loader Result . Feed Loader Failure . Feed Loader Failed Authentication Ċ import Ġorg . ny pl . simpl ified . feeds . api . Feed Loader Result . Feed Loader Failure . Feed Loader Failed General Ċ import Ġorg . ny pl . simpl ified . feeds . api . Feed Loader Result . Feed Loader Success Ċ import Ġorg . ny pl . simpl ified . feeds . api . Feed Loader Type Ċ import Ġorg . ny pl . simpl ified . op ds . core . OP DS Ac quisition Feed Entry Ċ import Ġorg . ny pl . simpl ified . op ds . core . OP D SA v ailability Hel d Ċ import Ġorg . ny pl . simpl ified . op ds . core . OP D SA v ailability Hel d Ready Ċ import Ġorg . ny pl . simpl ified . op ds . core . OP D SA v ailability Hold able Ċ import Ġorg . ny pl . simpl ified . op ds . core . OP D SA v ailability Loan able Ċ import Ġorg . ny pl . simpl ified . op ds . core . OP D SA v ailability Loan ed Ċ import Ġorg . ny pl . simpl ified . op ds . core . OP D SA v ailability Open Access Ċ import Ġorg . ny pl . simpl ified . op ds . core . OP D SA v ailability Rev oked Ċ import Ġorg . ny pl . simpl ified . op ds . core . OP D SA v ailability Type Ċ import Ġorg . ny pl . simpl ified . profiles . api . Profile ID Ċ import Ġorg . ny pl . simpl ified . profiles . api . Profiles Database Type Ċ import Ġorg . ny pl . simpl ified . task recorder . api . Task Recorder Ċ import Ġorg . ny pl . simpl ified . task recorder . api . Task Recorder Type Ċ import Ġorg . ny pl . simpl ified . task recorder . api . Task Result Ċ import Ġorg . slf 4 j . Logger Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġjava . net . URI Ċ import Ġjava . util . concurrent . Cancellation Exception Ċ import Ġjava . util . concurrent . ExecutionException Ċ import Ġjava . util . concurrent . TimeUnit Ċ import Ġjava . util . concurrent . TimeoutException Ċ Ċ class ĠBook Re voke Task ( ĊĠ Ġprivate Ġval Ġaccount ID : ĠAccount ID , ĊĠ Ġprofile ID : ĠProfile ID , ĊĠ Ġprofiles : ĠPro files Database Type , ĊĠ Ġprivate Ġval Ġa dobe DRM : ĠAdobe A dept Executor Type ?, ĊĠ Ġprivate Ġval Ġbook ID : ĠBook ID , ĊĠ Ġprivate Ġval Ġbook Registry : ĠBook Registry Type , ĊĠ Ġprivate Ġval Ġfeed Loader : ĠFeed Loader Type , ĊĠ Ġprivate Ġval Ġre voke Strings : ĠBook Re voke String Resources Type , ĊĠ Ġprivate Ġval Ġre voke AC ST ime out Duration : ĠDuration Ġ= ĠDuration . standard Minutes ( 1 L ), ĊĠ Ġprivate Ġval Ġre voke Server Timeout Duration : ĠDuration Ġ= ĠDuration . standard Minutes ( 3 L ) Ċ ) Ġ: ĠAbstract Book Task ( account ID , Ġprofile ID , Ġprofiles ) Ġ{ ĊĊĠ Ġprivate Ġlateinit Ġvar Ġdatabase Entry : ĠBook Database Entry Type ĊĠ Ġprivate Ġval Ġa dobe ACS Ġ= Ġ" A dobe ĠA CS " ĊĊĠ Ġoverride Ġval Ġlogger : ĠLogger Ġ= ĊĠĠĠ ĠLoggerFactory . getLogger ( Book Re voke Task :: class . java ) ĊĊĠ Ġoverride Ġval Ġtask Recorder : ĠTask Recorder Type Ġ= ĊĠĠĠ ĠTask Recorder . create () ĊĊĠ Ġoverride Ġfun Ġexecute ( account : ĠAccount Type ): ĠTask Result . Success < Unit > Ġ{ ĊĠĠĠ Ġthis . debug (" revoke ") ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke Started ) ĊĠĠĠ Ġthis . setup Book Database Entry ( account ) ĊĠĠĠ Ġthis . revoke Format Handle ( account ) ĊĠĠĠ Ġthis . revoke Notify Server ( account ) ĊĠĠĠ Ġthis . revoke Notify Server Delete Book () ĊĠĠĠ Ġreturn Ġthis . task Recorder . finish Success ( Unit ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġon Failure ( result : ĠTask Result . Failure < Unit >) Ġ{ ĊĠĠĠ Ġthis . publish Book Status ( Book Status . Failed Re voke ( this . book ID , Ġresult )) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġdebug ( message : ĠString , Ġvar arg Ġarguments : ĠAny ?) Ġ= ĊĠĠĠ Ġthis . logger . debug ("[ {}] Ġ$ message ", Ġthis . book ID . brief (), Ġ* arguments ) ĊĊĠ Ġprivate Ġfun Ġerror ( message : ĠString , Ġvar arg Ġarguments : ĠAny ?) Ġ= ĊĠĠĠ Ġthis . logger . error ("[ {}] Ġ$ message ", Ġthis . book ID . brief (), Ġ* arguments ) ĊĊĠ Ġprivate Ġfun Ġwarn ( message : ĠString , Ġvar arg Ġarguments : ĠAny ?) Ġ= ĊĠĠĠ Ġthis . logger . warn ("[ {}] Ġ$ message ", Ġthis . book ID . brief (), Ġ* arguments ) ĊĊĠ Ġprivate Ġfun Ġpublish Book Status ( status : ĠBook Status ) Ġ{ ĊĠĠĠ Ġval Ġbook Ġ= Ġthis . database Entry . book ĊĠĠĠ Ġthis . book Registry . update ( Book With Status ( book , Ġstatus )) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġpublish Status From Database () Ġ{ ĊĠĠĠ Ġval Ġbook Ġ= Ġthis . database Entry . book ĊĠĠĠ Ġval Ġstatus Ġ= ĠBook Status . from Book ( book ) ĊĠĠĠ Ġthis . book Registry . update ( Book With Status ( book , Ġstatus )) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġpublish Request ing Re voke Status () Ġ{ ĊĠĠĠ Ġthis . publish Book Status ( Book Status . Request ing Re voke ( this . book ID )) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġpublish Rev oked Status () Ġ{ ĊĠĠĠ Ġthis . publish Book Status ( Book Status . Rev oked ( this . book ID )) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġre voke Notify Server ( account : ĠAccount Type ) Ġ{ ĊĠĠĠ Ġthis . debug (" notify ing Ġserver Ġof Ġrev ocation ") ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke Server Notify ) ĊĠĠĠ Ġthis . publish Request ing Re voke Status () ĊĊĠĠĠ Ġval Ġfeed Entry Ġ= Ġthis . database Entry . book . entry ĊĠĠĠ Ġval Ġavailability Ġ= Ġfeed Entry . availability ĊĠĠĠ Ġthis . debug (" availability Ġis Ġ{}", Ġavailability ) ĊĊĠĠĠ Ġval Ġnew Entry Ġ= Ġwhen Ġ( availability ) Ġ{ ĊĠĠĠĠĠ Ġis ĠOP D SA v ailability Hel d Ready Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuri Opt Ġ= Ġavailability . revoke ĊĠĠĠĠĠĠĠ Ġif Ġ( uri Opt Ġis ĠSome < URI >) Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġthis . revoke Notify Server URI ( uri Opt . get (), ĠRe voke Type . H OLD , Ġaccount ) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġthis . debug (" no Ġre voke ĠURI , Ġnothing Ġto Ġdo ") ĊĠĠĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Succeeded ( this . revoke Strings . revoke Server Notify No URI ) ĊĠĠĠĠĠĠĠĠĠ Ġthis . feed Entry With Availability ( account ID , Ġfeed Entry , ĠOP D SA v ailability Loan able . get ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġis ĠOP D SA v ailability Hel d Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuri Opt Ġ= Ġavailability . revoke ĊĠĠĠĠĠĠĠ Ġif Ġ( uri Opt Ġis ĠSome < URI >) Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġthis . revoke Notify Server URI ( uri Opt . get (), ĠRe voke Type . H OLD , Ġaccount ) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġthis . debug (" no Ġre voke ĠURI , Ġnothing Ġto Ġdo ") ĊĠĠĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Succeeded ( this . revoke Strings . revoke Server Notify No URI ) ĊĠĠĠĠĠĠĠĠĠ Ġthis . feed Entry With Availability ( account ID , Ġfeed Entry , ĠOP D SA v ailability Hold able . get ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġis ĠOP D SA v ailability Hold able Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexception Ġ= ĠBook Re voke Exception Not Rev oc able () ĊĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= ĊĠĠĠĠĠĠĠĠĠ Ġthis . revoke Strings . revoke Server Notify Not Rev oc able ( availability . java Class . simple Name ) ĊĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( message , Ġ" not Rev oc able ", Ġexception ) ĊĠĠĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( exception ) ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġis ĠOP D SA v ailability Loan ed Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuri Opt Ġ= Ġavailability . revoke ĊĠĠĠĠĠĠĠ Ġif Ġ( uri Opt Ġis ĠSome < URI >) Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġthis . revoke Notify Server URI ( uri Opt . get (), ĠRe voke Type . LO AN , Ġaccount ) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġthis . debug (" no Ġre voke ĠURI , Ġnothing Ġto Ġdo ") ĊĠĠĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Succeeded ( this . revoke Strings . revoke Server Notify No URI ) ĊĠĠĠĠĠĠĠĠĠ Ġthis . feed Entry With Availability ( account ID , Ġfeed Entry , ĠOP D SA v ailability Loan able . get ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġis ĠOP D SA v ailability Loan able Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexception Ġ= ĠBook Re voke Exception Not Rev oc able () ĊĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= ĊĠĠĠĠĠĠĠĠĠ Ġthis . revoke Strings . revoke Server Notify Not Rev oc able ( availability . java Class . simple Name ) ĊĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( message , Ġ" not Rev oc able ", Ġexception ) ĊĠĠĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( exception ) ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġis ĠOP D SA v ailability Open Access Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuri Opt Ġ= Ġavailability . revoke ĊĠĠĠĠĠĠĠ Ġif Ġ( uri Opt Ġis ĠSome < URI >) Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġthis . revoke Notify Server URI ( uri Opt . get (), ĠRe voke Type . LO AN , Ġaccount ) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġthis . debug (" no Ġre voke ĠURI , Ġnothing Ġto Ġdo ") ĊĠĠĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Succeeded ( this . revoke Strings . revoke Server Notify No URI ) ĊĠĠĠĠĠĠĠĠĠ ĠFeed Entry OP DS ( account ID , Ġfeed Entry ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġis ĠOP D SA v ailability Rev oked Ġ-> ĊĠĠĠĠĠĠĠ Ġthis . revoke Notify Server URI ( availability . revoke , ĠRe voke Type . LO AN , Ġaccount ) ĊĊĠĠĠĠĠ Ġelse Ġ-> ĊĠĠĠĠĠĠĠ Ġthrow ĠUn reachable Code Exception () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġthis . revoke Notify Server Save New Entry ( new Entry ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġfeed Entry With Availability ( ĊĠĠĠ Ġaccount ID : ĠAccount ID , ĊĠĠĠ Ġold Entry : ĠOP DS Ac quisition Feed Entry , ĊĠĠĠ Ġavailability : ĠOP D SA v ailability Type ĊĠ Ġ): ĠFeed Entry OP DS Ġ{ ĊĠĠĠ Ġval Ġac quisition Feed Entry Ġ= ĊĠĠĠĠĠ ĠOP DS Ac quisition Feed Entry . newBuilder From ( old Entry ) ĊĠĠĠĠĠĠĠ Ġ. set Availability ( availability ) ĊĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġreturn ĠFeed Entry OP DS ( account ID , Ġac quisition Feed Entry ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġre voke Notify Server URI ( ĊĠĠĠ Ġtarget URI : ĠURI , ĊĠĠĠ Ġre voke Type : ĠRe voke Type , ĊĠĠĠ Ġaccount : ĠAccount Type ĊĠ Ġ): ĠFeed Entry OP DS Ġ{ ĊĠĠĠ Ġthis . debug (" notify ing Ġserver Ġof Ġ{} Ġrev ocation Ġvia Ġ{}", Ġre voke Type , Ġtarget URI ) ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke Server Notify URI ( target URI )) ĊĠĠĠ Ġthis . publish Request ing Re voke Status () ĊĊĠĠĠ Ġval Ġfeed Ġ= ĊĠĠĠĠĠ Ġthis . revoke Notify Server UR IF eed ( target URI , Ġaccount ) ĊĠĠĠ Ġval Ġentry Ġ= ĊĠĠĠĠĠ Ġthis . revoke Notify Server URI Process Feed ( feed ) ĊĊĠĠĠ Ġreturn Ġentry ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġre voke Notify Server Save New Entry ( entry : ĠFeed Entry OP DS ) Ġ{ ĊĠĠĠ Ġthis . debug (" saving Ġreceived ĠOP DS Ġentry ") ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke Server Notify Saving Entry ) ĊĠĠĠ Ġthis . publish Request ing Re voke Status () ĊĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠ Ġthis . database Entry . write OP DS Entry ( entry . feed Entry ) ĊĠĠĠ Ġ} Ġcatch Ġ( e : ĠException ) Ġ{ ĊĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( ĊĠĠĠĠĠĠĠ Ġthis . revoke Strings . revoke Server Notify Saving Entry Failed , Ġ" unexpected Exception ", Ġe ĊĠĠĠĠĠ Ġ) ĊĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( e ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġre voke Notify Server Delete Book () Ġ{ ĊĠĠĠ Ġthis . debug (" de leting Ġbook ") ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke Delete Book ) ĊĠĠĠ Ġthis . publish Rev oked Status () ĊĠĠĠ Ġthis . publish Status From Database () ĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠ Ġthis . database Entry . delete () ĊĠĠĠ Ġ} Ġcatch Ġ( e : ĠException ) Ġ{ ĊĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( ĊĠĠĠĠĠĠĠ Ġthis . revoke Strings . revoke Delete Book Failed , Ġ" database Entry Delete Failed ", Ġe ĊĠĠĠĠĠ Ġ) ĊĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( e ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ/* ĊĠĠ Ġ* ĠXXX : ĠUse Ġ[ Feed Loading . load Single Entry Feed ] ĊĠĠ Ġ*/ ĊĊĠ Ġprivate Ġfun Ġre voke Notify Server UR IF eed ( target URI : ĠURI , Ġaccount : ĠAccount Type ): ĠFeed Ġ{ ĊĠĠĠ Ġ/* ĊĠĠĠĠ Ġ* ĠHit ting Ġa Ġre voke Ġlink Ġyields Ġa Ġsingle ĠOP DS Ġentry Ġindicating ĊĠĠĠĠ Ġ* Ġthe Ġcurrent Ġstate Ġof Ġthe Ġbook . ĠIt Ġshould Ġbe Ġequivalent Ġto Ġthe ĊĠĠĠĠ Ġ* Ġentry Ġseen Ġby Ġan Ġun authenticated Ġuser Ġb rowsing Ġthe Ġcatalog Ġright Ġnow . ĊĠĠĠĠ Ġ*/ ĊĊĠĠĠ Ġval Ġfeed Result Ġ= Ġtry Ġ{ ĊĠĠĠĠĠ Ġthis . feed Loader . fetch URI ( ĊĠĠĠĠĠĠĠ Ġaccount , ĊĠĠĠĠĠĠĠ Ġtarget URI , ĊĠĠĠĠĠĠĠ Ġ" PUT ", ĊĠĠĠĠĠ Ġ). get ( this . revoke Server Timeout Duration . standard Seconds , ĠTimeUnit . SECONDS ) ĊĠĠĠ Ġ} Ġcatch Ġ( e : ĠTimeout Exception ) Ġ{ ĊĠĠĠĠĠ Ġval Ġmessage Ġ= Ġthis . revoke Strings . revoke Server Notify Feed Timed Out ĊĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( message , Ġ" timed Out ", Ġe ) ĊĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( e ) ĊĠĠĠ Ġ} Ġcatch Ġ( e : ĠExecution Exception ) Ġ{ ĊĠĠĠĠĠ Ġval Ġex Ġ= Ġe . cause !! ĊĠĠĠĠĠ Ġif Ġ( ex Ġis ĠFeed HTTP Transport Exception ) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . task Recorder . add Attributes If Present ( ex . report ?. toMap ()) ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġval Ġmessage Ġ= Ġthis . revoke Strings . revoke Server Notify Feed Timed Out ĊĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( message , Ġ" feed Loader Failed ", Ġex ) ĊĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( ex ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġreturn Ġwhen Ġ( feed Result ) Ġ{ ĊĠĠĠĠĠ Ġis ĠFeed Loader Success Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Succeeded ( this . revoke Strings . revoke Server Notify Feed OK ) ĊĠĠĠĠĠĠĠ Ġfeed Result . feed ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġis ĠFeed Loader Failed General Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= Ġthis . revoke Strings . revoke Server Notify Feed Failed ĊĠĠĠĠĠĠĠ Ġthis . task Recorder . add Attributes If Present ( feed Result . problem Report ?. toMap ()) ĊĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( message , Ġ" feed Loader Failed ", Ġfeed Result . exception ) ĊĠĠĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( feed Result . exception ) ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġis ĠFeed Loader Failed Authentication Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= Ġthis . revoke Strings . revoke Server Notify Feed Failed ĊĠĠĠĠĠĠĠ Ġthis . task Recorder . add Attributes If Present ( feed Result . problem Report ?. toMap ()) ĊĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( message , Ġ" feed Loader Failed ", Ġfeed Result . exception ) ĊĠĠĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( feed Result . exception ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġre voke Notify Server URI Process Feed ( feed : ĠFeed ): ĠFeed Entry OP DS Ġ{ ĊĠĠĠ Ġthis . debug (" processing Ġserver Ġrev ocation Ġfeed ") ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke Server Notify Processing Feed ) ĊĠĠĠ Ġthis . publish Request ing Re voke Status () ĊĊĠĠĠ Ġif Ġ( feed . size Ġ== Ġ 0 ) Ġ{ ĊĠĠĠĠĠ Ġval Ġexception Ġ= ĠBook Re voke Exception Bad Feed () ĊĠĠĠĠĠ Ġval Ġmessage Ġ= Ġthis . revoke Strings . revoke Server Notify Feed Empty ĊĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( message , Ġ" feed Loader Failed ", Ġexception ) ĊĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( exception ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġreturn Ġwhen Ġ( feed ) Ġ{ ĊĠĠĠĠĠ Ġis ĠFeed . Feed Without Groups Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġwhen Ġ( val Ġfeed Entry Ġ= Ġfeed . entries In Order [ 0 ]) Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġis ĠFeed Entry Cor rupt Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġexception Ġ= ĠBook Re voke Exception Bad Feed () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= Ġthis . revoke Strings . revoke Server Notify Feed Cor rupt ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( message , Ġ" feed Cor rupted ", Ġfeed Entry . error ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( exception ) ĊĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠ Ġis ĠFeed Entry OP DS Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfeed Entry ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġis ĠFeed . Feed With Groups Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexception Ġ= ĠBook Re voke Exception Bad Feed () ĊĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= Ġthis . revoke Strings . revoke Server Notify Feed With Groups ĊĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( message , Ġ" feed Un usable ", Ġexception ) ĊĠĠĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( exception ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġre voke Format Handle ( account : ĠAccount Type ) Ġ{ ĊĠĠĠ Ġthis . debug (" rev oking Ġvia Ġformat Ġhandle ") ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke Format ) ĊĠĠĠ Ġthis . publish Request ing Re voke Status () ĊĊĠĠĠ Ġreturn Ġwhen Ġ( val Ġhandle Ġ= Ġthis . database Entry . find Preferred Format Handle ()) Ġ{ ĊĠĠĠĠĠ Ġis ĠBook Database Entry Format Handle EP UB Ġ-> ĊĠĠĠĠĠĠĠ Ġthis . revoke Format Handle EP UB ( handle , Ġaccount ) ĊĠĠĠĠĠ Ġis ĠBook Database Entry Format Handle PDF Ġ-> ĊĠĠĠĠĠĠĠ Ġthis . revoke Format Handle PDF ( handle ) ĊĠĠĠĠĠ Ġis ĠBook Database Entry Format Handle Audio Book Ġ-> ĊĠĠĠĠĠĠĠ Ġthis . revoke Format Handle Audio Book ( handle ) ĊĠĠĠĠĠ Ġnull Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . debug (" no Ġformat Ġhandle Ġavailable , Ġnothing Ġto Ġdo !") ĊĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Succeeded ( this . revoke Strings . revoke Format Nothing ToDo ) ĊĠĠĠĠĠĠĠ ĠUnit ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġre voke Format Handle EP UB ( handle : ĠBook Database Entry Format Handle EP UB , Ġaccount : ĠAccount Type ) Ġ{ ĊĠĠĠ Ġthis . debug (" rev oking Ġvia ĠE PUB Ġformat Ġhandle ") ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke Format Specific (" EP UB ")) ĊĠĠĠ Ġthis . publish Request ing Re voke Status () ĊĊĠĠĠ Ġreturn Ġwhen Ġ( val Ġdrm Ġ= Ġhandle . dr m Information Handle ) Ġ{ ĊĠĠĠĠĠ Ġis ĠBook DRM Information Handle . AC SH andle Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġa dobe Rights Ġ= Ġdrm . info . rights ĊĠĠĠĠĠĠĠ Ġif Ġ( adobe Rights Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġthis . revoke Format Handle EP UB A dobe ( handle , Ġa dobe Rights . second , Ġaccount ) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġthis . debug (" no ĠAdobe Ġrights , Ġnothing Ġto Ġdo !") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġis ĠBook DRM Information Handle . L CP Handle , ĊĠĠĠĠĠ Ġis ĠBook DRM Information Handle . Axis Handle , ĊĠĠĠĠĠ Ġis ĠBook DRM Information Handle . None Handle Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠNothing Ġrequired ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġre voke Format Handle EP UB A dobe ( ĊĠĠĠ Ġhandle : ĠBook Database Entry Format Handle EP UB , ĊĠĠĠ Ġa dobe Rights : ĠAdobe A dept Loan , ĊĠĠĠ Ġaccount : ĠAccount Type ĊĠ Ġ) Ġ{ ĊĠĠĠ Ġthis . debug (" rev oking ĠAdobe ĠA CS Ġloan ") ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke ACS Loan ) ĊĠĠĠ Ġthis . publish Request ing Re voke Status () ĊĊĠĠĠ Ġ/* ĊĠĠĠĠ Ġ* ĠIf Ġthe Ġloan Ġis Ġnot Ġreturn able , Ġthen Ġthere 's Ġno Ġpoint Ġtrying Ġto Ġreturn Ġit ! ĊĠĠĠĠ Ġ*/ ĊĊĠĠĠ Ġif Ġ(! adobe Rights . is Return able ) Ġ{ ĊĠĠĠĠĠ Ġthis . debug (" loan Ġis Ġnot Ġreturn able ") ĊĠĠĠĠĠ Ġthis . task Recorder . current Step Succeeded ( this . revoke Strings . revoke ACS Loan Not Return able ) ĊĠĠĠĠĠ Ġthis . delete A dobe Rights ( handle ) ĊĠĠĠĠĠ Ġreturn ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/* ĊĠĠĠĠ Ġ* ĠIf Ġthe ĠA dept Ġexecutor Ġis Ġnot Ġprovided , Ġit Ġmeans Ġthat Ġthis Ġbuild Ġof Ġthe Ġapplication ĊĠĠĠĠ Ġ* Ġhas Ġno Ġsupport Ġfor ĠAdobe ĠD RM . ĠWe Ġdon 't Ġtreat Ġa Ġmissing ĠA dept Ġexecutor Ġas Ġfailure Ġcase ĊĠĠĠĠ Ġ* Ġbecause Ġif Ġsupport Ġfor ĠAdobe ĠD RM Ġis Ġdropped Ġin Ġthe Ġfuture , Ġit Ġwould Ġsudden ly Ġbecome ĊĠĠĠĠ Ġ* Ġimpossible Ġfor Ġusers Ġto Ġre voke Ġlo ans Ġthat Ġwere Ġpreviously Ġmade Ġwith Ġactivated Ġdevices . ĊĠĠĠĠ Ġ*/ ĊĊĠĠĠ Ġif Ġ( this . adobe DRM Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠ Ġthis . debug (" DRM Ġis Ġnot Ġsupported ") ĊĠĠĠĠĠ Ġthis . task Recorder . current Step Succeeded ( this . revoke Strings . revoke ACS Loan NotSupported ) ĊĠĠĠĠĠ Ġthis . delete A dobe Rights ( handle ) ĊĠĠĠĠĠ Ġreturn ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġthis . revoke Format Handle EP UB A dobe Execute ( this . adobe DRM , Ġa dobe Rights , Ġaccount ) ĊĠĠĠ Ġthis . delete A dobe Rights ( handle ) ĊĠ Ġ} ĊĊĠ Ġ/** ĊĠĠ Ġ* ĠExecute Ġthe ĠD RM Ġconnector Ġcommands Ġrequired Ġto Ġre voke Ġa Ġloan . ĊĠĠ Ġ*/ ĊĊĠ Ġprivate Ġfun Ġre voke Format Handle EP UB A dobe Execute ( ĊĠĠĠ Ġa dobe DRM : ĠAdobe A dept Executor Type , ĊĠĠĠ Ġa dobe Rights : ĠAdobe A dept Loan , ĊĠĠĠ Ġaccount : ĠAccount Type ĊĠ Ġ) Ġ{ ĊĠĠĠ Ġval Ġcredentials Ġ= ĊĠĠĠĠĠ Ġthis . revoke Format Handle EP UB A dobe With Connector Get Credentials ( account ) ĊĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke ACS Execute ) ĊĠĠĠ Ġthis . publish Request ing Re voke Status () ĊĊĠĠĠ Ġval Ġa dept Future Ġ= ĊĠĠĠĠĠ ĠAdobe DRM Extensions . revoke ( adobe DRM , Ġa dobe Rights , Ġcredentials . userID ) ĊĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠ Ġa dept Future . get ( this . revoke AC ST ime out Duration . standard Seconds , ĠTimeUnit . SECONDS ) ĊĠĠĠ Ġ} Ġcatch Ġ( e : ĠTimeout Exception ) Ġ{ ĊĠĠĠĠĠ Ġval Ġmessage Ġ= Ġthis . revoke Strings . revoke AC ST imed Out ĊĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( message , Ġ" timed Out ", Ġe ) ĊĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( e ) ĊĠĠĠ Ġ} Ġcatch Ġ( e : ĠExecution Exception ) Ġ{ ĊĠĠĠĠĠ Ġthrow Ġwhen Ġ( val Ġcause Ġ= Ġe . cause !! ) Ġ{ ĊĠĠĠĠĠĠĠ Ġis ĠC ancellation Exception Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= Ġthis . revoke Strings . revoke Book Cancelled ĊĠĠĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( message , Ġ" cancelled ", Ġcause ) ĊĠĠĠĠĠĠĠĠĠ ĠTask Failed Handled ( cause ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġis ĠAdobe DRM Extensions . A dobe DRM Re voke Exception Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġval Ġmessage Ġ= Ġthis . revoke Strings . revoke Book ACS Connector Failed ( cause . errorCode ) ĊĠĠĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( message , Ġ"${ this . adobe ACS }: Ġ${ cause . errorCode }", Ġcause ) ĊĠĠĠĠĠĠĠĠĠ ĠTask Failed Handled ( cause ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġelse Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( this . revoke Strings . revoke Book ACS Failed , Ġ" unexpected Exception ", Ġcause ) ĊĠĠĠĠĠĠĠĠĠ ĠTask Failed Handled ( cause ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ġcatch Ġ( e : ĠThrowable ) Ġ{ ĊĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( this . revoke Strings . revoke Book ACS Failed , Ġ" unexpected Exception ", Ġe ) ĊĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( e ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġthis . task Recorder . current Step Succeeded ( this . revoke Strings . revoke ACS Execute OK ) ĊĠ Ġ} ĊĊĠ Ġ/** ĊĠĠ Ġ* ĠRetrieve Ġthe Ġpost - activation Ġdevice Ġcredentials . ĠThese Ġcan Ġonly Ġexist Ġif Ġthe Ġdevice ĊĠĠ Ġ* Ġhas Ġbeen Ġactivated . ĊĠĠ Ġ*/ ĊĊĠ Ġprivate Ġfun Ġre voke Format Handle EP UB A dobe With Connector Get Credentials ( account : ĠAccount Type ): ĠAccount Authentication A dobe Post Activation Credentials Ġ{ ĊĠĠĠ Ġthis . debug (" getting ĠAdobe ĠA CS Ġcredentials ") ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke ACS Getting Device Credentials ) ĊĠĠĠ Ġthis . publish Request ing Re voke Status () ĊĊĠĠĠ Ġval Ġcredentials Ġ= ĊĠĠĠĠĠ Ġthis . get Required Account Credentials ( account ). adobe Credentials ?. post Activation Credentials ĊĊĠĠĠ Ġif Ġ( credentials Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠ Ġval Ġexception Ġ= ĠBook Re voke Exception Device Not Activated () ĊĠĠĠĠĠ Ġval Ġmessage Ġ= Ġthis . revoke Strings . revoke ACS Getting Device Credentials Not Activated ĊĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( message , Ġ"${ this . adobe ACS }: Ġdrm Device Not Active ", Ġexception ) ĊĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( exception ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġthis . task Recorder . current Step Succeeded ( this . revoke Strings . revoke ACS Getting Device Credentials OK ) ĊĠĠĠ Ġreturn Ġcredentials ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġdelete A dobe Rights ( handle : ĠBook Database Entry Format Handle EP UB ) Ġ{ ĊĠĠĠ Ġthis . debug (" de leting ĠAdobe ĠA CS Ġloan ") ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke ACS Delete Rights ) ĊĠĠĠ Ġthis . publish Request ing Re voke Status () ĊĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠ Ġwhen Ġ( val Ġdrm Ġ= Ġhandle . dr m Information Handle ) Ġ{ ĊĠĠĠĠĠĠĠ Ġis ĠBook DRM Information Handle . AC SH andle Ġ-> ĊĠĠĠĠĠĠĠĠĠ Ġdrm . set A dobe Rights Information ( null ) ĊĠĠĠĠĠĠĠ Ġis ĠBook DRM Information Handle . L CP Handle , ĊĠĠĠĠĠĠĠ Ġis ĠBook DRM Information Handle . None Handle Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġ// ĠNothing Ġrequired ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ġcatch Ġ( e : ĠException ) Ġ{ ĊĠĠĠĠĠ Ġthis . task Recorder . current Step Failed ( ĊĠĠĠĠĠĠĠ Ġthis . revoke Strings . revoke ACS Delete Rights Failed , Ġ" unexpected Exception ", Ġe ĊĠĠĠĠĠ Ġ) ĊĠĠĠĠĠ Ġthrow ĠTask Failed Handled ( e ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Suppress (" UNUSED _ PARAMETER ") ĊĠ Ġprivate Ġfun Ġre voke Format Handle Audio Book ( handle : ĠBook Database Entry Format Handle Audio Book ) Ġ{ ĊĠĠĠ Ġthis . debug (" rev oking Ġvia ĠAudio Book Ġformat Ġhandle ") ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke Format Specific (" Audio Book ")) ĊĠĠĠ Ġthis . publish Request ing Re voke Status () ĊĊĠĠĠ Ġthis . task Recorder . current Step Succeeded ( this . revoke Strings . revoke Format Nothing ToDo ) ĊĠ Ġ} ĊĊĠ Ġ@ Suppress (" UNUSED _ PARAMETER ") ĊĠ Ġprivate Ġfun Ġre voke Format Handle PDF ( handle : ĠBook Database Entry Format Handle PDF ) Ġ{ ĊĠĠĠ Ġthis . debug (" rev oking Ġvia ĠPDF Ġformat Ġhandle ") ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke Format Specific (" PDF ")) ĊĠĠĠ Ġthis . publish Request ing Re voke Status () ĊĊĠĠĠ Ġthis . task Recorder . current Step Succeeded ( this . revoke Strings . revoke Format Nothing ToDo ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġsetup Book Database Entry ( account : ĠAccount Type ) Ġ{ ĊĠĠĠ Ġthis . task Recorder . begin New Step ( this . revoke Strings . revoke Book Database Lookup ) ĊĠĠĠ Ġthis . debug (" setting Ġup Ġbook Ġdatabase Ġentry ") ĊĠĠĠ Ġval Ġdatabase Ġ= Ġaccount . book Database ĊĠĠĠ Ġthis . database Entry Ġ= Ġdatabase . entry ( this . book ID ) ĊĠĠĠ Ġthis . publish Request ing Re voke Status () ĊĠĠĠ Ġthis . task Recorder . current Step Succeeded ( this . revoke Strings . revoke Book Database Lookup OK ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġenum Ġclass ĠRe voke Type Ġ{ ĊĠĠĠ ĠLO AN , ĠH OLD ĊĠ Ġ} Ċ } Ċ