package Ġcom . netflix . spin n aker . ke el . persistence Ċ Ċ import Ġcom . fasterxml . jackson . databind . ObjectMapper Ċ import Ġcom . fasterxml . jackson . module . kotlin . convert Value Ċ import Ġcom . netflix . spin n aker . ke el . api . Delivery Config Ċ import Ġcom . netflix . spin n aker . ke el . api . Environment Ċ import Ġcom . netflix . spin n aker . ke el . api . Notification Config Ċ import Ġcom . netflix . spin n aker . ke el . api . Resource Ċ import Ġcom . netflix . spin n aker . ke el . api . Resource Spec Ċ import Ġcom . netflix . spin n aker . ke el . api . artifacts . Artifact Metadata Ċ import Ġcom . netflix . spin n aker . ke el . api . artifacts . Artifact Status Ċ import Ġcom . netflix . spin n aker . ke el . api . artifacts . Artifact Type Ċ import Ġcom . netflix . spin n aker . ke el . api . artifacts . Delivery Artifact Ċ import Ġcom . netflix . spin n aker . ke el . api . artifacts . Published Artifact Ċ import Ġcom . netflix . spin n aker . ke el . api . constraints . Constraint State Ċ import Ġcom . netflix . spin n aker . ke el . api . events . Artifact Registered Event Ċ import Ġcom . netflix . spin n aker . ke el . api . verification . Verification Context Ċ import Ġcom . netflix . spin n aker . ke el . api . verification . Verification Repository Ċ import Ġcom . netflix . spin n aker . ke el . api . verification . Verification State Ċ import Ġcom . netflix . spin n aker . ke el . core . api . Application Summary Ċ import Ġcom . netflix . spin n aker . ke el . core . api . Artifact Summary In Environment Ċ import Ġcom . netflix . spin n aker . ke el . core . api . Environment Artifact Pin Ċ import Ġcom . netflix . spin n aker . ke el . core . api . Environment Artifact Veto Ċ import Ġcom . netflix . spin n aker . ke el . core . api . Environment Artifact Veto es Ċ import Ġcom . netflix . spin n aker . ke el . core . api . Environment Summary Ċ import Ġcom . netflix . spin n aker . ke el . core . api . Pin ned Environment Ċ import Ġcom . netflix . spin n aker . ke el . core . api . Promotion Status Ċ import Ġcom . netflix . spin n aker . ke el . core . api . Submitted Delivery Config Ċ import Ġcom . netflix . spin n aker . ke el . core . api . UID Ċ import Ġcom . netflix . spin n aker . ke el . core . api . normalize Ċ import Ġcom . netflix . spin n aker . ke el . events . Application Event Ċ import Ġcom . netflix . spin n aker . ke el . events . Resource Event Ċ import Ġcom . netflix . spin n aker . ke el . events . Resource History Event Ċ import Ġcom . netflix . spin n aker . ke el . services . Status Info For Artifact In Environment Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġorg . springframework . context . Application Event Publisher Ċ import Ġorg . springframework . stereotype . Component Ċ import Ġorg . springframework . transaction . annotation . Propagation . REQUIRED Ċ import Ġorg . springframework . transaction . annotation . Transactional Ċ import Ġjava . time . Clock Ċ import Ġjava . time . Duration Ċ import Ġjava . time . Instant Ċ Ċ /** Ċ Ġ* ĠA Ġcombined Ġrepository Ġfor Ġdelivery Ġconfigs , Ġartifacts , Ġand Ġresources . Ċ Ġ* Ċ Ġ* ĠThis Ġp aves Ġthe Ġway Ġfor Ġre - think ing Ġhow Ġwe Ġinteract Ġwith Ġsql / st oring Ġof Ġresources , Ċ Ġ* Ġand Ġupdating Ġour Ġinternal Ġrepository Ġstructure Ġto Ġallow Ġstoring Ġdelivery Ġconfigs Ġto Ġmore Ġeasily Ġalso Ċ Ġ* Ġstore Ġartifacts Ġand Ġresources . Ċ Ġ* Ċ Ġ* ĠThis Ġalso Ġgives Ġus Ġan Ġeasy Ġplace Ġto Ġemit Ġtelemetry Ġand Ġevents Ġaround Ġthe Ġusage Ġof Ġmethods . Ċ Ġ* Ċ Ġ* ĠTODO Ġe b : Ġrefactor Ġrepository Ġinteraction Ġso Ġtransaction ality Ġis Ġeasier . Ċ Ġ*/ Ċ @ Component Ċ class ĠCom bined Repository ( ĊĠ Ġval Ġdelivery Config Repository : ĠDelivery Config Repository , ĊĠ Ġval Ġartifact Repository : ĠArtifact Repository , ĊĠ Ġval Ġresource Repository : ĠResource Repository , ĊĠ Ġval Ġverification Repository : ĠVerification Repository , ĊĠ Ġoverride Ġval Ġclock : ĠClock , ĊĠ Ġoverride Ġval Ġpublisher : ĠApplication Event Publisher , ĊĠ Ġval ĠobjectMapper : ĠObjectMapper Ċ ) Ġ: ĠKe el Repository Ġ{ ĊĊĠ Ġoverride Ġval Ġlog Ġby Ġlazy Ġ{ ĠLoggerFactory . getLogger ( java Class ) Ġ} ĊĊĠ Ġ@ Transactional ( propagation Ġ= ĠREQUIRED ) ĊĠ Ġoverride Ġfun Ġupsert Delivery Config ( submitted Delivery Config : ĠSub mitted Delivery Config ): ĠDelivery Config Ġ{ ĊĠĠĠ Ġval Ġnew Ġ= ĠDelivery Config ( ĊĠĠĠĠĠ Ġname Ġ= Ġsubmitted Delivery Config . safe Name , ĊĠĠĠĠĠ Ġapplication Ġ= Ġsubmitted Delivery Config . application , ĊĠĠĠĠĠ Ġservice Account Ġ= Ġsubmitted Delivery Config . service Account ĊĠĠĠĠĠĠĠ Ġ?: Ġerror (" No Ġservice Ġaccount Ġspecified , Ġand Ġno Ġdefault Ġapplied "), ĊĠĠĠĠĠ Ġartifacts Ġ= Ġsubmitted Delivery Config . artifacts . transform ( submitted Delivery Config . safe Name ), ĊĠĠĠĠĠ Ġenvironments Ġ= Ġsubmitted Delivery Config . environments . map To ( mutable Set Of ()) Ġ{ Ġenv Ġ-> ĊĠĠĠĠĠĠĠ ĠEnvironment ( ĊĠĠĠĠĠĠĠĠĠ Ġname Ġ= Ġenv . name , ĊĠĠĠĠĠĠĠĠĠ Ġresources Ġ= Ġenv . resources . map To ( mutable Set Of ()) Ġ{ Ġresource Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġresource ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( metadata Ġ= Ġmap Of (" service Account " Ġto Ġsubmitted Delivery Config . service Account ) Ġ+ Ġresource . metadata ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. normalize () ĊĠĠĠĠĠĠĠĠĠ Ġ}, ĊĠĠĠĠĠĠĠĠĠ Ġconstraints Ġ= Ġenv . constraints , ĊĠĠĠĠĠĠĠĠĠ Ġverify With Ġ= Ġenv . verify With , ĊĠĠĠĠĠĠĠĠĠ Ġnotifications Ġ= Ġenv . notifications ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠ Ġ}, ĊĠĠĠĠĠ Ġmetadata Ġ= Ġsubmitted Delivery Config . metadata Ġ?: Ġempty Map () ĊĠĠĠ Ġ) ĊĠĠĠ Ġreturn Ġupsert Delivery Config ( new ) ĊĠ Ġ} ĊĊĠ Ġ@ Transactional ( propagation Ġ= ĠREQUIRED ) ĊĠ Ġoverride Ġfun Ġupsert Delivery Config ( delivery Config : ĠDelivery Config ): ĠDelivery Config Ġ{ ĊĠĠĠ Ġval Ġconfig With Same Name Ġ= Ġtry Ġ{ ĊĠĠĠĠĠ Ġget Delivery Config ( delivery Config . name ) ĊĠĠĠ Ġ} Ġcatch Ġ( e : ĠNoSuch Delivery Config Exception ) Ġ{ ĊĠĠĠĠĠ Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ( config With Same Name Ġ!= Ġnull Ġ&& Ġconfig With Same Name . application Ġ!= Ġdelivery Config . application ) Ġ{ ĊĠĠĠĠĠ Ġ// Ġwe Ġdon 't Ġallow Ġstoring Ġ 2 Ġconfigs Ġwith Ġthe Ġsame Ġname , Ġfor Ġdifferent Ġapplications ĊĠĠĠĠĠ Ġthrow ĠConflict ing Delivery Configs Exception ( config With Same Name . application ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġexisting Application Config Ġ= Ġtry Ġ{ ĊĠĠĠĠĠ Ġget Delivery Config For Application ( delivery Config . application ) ĊĠĠĠ Ġ} Ġcatch Ġ( e : ĠNoSuch Delivery Config Exception ) Ġ{ ĊĠĠĠĠĠ Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ( config With Same Name Ġ== Ġnull Ġ&& Ġexisting Application Config Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠ Ġ// Ġwe Ġonly Ġallow Ġone Ġdelivery Ġconfig , Ġso Ġthrow Ġan Ġerror Ġif Ġsomeone Ġis Ġtrying Ġto Ġsubmit Ġa Ġnew Ġconfig ĊĠĠĠĠĠ Ġ// Ġinstead Ġof Ġupdating Ġthe Ġexisting Ġconfig Ġfor Ġthe Ġsame Ġapplication ĊĠĠĠĠĠ Ġthrow ĠToo Many Delivery Configs Exception ( delivery Config . application , Ġexisting Application Config . name ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// Ġby Ġthis Ġpoint , Ġconfig With Same Name Ġis Ġthe Ġold Ġdelivery Ġconfig Ġfor Ġthis Ġapplication ĊĠĠĠ Ġdelivery Config . resources . forEach Ġ{ Ġresource Ġ-> ĊĠĠĠĠĠ Ġupsert Resource ( resource , Ġdelivery Config . name ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġdelivery Config . artifacts . forEach Ġ{ Ġartifact Ġ-> ĊĠĠĠĠĠ Ġregister ( artifact ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġstore Delivery Config ( delivery Config ) ĊĊĠĠĠ Ġif Ġ( config With Same Name Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠ Ġremove Depend ents ( config With Same Name , Ġdelivery Config ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn Ġdelivery Config ĊĠ Ġ} ĊĊĠ Ġ/** ĊĠĠ Ġ* ĠDeletes Ġa Ġconfig Ġand Ġeverything Ġin Ġit Ġand Ġabout Ġit ĊĠĠ Ġ*/ ĊĠ Ġoverride Ġfun Ġdelete Delivery Config By Application ( application : ĠString ) Ġ= ĊĠĠĠ Ġdelivery Config Repository . delete By Application ( application ) ĊĊĠ Ġ/** ĊĠĠ Ġ* ĠDeletes Ġa Ġconfig Ġand Ġeverything Ġin Ġit Ġand Ġabout Ġit ĊĠĠ Ġ*/ ĊĠ Ġoverride Ġfun Ġdelete Delivery Config ByName ( name : ĠString ) Ġ{ ĊĠĠĠ Ġdelivery Config Repository . delete ByName ( name ) ĊĠ Ġ} ĊĊĠ Ġ/** ĊĠĠ Ġ* ĠRemoves Ġartifacts , Ġenvironments , Ġand Ġresources Ġthat Ġwere Ġpresent Ġin Ġthe Ġ[ old ] ĊĠĠ Ġ* Ġdelivery Ġconfig Ġand Ġare Ġnot Ġpresent Ġin Ġthe Ġ[ new ] Ġdelivery Ġconfig ĊĠĠ Ġ*/ ĊĠ Ġoverride Ġfun Ġremove Depend ents ( old : ĠDelivery Config , Ġnew : ĠDelivery Config ) Ġ{ ĊĠĠĠ Ġval Ġnew Resources Ġ= Ġnew . resources . map Ġ{ Ġit . id Ġ} ĊĊĠĠĠ Ġold . artifacts . forEach Ġ{ Ġartifact Ġ-> ĊĠĠĠĠĠ Ġval Ġstill Present Ġ= Ġnew . artifacts . any Ġ{ ĊĠĠĠĠĠĠĠ Ġit . name Ġ== Ġartifact . name Ġ&& ĊĠĠĠĠĠĠĠĠĠ Ġit . type Ġ== Ġartifact . type Ġ&& ĊĠĠĠĠĠĠĠĠĠ Ġit . reference Ġ== Ġartifact . reference ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġif Ġ(! still Present ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog . debug (" Updating Ġconfig Ġ${ new . name }: Ġremoving Ġartifact Ġ$ artifact ") ĊĠĠĠĠĠĠĠ Ġartifact Repository . delete ( artifact ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġold . environments ĊĠĠĠĠĠ Ġ. forEach Ġ{ Ġenvironment Ġ-> ĊĠĠĠĠĠĠĠ Ġenvironment . resources . forEach Ġ{ Ġresource Ġ-> ĊĠĠĠĠĠĠĠĠĠ Ġif Ġ( resource . id Ġ! in Ġnew Resources ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlog . debug (" Updating Ġconfig Ġ${ new . name }: Ġremoving Ġresource Ġ${ resource . id } Ġin Ġenvironment Ġ${ environment . name }") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdelivery Config Repository . delete Resource From Env ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġdelivery Config Name Ġ= Ġold . name , Ġenvironment Name Ġ= Ġenvironment . name , Ġresource Id Ġ= Ġresource . id ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdelete Resource ( resource . id ) ĊĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġif Ġ( environment . name Ġ! in Ġnew . environments . map Ġ{ Ġit . name Ġ}) Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġlog . debug (" Updating Ġconfig Ġ${ new . name }: Ġremoving Ġenvironment Ġ${ environment . name }") ĊĠĠĠĠĠĠĠĠĠ Ġdelivery Config Repository . delete Environment ( new . name , Ġenvironment . name ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun ĠSet < Delivery Artifact >. transform ( delivery Config Name : ĠString ) Ġ= ĊĠĠĠ Ġmap Ġ{ Ġartifact Ġ-> ĊĠĠĠĠĠ Ġval Ġart if ac As Map : ĠMutable Map < String , ĠAny ?> Ġ= ĠobjectMapper . convert Value ( artifact ) ĊĠĠĠĠĠ Ġart if ac As Map [" delivery Config Name "] Ġ= Ġdelivery Config Name ĊĠĠĠĠĠ ĠobjectMapper . convert Value ( art if ac As Map , Ġartifact . java Class ) ĊĠĠĠ Ġ}. toSet () ĊĊĠ Ġ// ĠSTART ĠDelivery Ġconfig Ġmethods ĊĠ Ġoverride Ġfun Ġstore Delivery Config ( delivery Config : ĠDelivery Config ) Ġ= ĊĠĠĠ Ġdelivery Config Repository . store ( delivery Config ) ĊĊĠ Ġoverride Ġfun Ġget Delivery Config ( name : ĠString ): ĠDelivery Config Ġ= ĊĠĠĠ Ġdelivery Config Repository . get ( name ) ĊĊĠ Ġoverride Ġfun Ġenvironment For ( resourceId : ĠString ): ĠEnvironment Ġ= ĊĠĠĠ Ġdelivery Config Repository . environment For ( resourceId ) ĊĊĠ Ġoverride Ġfun Ġenvironment Notifications ( delivery Config Name : ĠString , Ġenvironment Name : ĠString ): ĠSet < Notification Config > Ġ= ĊĠĠĠ Ġdelivery Config Repository . environment Notifications ( delivery Config Name , Ġenvironment Name ) ĊĊĠ Ġoverride Ġfun Ġdelivery Config For ( resourceId : ĠString ): ĠDelivery Config Ġ= ĊĠĠĠ Ġdelivery Config Repository . delivery Config For ( resourceId ) ĊĊĠ Ġoverride Ġfun Ġget Delivery Config For Application ( application : ĠString ): ĠDelivery Config Ġ= ĊĠĠĠ Ġdelivery Config Repository . getBy Application ( application ) ĊĊĠ Ġoverride Ġfun Ġdelete Resource From Env ( delivery Config Name : ĠString , Ġenvironment Name : ĠString , Ġresource Id : ĠString ) Ġ= ĊĠĠĠ Ġdelivery Config Repository . delete Resource From Env ( delivery Config Name , Ġenvironment Name , Ġresource Id ) ĊĊĠ Ġoverride Ġfun Ġdelete Environment ( delivery Config Name : ĠString , Ġenvironment Name : ĠString ) Ġ= ĊĠĠĠ Ġdelivery Config Repository . delete Environment ( delivery Config Name , Ġenvironment Name ) ĊĊĠ Ġoverride Ġfun Ġstore Constraint State ( state : ĠConstraint State ) Ġ= ĊĠĠĠ Ġdelivery Config Repository . store Constraint State ( state ) ĊĊĠ Ġoverride Ġfun Ġget Constraint State ( delivery Config Name : ĠString , Ġenvironment Name : ĠString , Ġartifact Version : ĠString , Ġtype : ĠString , Ġartifact Reference : ĠString ?): ĠConstraint State ? Ġ= ĊĠĠĠ Ġdelivery Config Repository . get Constraint State ( delivery Config Name , Ġenvironment Name , Ġartifact Version , Ġtype , Ġartifact Reference ) ĊĊĠ Ġoverride Ġfun Ġconstraint State For ( delivery Config Name : ĠString , Ġenvironment Name : ĠString , Ġartifact Version : ĠString ): ĠList < Constraint State > Ġ= ĊĠĠĠ Ġdelivery Config Repository . constraint State For ( delivery Config Name , Ġenvironment Name , Ġartifact Version ) ĊĊĠ Ġoverride Ġfun Ġget Pending Artifact Versions ( delivery Config Name : ĠString , Ġenvironment Name : ĠString , Ġartifact : ĠDelivery Artifact ): ĠList < Published Artifact > Ġ= ĊĠĠĠ Ġdelivery Config Repository . get Pending Artifact Versions ( delivery Config Name , Ġenvironment Name , Ġartifact ) ĊĊĠ Ġoverride Ġfun Ġget Artifact Versions Queued For Approval ( delivery Config Name : ĠString , Ġenvironment Name : ĠString , Ġartifact : ĠDelivery Artifact ): ĠList < Published Artifact > Ġ= ĊĠĠĠ Ġdelivery Config Repository . get Artifact Versions Queued For Approval ( delivery Config Name , Ġenvironment Name , Ġartifact ) ĊĊĠ Ġoverride Ġfun Ġqueue Artifact Version For Approval ( delivery Config Name : ĠString , Ġenvironment Name : ĠString , Ġartifact : ĠDelivery Artifact , Ġartifact Version : ĠString ) Ġ= ĊĠĠĠ Ġdelivery Config Repository . queue Artifact Version For Approval ( delivery Config Name , Ġenvironment Name , Ġartifact , Ġartifact Version ) ĊĊĠ Ġoverride Ġfun Ġdelete Artifact Version Queued For Approval ( delivery Config Name : ĠString , Ġenvironment Name : ĠString , Ġartifact : ĠDelivery Artifact , Ġartifact Version : ĠString ) Ġ= ĊĠĠĠ Ġdelivery Config Repository . delete Artifact Version Queued For Approval ( delivery Config Name , Ġenvironment Name , Ġartifact , Ġartifact Version ) ĊĊĠ Ġoverride Ġfun Ġget Constraint State ById ( uid : ĠUID ): ĠConstraint State ? Ġ= ĊĠĠĠ Ġdelivery Config Repository . get Constraint State ById ( uid ) ĊĊĠ Ġoverride Ġfun Ġdelete Constraint State ( delivery Config Name : ĠString , Ġenvironment Name : ĠString , Ġtype : ĠString ) Ġ= ĊĠĠĠ Ġdelivery Config Repository . delete Constraint State ( delivery Config Name , Ġenvironment Name , Ġtype ) ĊĊĠ Ġoverride Ġfun Ġconstraint State For ( application : ĠString ): ĠList < Constraint State > Ġ= ĊĠĠĠ Ġdelivery Config Repository . constraint State For ( application ) ĊĊĠ Ġoverride Ġfun Ġconstraint State For ( delivery Config Name : ĠString , Ġenvironment Name : ĠString , Ġlimit : ĠInt ): ĠList < Constraint State > Ġ= ĊĠĠĠ Ġdelivery Config Repository . constraint State For ( delivery Config Name , Ġenvironment Name , Ġlimit ) ĊĊĠ Ġoverride Ġfun Ġdelivery Configs Due For Check ( min Time Since Last Check : ĠDuration , Ġlimit : ĠInt ): ĠCollection < Delivery Config > Ġ= ĊĠĠĠ Ġdelivery Config Repository . items Due For Check ( min Time Since Last Check , Ġlimit ) ĊĊĠ Ġoverride Ġfun Ġmark Delivery Config Check Complete ( delivery Config : ĠDelivery Config ) Ġ{ ĊĠĠĠ Ġdelivery Config Repository . mark Check Complete ( delivery Config ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġget Application Sum maries (): ĠCollection < Application Summary > Ġ= ĊĠĠĠ Ġdelivery Config Repository . getApplication Sum maries () ĊĊĠ Ġoverride Ġfun Ġtrigger Delivery Config Re check ( application : ĠString ) Ġ= ĊĠĠĠ Ġdelivery Config Repository . trigger Re check ( application ) ĊĠ Ġ// ĠEND ĠDelivery Config Repository Ġmethods ĊĊĠ Ġ// ĠSTART ĠResource Repository Ġmethods ĊĠ Ġoverride Ġfun Ġall Resources ( callback : Ġ( Resource Header ) Ġ-> ĠUnit ) Ġ= ĊĠĠĠ Ġresource Repository . all Resources ( callback ) ĊĊĠ Ġoverride Ġfun ĠgetResource ( id : ĠString ): ĠResource < Resource Spec > Ġ= ĊĠĠĠ Ġresource Repository . get ( id ) ĊĊĠ Ġoverride Ġfun Ġget Raw Resource ( id : ĠString ): ĠResource < Resource Spec > Ġ= ĊĠĠĠ Ġresource Repository . getRaw ( id ) ĊĊĠ Ġoverride Ġfun Ġhas Managed Resources ( application : ĠString ): ĠBoolean Ġ= ĊĠĠĠ Ġresource Repository . has Managed Resources ( application ) ĊĊĠ Ġoverride Ġfun ĠgetResource Ids By Application ( application : ĠString ): ĠList < String > Ġ= ĊĠĠĠ Ġresource Repository . getResource Ids By Application ( application ) ĊĊĠ Ġoverride Ġfun Ġget Resources By Application ( application : ĠString ): ĠList < Resource <* >> Ġ= ĊĠĠĠ Ġresource Repository . getResources By Application ( application ) ĊĊĠ Ġoverride Ġfun Ġ< T Ġ: ĠResource Spec > Ġstore Resource ( resource : ĠResource < T >): ĠResource < T > Ġ= ĊĠĠĠ Ġresource Repository . store ( resource ) ĊĊĠ Ġoverride Ġfun Ġdelete Resource ( id : ĠString ) Ġ= ĊĠĠĠ Ġresource Repository . delete ( id ) ĊĊĠ Ġoverride Ġfun Ġapplication Event History ( application : ĠString , Ġlimit : ĠInt ): ĠList < Application Event > Ġ= ĊĠĠĠ Ġresource Repository . application Event History ( application , Ġlimit ) ĊĊĠ Ġoverride Ġfun Ġapplication Event History ( application : ĠString , Ġdown To : ĠInstant ): ĠList < Application Event > Ġ= ĊĠĠĠ Ġresource Repository . application Event History ( application , Ġdown To ) ĊĊĠ Ġoverride Ġfun Ġresource Event History ( id : ĠString , Ġlimit : ĠInt ): ĠList < Resource History Event > Ġ= ĊĠĠĠ Ġresource Repository . event History ( id , Ġlimit ) ĊĊĠ Ġoverride Ġfun Ġlast Resource History Event ( id : ĠString ): ĠResource History Event ? Ġ= ĊĠĠĠ Ġresource Repository . last Event ( id ) ĊĊĠ Ġoverride Ġfun Ġappend Resource History ( event : ĠResource Event ) Ġ= ĊĠĠĠ Ġresource Repository . append History ( event ) ĊĊĠ Ġoverride Ġfun Ġappend Application History ( event : ĠApplication Event ) Ġ= ĊĠĠĠ Ġresource Repository . append History ( event ) ĊĊĠ Ġoverride Ġfun Ġresources Due For Check ( min Time Since Last Check : ĠDuration , Ġlimit : ĠInt ): ĠCollection < Resource < Resource Spec >> Ġ= ĊĠĠĠ Ġresource Repository . items Due For Check ( min Time Since Last Check , Ġlimit ) ĊĊĠ Ġoverride Ġfun Ġtrigger Resource Re check ( environment Name : ĠString , Ġapplication : ĠString ) Ġ= ĊĠĠĠ Ġresource Repository . trigger Resource Re check ( environment Name , Ġapplication ) ĊĊĠ Ġ// ĠEND ĠResource Repository Ġmethods ĊĊĠ Ġ// ĠSTART ĠArtifact Repository Ġmethods ĊĠ Ġoverride Ġfun Ġregister ( artifact : ĠDelivery Artifact ) Ġ{ ĊĠĠĠ Ġartifact Repository . register ( artifact ) ĊĠĠĠ Ġpublisher . publish Event ( Artifact Registered Event ( artifact )) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġartifacts Due For Check ( min Time Since Last Check : ĠDuration , Ġlimit : ĠInt ): ĠCollection < Delivery Artifact > Ġ= ĊĠĠĠ Ġartifact Repository . items Due For Check ( min Time Since Last Check , Ġlimit ) ĊĊĠ Ġoverride Ġfun Ġget Artifact ( name : ĠString , Ġtype : ĠArtifact Type , Ġdelivery Config Name : ĠString ): ĠList < Delivery Artifact > Ġ= ĊĠĠĠ Ġartifact Repository . get ( name , Ġtype , Ġdelivery Config Name ) ĊĊĠ Ġoverride Ġfun Ġget Artifact ( name : ĠString , Ġtype : ĠArtifact Type , Ġreference : ĠString , Ġdelivery Config Name : ĠString ): ĠDelivery Artifact Ġ= ĊĠĠĠ Ġartifact Repository . get ( name , Ġtype , Ġreference , Ġdelivery Config Name ) ĊĊĠ Ġoverride Ġfun Ġget Artifact ( delivery Config Name : ĠString , Ġreference : ĠString ): ĠDelivery Artifact Ġ= ĊĠĠĠ Ġartifact Repository . get ( delivery Config Name , Ġreference ) ĊĊĠ Ġoverride Ġfun Ġis Registered ( name : ĠString , Ġtype : ĠArtifact Type ): ĠBoolean Ġ= ĊĠĠĠ Ġartifact Repository . is Registered ( name , Ġtype ) ĊĊĠ Ġoverride Ġfun ĠgetAll Artifacts ( type : ĠArtifact Type ?, Ġname : ĠString ?): ĠList < Delivery Artifact > Ġ= ĊĠĠĠ Ġartifact Repository . getAll ( type , Ġname ) ĊĊĠ Ġoverride Ġfun Ġstore Artifact Version ( artifact Version : ĠPub lished Artifact ): ĠBoolean Ġ= ĊĠĠĠ Ġartifact Repository . store Artifact Version ( artifact Version ) ĊĊĠ Ġoverride Ġfun Ġget Artifact Version ( artifact : ĠDelivery Artifact , Ġversion : ĠString , Ġstatus : ĠArtifact Status ?): ĠPub lished Artifact ? Ġ= ĊĠĠĠ Ġartifact Repository . get Artifact Version ( artifact , Ġversion , Ġstatus ) ĊĊĠ Ġoverride Ġfun Ġupdate Artifact Metadata ( artifact : ĠPub lished Artifact , Ġartifact Metadata : ĠArtifact Metadata ) Ġ= ĊĠĠĠ Ġartifact Repository . update Artifact Metadata ( artifact , Ġartifact Metadata ) ĊĊĠ Ġoverride Ġfun Ġdelete Artifact ( artifact : ĠDelivery Artifact ) Ġ= ĊĠĠĠ Ġartifact Repository . delete ( artifact ) ĊĊĠ Ġoverride Ġfun Ġartifact Versions ( artifact : ĠDelivery Artifact , Ġlimit : ĠInt ): ĠList < Published Artifact > Ġ= ĊĠĠĠ Ġartifact Repository . versions ( artifact , Ġlimit ) ĊĊĠ Ġoverride Ġfun Ġlatest Version Approved In ( delivery Config : ĠDelivery Config , Ġartifact : ĠDelivery Artifact , Ġtarget Environment : ĠString ): ĠString ? Ġ= ĊĠĠĠ Ġartifact Repository . latest Version Approved In ( delivery Config , Ġartifact , Ġtarget Environment ) ĊĊĠ Ġoverride Ġfun Ġapprove Version For ( delivery Config : ĠDelivery Config , Ġartifact : ĠDelivery Artifact , Ġversion : ĠString , Ġtarget Environment : ĠString ): ĠBoolean Ġ= ĊĠĠĠ Ġartifact Repository . approve Version For ( delivery Config , Ġartifact , Ġversion , Ġtarget Environment ) ĊĊĠ Ġoverride Ġfun Ġis Approved For ( delivery Config : ĠDelivery Config , Ġartifact : ĠDelivery Artifact , Ġversion : ĠString , Ġtarget Environment : ĠString ): ĠBoolean Ġ= ĊĠĠĠ Ġartifact Repository . is Approved For ( delivery Config , Ġartifact , Ġversion , Ġtarget Environment ) ĊĊĠ Ġoverride Ġfun Ġmark As Deploy ing To ( delivery Config : ĠDelivery Config , Ġartifact : ĠDelivery Artifact , Ġversion : ĠString , Ġtarget Environment : ĠString ) Ġ= ĊĠĠĠ Ġartifact Repository . mark As Deploy ing To ( delivery Config , Ġartifact , Ġversion , Ġtarget Environment ) ĊĊĠ Ġoverride Ġfun Ġwas Successfully Deploy ed To ( delivery Config : ĠDelivery Config , Ġartifact : ĠDelivery Artifact , Ġversion : ĠString , Ġtarget Environment : ĠString ): ĠBoolean Ġ= ĊĠĠĠ Ġartifact Repository . was Successfully Deploy ed To ( delivery Config , Ġartifact , Ġversion , Ġtarget Environment ) ĊĊĠ Ġoverride Ġfun Ġis Currently Deploy ed To ( delivery Config : ĠDelivery Config , Ġartifact : ĠDelivery Artifact , Ġversion : ĠString , Ġtarget Environment : ĠString ): ĠBoolean Ġ= ĊĠĠĠ Ġartifact Repository . is Currently Deploy ed To ( delivery Config , Ġartifact , Ġversion , Ġtarget Environment ) ĊĊĠ Ġoverride Ġfun Ġget Release Status ( artifact : ĠDelivery Artifact , Ġversion : ĠString ): ĠArtifact Status ? Ġ= ĊĠĠĠ Ġartifact Repository . get Release Status ( artifact , Ġversion ) ĊĊĠ Ġoverride Ġfun Ġmark As Successfully Deploy ed To ( delivery Config : ĠDelivery Config , Ġartifact : ĠDelivery Artifact , Ġversion : ĠString , Ġtarget Environment : ĠString ) Ġ= ĊĠĠĠ Ġartifact Repository . mark As Successfully Deploy ed To ( delivery Config , Ġartifact , Ġversion , Ġtarget Environment ) ĊĊĠ Ġoverride Ġfun ĠgetCurrent Artifact Versions ( ĊĠĠĠ Ġdelivery Config : ĠDelivery Config , ĊĠĠĠ Ġenvironment Name : ĠString ĊĠ Ġ): ĠList < Published Artifact > Ġ= ĊĠĠĠ Ġartifact Repository . getCurrent Artifact Versions ( delivery Config , Ġenvironment Name ) ĊĊĠ Ġoverride Ġfun Ġget Environment Sum maries ( delivery Config : ĠDelivery Config ): ĠList < Environment Summary > Ġ= ĊĠĠĠ Ġartifact Repository . get Environment Sum maries ( delivery Config ) ĊĊĠ Ġoverride Ġfun Ġpin Environment ( delivery Config : ĠDelivery Config , Ġenvironment Artifact Pin : ĠEnvironment Artifact Pin ) Ġ= ĊĠĠĠ Ġartifact Repository . pin Environment ( delivery Config , Ġenvironment Artifact Pin ) ĊĊĠ Ġoverride Ġfun Ġpinned Environments ( delivery Config : ĠDelivery Config ): ĠList < Pin ned Environment > Ġ= ĊĠĠĠ Ġartifact Repository . get Pin ned Environments ( delivery Config ) ĊĊĠ Ġoverride Ġfun Ġdelete Pin ( delivery Config : ĠDelivery Config , Ġtarget Environment : ĠString , Ġreference : ĠString ?) Ġ= ĊĠĠĠ Ġif Ġ( reference Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠ Ġartifact Repository . delete Pin ( delivery Config , Ġtarget Environment , Ġreference ) ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠ Ġartifact Repository . delete Pin ( delivery Config , Ġtarget Environment ) ĊĠĠĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġv eto ed Environment Versions ( delivery Config : ĠDelivery Config ): ĠList < Environment Artifact Veto es > Ġ= ĊĠĠĠ Ġartifact Repository . vet o ed Environment Versions ( delivery Config ) ĊĊĠ Ġoverride Ġfun Ġmark As Veto ed In ( ĊĠĠĠ Ġdelivery Config : ĠDelivery Config , ĊĠĠĠ Ġv eto : ĠEnvironment Artifact Veto , ĊĠĠĠ Ġforce : ĠBoolean ĊĠ Ġ): ĠBoolean Ġ= ĊĠĠĠ Ġartifact Repository . mark As Veto ed In ( delivery Config , Ġv eto , Ġforce ) ĊĊĠ Ġoverride Ġfun Ġdelete Veto ( delivery Config : ĠDelivery Config , Ġartifact : ĠDelivery Artifact , Ġversion : ĠString , Ġtarget Environment : ĠString ) Ġ= ĊĠĠĠ Ġartifact Repository . delete Veto ( delivery Config , Ġartifact , Ġversion , Ġtarget Environment ) ĊĊĠ Ġoverride Ġfun Ġmark As Skipped ( delivery Config : ĠDelivery Config , Ġartifact : ĠDelivery Artifact , Ġversion : ĠString , Ġtarget Environment : ĠString , Ġsuper se ded ByVersion : ĠString ) Ġ{ ĊĠĠĠ Ġartifact Repository . mark As Skipped ( delivery Config , Ġartifact , Ġversion , Ġtarget Environment , Ġsuper se ded ByVersion ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġget Artifact Sum maries In Environment ( ĊĠĠĠ Ġdelivery Config : ĠDelivery Config , ĊĠĠĠ Ġenvironment Name : ĠString , ĊĠĠĠ Ġartifact Reference : ĠString , ĊĠĠĠ Ġversions : ĠList < String > ĊĠ Ġ): ĠList < Artifact Summary In Environment > Ġ= ĊĠĠĠ Ġartifact Repository . get Artifact Sum maries In Environment ( ĊĠĠĠĠĠ Ġdelivery Config , Ġenvironment Name , Ġartifact Reference , Ġversions ĊĠĠĠ Ġ) ĊĊĠ Ġoverride Ġfun Ġget Artifact Summary In Environment ( ĊĠĠĠ Ġdelivery Config : ĠDelivery Config , ĊĠĠĠ Ġenvironment Name : ĠString , ĊĠĠĠ Ġartifact Reference : ĠString , ĊĠĠĠ Ġversion : ĠString ĊĠ Ġ) Ġ= Ġartifact Repository . get Artifact Summary In Environment ( ĊĠĠĠ Ġdelivery Config , Ġenvironment Name , Ġartifact Reference , Ġversion ĊĠ Ġ) ĊĊĠ Ġoverride Ġfun Ġget Artifact Version By Promotion Status ( ĊĠĠĠ Ġdelivery Config : ĠDelivery Config , ĊĠĠĠ Ġenvironment Name : ĠString , ĊĠĠĠ Ġartifact : ĠDelivery Artifact , ĊĠĠĠ Ġpromotion Status : ĠProm otion Status , ĊĠĠĠ Ġversion : ĠString ? ĊĠ Ġ) Ġ= Ġartifact Repository . get Artifact Version By Promotion Status ( ĊĠĠĠ Ġdelivery Config , Ġenvironment Name , Ġartifact , Ġpromotion Status , Ġversion ĊĠ Ġ) ĊĊĠ Ġoverride Ġfun Ġget VersionInfo In Environment ( ĊĠĠĠ Ġdelivery Config : ĠDelivery Config , ĊĠĠĠ Ġenvironment Name : ĠString , ĊĠĠĠ Ġartifact : ĠDelivery Artifact ĊĠ Ġ): ĠList < Status Info For Artifact In Environment > Ġ= ĊĠĠĠ Ġartifact Repository . getVersion Info In Environment ( delivery Config , Ġenvironment Name , Ġartifact ) ĊĊĠ Ġoverride Ġfun Ġget Pin ned Version ( delivery Config : ĠDelivery Config , Ġtarget Environment : ĠString , Ġreference : ĠString ) ĊĠĠĠ Ġ= Ġartifact Repository . get Pin ned Version ( delivery Config , Ġtarget Environment , Ġreference ) ĊĊĠ Ġ// ĠEND ĠArtifact Repository Ġmethods ĊĊĠ Ġ// ĠSTART ĠVerification Repository Ġmethods ĊĠ Ġoverride Ġfun Ġnext Environments For Verification ( ĊĠĠĠ Ġmin Time Since Last Check : ĠDuration , ĊĠĠĠ Ġlimit : ĠInt ĊĠ Ġ) Ġ: ĠCollection < Verification Context > Ġ= ĊĠĠĠ Ġverification Repository . next Environments For Verification ( min Time Since Last Check , Ġlimit ) ĊĊĠ Ġoverride Ġfun Ġget Verification States Batch ( contexts : ĠList < Verification Context >) Ġ: ĠList < Map < String , ĠVerification State >> Ġ= ĊĠĠĠ Ġverification Repository . get States Batch ( contexts ) ĊĊĠ Ġ// ĠEND ĠVerification Repository Ġmethods Ċ } Ċ