package Ġnet . cord a . network . map . repository Ċ Ċ import Ġnet . cord a . core . crypto . Secure Hash Ċ import Ġnet . cord a . core . serialization . serialize Ċ import Ġnet . cord a . node api . internal . Signed NodeInfo Ċ import Ġorg . springframework . stereotype . Component Ċ import Ġjava . util .* Ċ import Ġjava . util . concurrent . Concurrent HashMap Ċ import Ġjava . util . concurrent . Concurrent Map Ċ Ċ @ Component Ċ @ Map Back ed Ċ class ĠMap NodeInfo Repository Ġ: ĠNode Info Repository Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġmap : ĠConcurrent Map < Secure Hash , ĠPair < Signed NodeInfo , ĠByteArray >> Ġ= ĠConcurrent HashMap () ĊĊĠĠĠ Ġoverride Ġfun Ġpersist Signed NodeInfo ( signed NodeInfo : ĠSigned NodeInfo ) Ġ{ ĊĠĠĠĠĠĠĠ Ġmap . put ( signed NodeInfo . raw . hash , Ġsigned NodeInfo Ġto Ġsigned NodeInfo . serialize (). bytes ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Signed NodeInfo ( hash : ĠString ): ĠPair < Signed NodeInfo , ĠByteArray >? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġmap . get ( Secure Hash . parse ( hash )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetAll Hashes (): ĠCollection < Secure Hash > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠCollections . unmodifiable Set ( map . keys ); ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġpurge All Pers isted Signed Node Infos (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġmap . size . also Ġ{ Ġmap . clear () Ġ} ĊĠĠĠ Ġ} Ċ }