package Ġcom . graph ene . writer . store Ċ Ċ import Ġcom . graph ene . common . key . Rotation Property Ċ import Ġcom . graph ene . common . rule . Graph ene Rules Ċ import Ġcom . graph ene . common . store . data . cassandra . C assandra Factory Ċ import Ġcom . graph ene . common . store . data . cassandra . property . C assandra Data Handler Property Ċ import Ġcom . graph ene . writer . error . Errors Ċ import Ġcom . graph ene . writer . store . data . cassandra . handler . Offset Based DataStore Handler Ċ import Ġcom . graph ene . writer . store . data . cassandra . handler . Simple DataStore Handler Ċ import Ġcom . graph ene . writer . store . key . elasticsearch . Elasticsearch Client Factory Ċ import Ġcom . graph ene . writer . store . key . elasticsearch . handler . Index Based KeyStore Handler Ċ import Ġcom . graph ene . writer . store . key . elasticsearch . handler . Logging KeyStore Handler Ċ import Ġcom . graph ene . writer . store . key . elasticsearch . handler . Simple KeyStore Handler Ċ import Ġcom . graph ene . writer . store . key . elasticsearch . handler . Tag Based KeyStore Handler Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġorg . springframework . boot . context . properties . Configuration Properties Ċ import Ġorg . springframework . boot . context . properties . Constructor Binding Ċ import Ġorg . springframework . context . support . Generic ApplicationContext Ċ import Ġorg . springframework . stereotype . Component Ċ Ċ /** Ċ Ġ* Ġ@ author Ġdark Ċ Ġ* Ġ@ author Ġj er ome 8 9 Ċ Ġ* Ċ Ġ* Ġ@ since Ġ 1 . 1 . 0 Ċ Ġ*/ Ċ @ Component Ċ class ĠStore Handler Factory ( ĊĠ Ġvar Ġdata Store Handlers Property : ĠData Store Handlers Property , ĊĠ Ġvar Ġkey Store Handlers Property : ĠKey Store Handlers Property , ĊĠ Ġvar Ġapplication Context : ĠGeneric ApplicationContext Ċ ) Ġ{ ĊĊĠ Ġprivate Ġval Ġlog Ġ= ĠLoggerFactory . getLogger ( Store Handler Factory :: class . java ) ĊĊĠ Ġfun Ġkey Store Handlers (): ĠList < KeyStore Handler > Ġ{ ĊĠĠĠ Ġval Ġkey Store Handlers Ġ= Ġmutable ListOf < KeyStore Handler >() ĊĠĠĠ Ġfor Ġ( handler Ġin Ġkey Store Handlers Property . handlers ) Ġ{ ĊĠĠĠĠĠ Ġlog . info (" KeyStore Handler Factory ĠKey Ġ: Ġ${ handler . key } Ġ/ ĠValue Ġ: Ġ${ handler . value }") ĊĊĠĠĠĠĠ Ġwhen Ġ( val Ġstore Handler Type Ġ= Ġkey Store Handlers Property . handlers [ handler . key ] !!. handler [" type "]) Ġ{ ĊĠĠĠĠĠĠĠ Ġ" Logging KeyStore Handler " Ġ-> Ġkey Store Handlers . add ( create Logging KeyStore Handler ( handler . key , Ġhandler . value )) ĊĠĠĠĠĠĠĠ Ġ" Simple KeyStore Handler " Ġ-> Ġkey Store Handlers . add ( create Simple KeyStore Handler ( handler . key , Ġhandler . value )) ĊĠĠĠĠĠĠĠ Ġ" Index Based KeyStore Handler " Ġ-> Ġkey Store Handlers . add ( create Index Based KeyStore Handler ( handler . key , Ġhandler . value )) ĊĠĠĠĠĠĠĠ Ġ" Tag Based KeyStore Handler " Ġ-> Ġkey Store Handlers . add ( create Tag Based KeyStore Handler ( handler . key , Ġhandler . value )) ĊĠĠĠĠĠĠĠ Ġelse Ġ-> Ġthrow ĠErrors . UNSUPPORTED _ KEY _ STORE _ HANDLER _ EXCEPTION . exception ("$ store Handler Type Ġis Ġnot Ġsupported !") ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġreturn Ġkey Store Handlers ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġcreate Index Based KeyStore Handler ( handler Id : ĠString , Ġkey Store Handler Property : ĠKey Store Handler Property ): ĠKey Store Handler Ġ{ ĊĠĠĠ Ġlog . info (" Store Handler Factory Ġregisters ĠIndex Based KeyStore Handler Ġ: Ġ$ handler Id ") ĊĊĠĠĠ Ġreturn ĠIndex Based KeyStore Handler ( ĊĠĠĠĠĠ Ġapplication Context . getBean (" elasticsearch Client Factory ") Ġas ĠElasticsearch Client Factory , ĊĠĠĠĠĠ Ġkey Store Handler Property ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġcreate Tag Based KeyStore Handler ( handler Id : ĠString , Ġkey Store Handler Property : ĠKey Store Handler Property ): ĠKey Store Handler Ġ{ ĊĠĠĠ Ġlog . info (" Store Handler Factory Ġregisters ĠTag Based KeyStore Handler Ġ: Ġ$ handler Id ") ĊĊĠĠĠ Ġreturn ĠTag Based KeyStore Handler ( ĊĠĠĠĠĠ Ġapplication Context . getBean (" elasticsearch Client Factory ") Ġas ĠElasticsearch Client Factory , ĊĠĠĠĠĠ Ġkey Store Handler Property ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġcreate Simple KeyStore Handler ( handler Id : ĠString , Ġkey Store Handler Property : ĠKey Store Handler Property ): ĠKey Store Handler Ġ{ ĊĠĠĠ Ġlog . info (" Store Handler Factory Ġregisters ĠSimple KeyStore Handler Ġ: Ġ$ handler Id ") ĊĊĠĠĠ Ġreturn ĠSimple KeyStore Handler ( ĊĠĠĠĠĠ Ġapplication Context . getBean (" elasticsearch Client Factory ") Ġas ĠElasticsearch Client Factory , ĊĠĠĠĠĠ Ġkey Store Handler Property ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġfun Ġdata Store Handlers (): ĠList < DataStore Handler > Ġ{ ĊĠĠĠ Ġval Ġdata Store Handlers Ġ= Ġmutable ListOf < DataStore Handler >() ĊĠĠĠ Ġfor Ġ( handler Ġin Ġdata Store Handlers Property . handlers ) Ġ{ ĊĠĠĠĠĠ Ġlog . info (" DataStore Handler Factory ĠKey Ġ: Ġ${ handler . key } Ġ/ ĠValue Ġ: Ġ${ handler . value }") ĊĊĠĠĠĠĠ Ġwhen Ġ( val Ġstore Handler Type Ġ= Ġdata Store Handlers Property . handlers [ handler . key ] !!. type ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ" Simple DataStore Handler " Ġ-> Ġdata Store Handlers . add ( create Simple DataStore Handler ( handler . key , Ġhandler . value )) ĊĠĠĠĠĠĠĠ Ġ" Offset Based DataStore Handler " Ġ-> Ġdata Store Handlers . add ( create Offset Based DataStore Handler ( handler . key , Ġhandler . value )) ĊĠĠĠĠĠĠĠ Ġelse Ġ-> Ġthrow ĠErrors . UNSUPPORTED _ DATA _ STORE _ HANDLER _ EXCEPTION . exception ("$ store Handler Type Ġis Ġnot Ġsupported !") ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn Ġdata Store Handlers ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġcreate Simple DataStore Handler ( handler Id : ĠString , Ġdata Store Handler Property : ĠData Store Handler Property ): ĠData Store Handler Ġ{ ĊĠĠĠ Ġlog . info (" Store Handler Factory Ġregisters ĠSimple DataStore Handler Ġ: Ġ$ handler Id ") ĊĊĠĠĠ Ġreturn ĠSimple DataStore Handler ( ĊĠĠĠĠĠ Ġapplication Context . getBean (" cassandra Factory ") Ġas ĠCassandra Factory , ĊĠĠĠĠĠ Ġdata Store Handler Property ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġcreate Offset Based DataStore Handler ( handler Id : ĠString , Ġdata Store Handler Property : ĠData Store Handler Property ): ĠData Store Handler Ġ{ ĊĠĠĠ Ġlog . info (" Store Handler Factory Ġregisters ĠOffset Based DataStore Handler Ġ: Ġ$ handler Id ") ĊĊĠĠĠ Ġreturn ĠOffset Based DataStore Handler ( ĊĠĠĠĠĠ Ġapplication Context . getBean (" cassandra Factory ") Ġas ĠCassandra Factory , ĊĠĠĠĠĠ Ġdata Store Handler Property ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġcreate Logging KeyStore Handler ( handler Id : ĠString , Ġvalue : ĠKey Store Handler Property ): ĠKey Store Handler Ġ{ ĊĠĠĠ Ġlog . info (" Store Handler Factory ĠRegister Ġlogging KeyStore Handler Ġ: Ġ$ handler Id ") ĊĊĠĠĠ Ġreturn ĠLogging KeyStore Handler () ĊĠ Ġ} Ċ } Ċ Ċ @ Constructor Binding Ċ @ Configuration Properties ( prefix Ġ= Ġ" graph ene . writer . store . data ") Ċ data Ġclass ĠData Store Handlers Property ( ĊĠ Ġvar Ġhandlers : ĠMap < Handler Id , ĠData Store Handler Property > Ċ ) Ċ Ċ data Ġclass ĠData Store Handler Property ( ĊĠ Ġvar Ġtype : ĠString , ĊĠ Ġvar Ġtenant : ĠString Ġ= ĠGraph ene Rules . DEFAULT _ TEN ANT , ĊĠ Ġvar Ġttl : ĠInt Ġ= Ġ 0 , ĊĠ Ġvar Ġroll up : ĠInt Ġ= Ġ 6 0 , ĊĠ Ġvar Ġkey space : ĠString , ĊĠ Ġvar Ġcolumn Family : ĠString , ĊĠ Ġvar Ġbucket Size : ĠShort , ĊĠ Ġvar Ġproperty : ĠCassandra Data Handler Property Ċ ) Ċ Ċ @ Constructor Binding Ċ @ Configuration Properties ( prefix Ġ= Ġ" graph ene . writer . store . key ") Ċ data Ġclass ĠKey Store Handlers Property ( ĊĠ Ġvar Ġhandlers : ĠMap < Handler Id , ĠKey Store Handler Property > Ċ ) Ċ Ċ data Ġclass ĠKey Store Handler Property ( ĊĠ Ġvar Ġtenant : ĠString Ġ= ĠGraph ene Rules . DEFAULT _ TEN ANT , ĊĠ Ġvar Ġrotation : ĠRotation Property Ġ= ĠRotation Property (), ĊĠ Ġvar Ġhandler : ĠMap < String , ĠAny > Ġ= Ġmap Of () Ċ ) Ċ Ċ type alias ĠHandler Id Ġ= ĠString Ċ