package Ġcom . app ify hub . mon ol ith . controller . creator Ċ Ċ import Ġcom . app ify hub . mon ol ith . controller . common . Endpoints Ċ import Ġcom . app ify hub . mon ol ith . domain . creator . property . Project Property Ċ import Ġcom . app ify hub . mon ol ith . domain . creator . property . Property Ċ import Ġcom . app ify hub . mon ol ith . network . common . Message Response Ċ import Ġcom . app ify hub . mon ol ith . network . creator . property . Property Configuration Response Ċ import Ġcom . app ify hub . mon ol ith . network . creator . property . Property Response Ċ import Ġcom . app ify hub . mon ol ith . network . creator . property . ops . Multiple Properties Save Request Ċ import Ġcom . app ify hub . mon ol ith . network . creator . property . ops . Property Filter QueryParams Ċ import Ġcom . app ify hub . mon ol ith . network . creator . property . ops . Property Save Request Ċ import Ġcom . app ify hub . mon ol ith . network . creator . property . ops . PropertyValue Dto Ċ import Ġcom . app ify hub . mon ol ith . network . mapper . to Network Ċ import Ġcom . app ify hub . mon ol ith . service . access . Access Manager Ċ import Ġcom . app ify hub . mon ol ith . service . access . Access Manager . Privilege Ċ import Ġcom . app ify hub . mon ol ith . service . creator . Property Service Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġorg . springframework . security . core . Authentication Ċ import Ġorg . springframework . web . bind . annotation . Delete Mapping Ċ import Ġorg . springframework . web . bind . annotation . GetMapping Ċ import Ġorg . springframework . web . bind . annotation . PathVariable Ċ import Ġorg . springframework . web . bind . annotation . PostMapping Ċ import Ġorg . springframework . web . bind . annotation . RequestBody Ċ import Ġorg . springframework . web . bind . annotation . RequestParam Ċ import Ġorg . springframework . web . bind . annotation . RestController Ċ Ċ @ RestController Ċ class ĠCreator Property Controller ( ĊĠ Ġprivate Ġval Ġproperty Service : ĠProperty Service , ĊĠ Ġprivate Ġval Ġaccess Manager : ĠAccess Manager , Ċ ) Ġ{ ĊĊĠ Ġprivate Ġval Ġlog Ġ= ĠLoggerFactory . getLogger ( this :: class . java ) ĊĊĠ Ġ@ GetMapping ( Endpoints . CONFIGURATION S ) ĊĠ Ġfun Ġget Configurations ( ĊĠĠĠ Ġauthentication : ĠAuthentication , ĊĠĠĠ Ġ@ PathVariable ĠprojectId : ĠLong , ĊĠĠĠ Ġquery : ĠProperty Filter QueryParams ?, ĊĠ Ġ): ĠList < Property Configuration Response > Ġ{ ĊĠĠĠ Ġlog . debug ("[ GET ] Ġget Ġconfigurations Ġfor Ġproject Ġ$ projectId Ġwith Ġquery Ġ$ query ") ĊĊĠĠĠ Ġaccess Manager . request Project Access ( authentication , ĠprojectId , ĠPriv ilege . PROJECT _ READ ) ĊĠĠĠ Ġval Ġconfigurations Ġ= Ġproperty Service . get Configurations Filtered ( query ) ĊĊĠĠĠ Ġreturn Ġconfigurations . map ( Project Property :: to Network ) ĊĠ Ġ} ĊĊĠ Ġ@ GetMapping ( Endpoints . PROPERTY ) ĊĠ Ġfun ĠgetProperty ( ĊĠĠĠ Ġauthentication : ĠAuthentication , ĊĠĠĠ Ġ@ PathVariable ĠprojectId : ĠLong , ĊĠĠĠ Ġ@ PathVariable ĠpropertyName : ĠString , ĊĠ Ġ): ĠProperty Response Ġ{ ĊĠĠĠ Ġlog . debug ("[ GET ] Ġget Ġproperty Ġ$ propertyName Ġfor Ġproject Ġ$ projectId ") ĊĊĠĠĠ Ġval Ġproject Ġ= Ġaccess Manager . request Project Access ( authentication , ĠprojectId , ĠPriv ilege . PROJECT _ READ ) ĊĠĠĠ Ġval Ġproperty Ġ= Ġproperty Service . fetch Property < Any >( project . id , ĠpropertyName ) ĊĊĠĠĠ Ġreturn Ġproperty . to Network () ĊĠ Ġ} ĊĊĠ Ġ@ GetMapping ( Endpoints . PROPERTIES ) ĊĠ Ġfun Ġget Properties ( ĊĠĠĠ Ġauthentication : ĠAuthentication , ĊĠĠĠ Ġ@ PathVariable ĠprojectId : ĠLong , ĊĠĠĠ Ġ@ RequestParam Ġnames : ĠList < String > ?, ĊĠĠĠ Ġquery : ĠProperty Filter QueryParams ?, ĊĠ Ġ): ĠList < Property Response > Ġ{ ĊĠĠĠ Ġlog . debug ("[ GET ] Ġget Ġproperties Ġfor Ġproject Ġ$ projectId Ġwith Ġquery Ġ$ query Ġand Ġnames Ġ$ names ") ĊĊĠĠĠ Ġval Ġproject Ġ= Ġaccess Manager . request Project Access ( authentication , ĠprojectId , ĠPriv ilege . PROJECT _ READ ) ĊĠĠĠ Ġval Ġproperties Ġ= Ġif Ġ( names . isNull OrEmpty ()) Ġ{ ĊĠĠĠĠĠ Ġproperty Service . fetch Properties Filtered ( project . id , Ġquery ) ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠ Ġproperty Service . fetch Properties ( project . id , Ġnames ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġreturn Ġproperties . map ( Property <* >:: to Network ) ĊĠ Ġ} ĊĊĠ Ġ@ PostMapping ( Endpoints . PROPERTY ) ĊĠ Ġfun Ġsave Property ( ĊĠĠĠ Ġauthentication : ĠAuthentication , ĊĠĠĠ Ġ@ PathVariable ĠprojectId : ĠLong , ĊĠĠĠ Ġ@ PathVariable ĠpropertyName : ĠString , ĊĠĠĠ Ġ@ RequestBody Ġproperty Request : ĠProperty Save Request , ĊĠ Ġ): ĠProperty Response Ġ{ ĊĠĠĠ Ġlog . debug ("[ GET ] Ġsave Ġproperty Ġ$ propertyName Ġfor Ġproject Ġ$ projectId ") ĊĊĠĠĠ Ġval Ġproject Ġ= Ġaccess Manager . request Project Access ( authentication , ĠprojectId , ĠPriv ilege . PROJECT _ READ ) ĊĠĠĠ Ġval Ġproperty Ġ= Ġproperty Service . save Property < Any >( project . id , ĠpropertyName , Ġproperty Request . raw Value ) ĊĊĠĠĠ Ġreturn Ġproperty . to Network () ĊĠ Ġ} ĊĊĠ Ġ@ PostMapping ( Endpoints . PROPERTIES ) ĊĠ Ġfun Ġsave Properties ( ĊĠĠĠ Ġauthentication : ĠAuthentication , ĊĠĠĠ Ġ@ PathVariable ĠprojectId : ĠLong , ĊĠĠĠ Ġ@ RequestBody Ġproperties Request : ĠMultiple Properties Save Request , ĊĠ Ġ): ĠList < Property Response > Ġ{ ĊĠĠĠ Ġlog . debug ("[ GET ] Ġsave Ġproperties Ġ$ properties Request Ġfor Ġproject Ġ$ projectId ") ĊĊĠĠĠ Ġval Ġproject Ġ= Ġaccess Manager . request Project Access ( authentication , ĠprojectId , ĠPriv ilege . PROJECT _ READ ) ĊĠĠĠ Ġval Ġnames Ġ= Ġproperties Request . properties . map ( PropertyValue Dto :: name ) ĊĠĠĠ Ġval Ġvalues Ġ= Ġproperties Request . properties . map ( PropertyValue Dto :: raw Value ) ĊĠĠĠ Ġval Ġproperties Ġ= Ġproperty Service . save Properties ( project . id , Ġnames , Ġvalues ) ĊĊĠĠĠ Ġreturn Ġproperties . map ( Property <* >:: to Network ) ĊĠ Ġ} ĊĊĠ Ġ@ Delete Mapping ( Endpoints . PROPERTY ) ĊĠ Ġfun Ġclear Properties ( ĊĠĠĠ Ġauthentication : ĠAuthentication , ĊĠĠĠ Ġ@ PathVariable ĠprojectId : ĠLong , ĊĠĠĠ Ġ@ PathVariable ĠpropertyName : ĠString , ĊĠ Ġ): ĠMessage Response Ġ{ ĊĠĠĠ Ġlog . debug ("[ GET ] Ġclear Ġproperty Ġ$ propertyName Ġfor Ġproject Ġ$ projectId ") ĊĊĠĠĠ Ġval Ġproject Ġ= Ġaccess Manager . request Project Access ( authentication , ĠprojectId , ĠPriv ilege . PROJECT _ READ ) ĊĠĠĠ Ġproperty Service . clear Property ( project . id , ĠpropertyName ) ĊĊĠĠĠ Ġreturn ĠMessage Response . DONE ĊĠ Ġ} ĊĊĠ Ġ@ Delete Mapping ( Endpoints . PROPERTIES ) ĊĠ Ġfun Ġclear Properties ( ĊĠĠĠ Ġauthentication : ĠAuthentication , ĊĠĠĠ Ġ@ PathVariable ĠprojectId : ĠLong , ĊĠĠĠ Ġquery : ĠProperty Filter QueryParams ?, ĊĠ Ġ): ĠMessage Response Ġ{ ĊĠĠĠ Ġlog . debug ("[ GET ] Ġclear Ġproperties Ġfor Ġproject Ġ$ projectId Ġwith Ġquery Ġ$ query ") ĊĊĠĠĠ Ġval Ġproject Ġ= Ġaccess Manager . request Project Access ( authentication , ĠprojectId , ĠPriv ilege . PROJECT _ READ ) ĊĠĠĠ Ġproperty Service . clear Properties Filtered ( project . id , Ġquery ) ĊĊĠĠĠ Ġreturn ĠMessage Response . DONE ĊĠ Ġ} Ċ Ċ } Ċ