package Ġnet . cord a . server . controllers Ċ Ċ import Ġnet . cord a . core . contracts . Contract State Ċ import Ġnet . cord a . core . messaging . vault Query By Ċ import Ġnet . cord a . server . Node RPC Connection Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġorg . springframework . web . bind . annotation . GetMapping Ċ import Ġorg . springframework . web . bind . annotation . RequestMapping Ċ import Ġorg . springframework . web . bind . annotation . RestController Ċ import Ġjava . time . LocalDateTime Ċ import Ġjava . time . Zone Id Ċ Ċ /** Ċ Ġ* ĠA ĠCor D app - agnostic Ġcontroller Ġthat Ġexposes Ġstandard Ġendpoints . Ċ Ġ*/ Ċ @ RestController Ċ @ RequestMapping ("/") Ġ// ĠThe Ġpaths Ġfor ĠGET Ġand ĠPOST Ġrequests Ġare Ġrelative Ġto Ġthis Ġbase Ġpath . Ċ class ĠStandard Controller ( ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġrpc : ĠNode RPC Connection ) Ġ{ ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġlogger Ġ= ĠLoggerFactory . getLogger ( RestController :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġval Ġproxy Ġ= Ġrpc . proxy ĊĊĠĠĠ Ġ@ GetMapping ( value Ġ= Ġ"/ status ", Ġproduces Ġ= ĠarrayOf (" text / plain ")) ĊĠĠĠ Ġprivate Ġfun Ġstatus () Ġ= Ġ" 2 0 0 " ĊĊĠĠĠ Ġ@ GetMapping ( value Ġ= Ġ"/ server time ", Ġproduces Ġ= ĠarrayOf (" text / plain ")) ĊĠĠĠ Ġprivate Ġfun Ġserver Time () Ġ= ĠLocalDateTime . of Instant ( proxy . currentNode Time (), ĠZone Id . of (" UTC ")). toString () ĊĊĠĠĠ Ġ@ GetMapping ( value Ġ= Ġ"/ addresses ", Ġproduces Ġ= ĠarrayOf (" text / plain ")) ĊĠĠĠ Ġprivate Ġfun Ġaddresses () Ġ= Ġproxy . node Info (). addresses . toString () ĊĊĠĠĠ Ġ@ GetMapping ( value Ġ= Ġ"/ ident ities ", Ġproduces Ġ= ĠarrayOf (" text / plain ")) ĊĠĠĠ Ġprivate Ġfun Ġident ities () Ġ= Ġproxy . node Info (). legal Id entities . toString () ĊĊĠĠĠ Ġ@ GetMapping ( value Ġ= Ġ"/ platform version ", Ġproduces Ġ= ĠarrayOf (" text / plain ")) ĊĠĠĠ Ġprivate Ġfun Ġplatform Version () Ġ= Ġproxy . node Info (). platform Version . toString () ĊĊĠĠĠ Ġ@ GetMapping ( value Ġ= Ġ"/ peers ", Ġproduces Ġ= ĠarrayOf (" text / plain ")) ĊĠĠĠ Ġprivate Ġfun Ġpeers () Ġ= Ġproxy . network Map Snapshot (). flatMap Ġ{ Ġit . legal Id entities Ġ}. toString () ĊĊĠĠĠ Ġ@ GetMapping ( value Ġ= Ġ"/ not aries ", Ġproduces Ġ= ĠarrayOf (" text / plain ")) ĊĠĠĠ Ġprivate Ġfun Ġnot aries () Ġ= Ġproxy . not ary Id entities (). toString () ĊĊĠĠĠ Ġ@ GetMapping ( value Ġ= Ġ"/ flows ", Ġproduces Ġ= ĠarrayOf (" text / plain ")) ĊĠĠĠ Ġprivate Ġfun Ġflows () Ġ= Ġproxy . registered Flows (). toString () ĊĊĠĠĠ Ġ@ GetMapping ( value Ġ= Ġ"/ states ", Ġproduces Ġ= ĠarrayOf (" text / plain ")) ĊĠĠĠ Ġprivate Ġfun Ġstates () Ġ= Ġproxy . vault Query By < Contract State >(). states . toString () Ċ }