package Ġio . mesh cloud . docker os b . service Ċ Ċ import Ġio . mesh cloud . docker os b . model . Service Binding Ċ import Ġio . mesh cloud . docker os b . persistence . Git Operation Context Factory Ċ import Ġorg . springframework . cloud . service broker . exception . Service Broker Async Required Exception Ċ import Ġorg . springframework . cloud . service broker . model . binding .* Ċ import Ġorg . springframework . cloud . service broker . service . Service Instance Binding Service Ċ import Ġorg . springframework . stereotype . Service Ċ import Ġreactor . core . publisher . Mono Ċ Ċ @ Service Ċ class ĠGeneric Service Instance Binding Service ( ĊĠĠĠ Ġprivate Ġval Ġgit Context Factory : ĠGit Operation Context Factory Ċ ) Ġ: ĠService Instance Binding Service Ġ{ ĊĊĊĠ Ġoverride Ġfun Ġcreate Service Instance Binding ( request : ĠCreate Service Instance Binding Request ): ĠMono < Create Service Instance Binding Response > Ġ{ ĊĠĠĠ Ġif Ġ(! request . is Async Accepted ){ ĊĠĠĠĠĠ Ġthrow ĠService Broker Async Required Exception (" Uni Pipe Ġservice Ġbroker Ġinvokes Ġasync ĠCI / CD Ġpipelines ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġgit Context Factory . acquire Context (). use Ġ{ Ġcontext Ġ-> ĊĠĠĠĠĠ Ġval Ġrepository Ġ= Ġcontext . build Service Instance Binding Repository () ĊĊĠĠĠĠĠ Ġval Ġservice Binding Ġ= ĠService Binding ( request ) ĊĠĠĠĠĠ Ġrepository . create Binding ( service Binding ) ĊĊĠĠĠĠĠ Ġreturn ĠMono . just ( ĊĠĠĠĠĠĠĠĠĠ ĠCreate Service Instance App Binding Response . builder () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. async ( true ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. operation (" creating Ġbinding ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. binding Exist ed ( false ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġdelete Service Instance Binding ( request : ĠDelete Service Instance Binding Request ): ĠMono < Delete Service Instance Binding Response > Ġ{ ĊĠĠĠ Ġgit Context Factory . acquire Context (). use Ġ{ Ġcontext Ġ-> ĊĠĠĠĠĠ Ġval Ġrepository Ġ= Ġcontext . build Service Instance Binding Repository () ĊĠĠĠĠĠ Ġval Ġbinding Ġ= Ġrepository . try GetService Binding ( request . service InstanceId , Ġrequest . binding Id ) ĊĊĠĠĠĠĠ Ġif Ġ( binding Ġ== Ġnull Ġ|| Ġbinding . deleted ) ĊĠĠĠĠĠĠĠ Ġreturn ĠMono . just ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠDelete Service Instance Binding Response . builder () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. async ( false ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠ Ġif Ġ(! request . is Async Accepted ){ ĊĠĠĠĠĠĠĠ Ġthrow ĠService Broker Async Required Exception (" Uni Pipe Ġservice Ġbroker Ġinvokes Ġasync ĠCI / CD Ġpipelines ") ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġrepository . delete Service Instance Binding ( binding ) ĊĊĠĠĠĠĠ Ġreturn ĠMono . just ( ĊĠĠĠĠĠĠĠĠĠ ĠDelete Service Instance Binding Response . builder () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. async ( true ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. operation (" de leting ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun ĠgetLast Operation ( request : ĠGet Last Service Binding Operation Request ): ĠMono < Get Last Service Binding Operation Response > Ġ{ ĊĠĠĠ Ġgit Context Factory . acquire Context (). use Ġ{ Ġcontext Ġ-> ĊĠĠĠĠĠ Ġcontext . attempt To Refresh Remote Changes () ĊĊĠĠĠĠĠ Ġval Ġrepository Ġ= Ġcontext . build Service Instance Binding Repository () ĊĊĠĠĠĠĠ Ġval Ġstatus Ġ= Ġrepository . getService Binding Status ( request . service InstanceId , Ġrequest . binding Id ) ĊĊĠĠĠĠĠ Ġreturn ĠMono . just ( ĊĠĠĠĠĠĠĠĠĠ ĠGet Last Service Binding Operation Response . builder () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. operation State ( status . to Operation State ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. description ( status . description ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġget Service Instance Binding ( request : ĠGet Service Instance Binding Request ): ĠMono < GetService Instance Binding Response > Ġ{ ĊĠĠĠ Ġgit Context Factory . acquire Context (). use Ġ{ Ġcontext Ġ-> ĊĠĠĠĠĠ Ġcontext . attempt To Refresh Remote Changes () ĊĊĠĠĠĠĠ Ġval Ġrepository Ġ= Ġcontext . build Service Instance Binding Repository () ĊĊĠĠĠĠĠ Ġval Ġcredentials Ġ= Ġrepository . getService Binding Credentials ( request . service InstanceId , Ġrequest . binding Id ) ĊĊĠĠĠĠĠ Ġreturn ĠMono . just ( ĊĠĠĠĠĠĠĠĠĠ ĠGet Service Instance App Binding Response . builder () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. credentials ( credentials ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ }