// ĠCopyright Ġ 2 0 0 0 - 2 0 2 1 ĠJetBrains Ġs . r . o . Ġand Ġcontributors . ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe ĠLICENSE Ġfile . Ċ package Ġcom . intellij . internal . statistic . env Test . upload Ċ Ċ import Ġcom . intellij . internal . statistic . env Test . Apache Container Ċ import Ġcom . intellij . internal . statistic . event Log .* Ċ import Ġcom . intellij . internal . statistic . event Log . connection . Event Log Send Listener Ċ import Ġcom . intellij . internal . statistic . event Log . connection . Event Log Statistics Service Ċ import Ġcom . intellij . internal . statistic . event Log . connection . Event Log Upload Settings Service Ċ import Ġjava . io . File Ċ Ċ internal Ġconst Ġval ĠSET T INGS _ ROOT Ġ= Ġ" settings /% s /% s . json " Ċ Ċ internal Ġconst Ġval ĠREC ORDER _ ID Ġ= Ġ" F US " Ċ internal Ġconst Ġval ĠPRODUCT _ VERSION Ġ= Ġ" 2 0 2 0 . 1 " Ċ internal Ġconst Ġval ĠPRODUCT _ CODE Ġ= Ġ" IC " Ċ Ċ internal Ġclass ĠTest Event Log Application Info ( recorder Id : ĠString , Ġprivate Ġval Ġsettings Url : ĠString ) ĊĠ Ġ: ĠEvent Log Internal Application Info ( recorder Id , Ġfalse ) Ġ{ ĊĠ Ġoverride Ġfun Ġget Product Version (): ĠString Ġ= ĠPRODUCT _ VERSION ĊĠ Ġoverride Ġfun Ġget Product Code (): ĠString Ġ= ĠPRODUCT _ CODE ĊĠ Ġoverride Ġfun Ġget Template Url (): ĠString Ġ= Ġsettings Url Ċ } Ċ Ċ internal Ġclass ĠTest Event Log Recorder Config ( recorder Id : ĠString , Ġlog Files : ĠList < File >, Ġval Ġsend Enabled : ĠBoolean Ġ= Ġtrue ) ĊĠ Ġ: ĠEvent Log Internal Recorder Config ( recorder Id ) Ġ{ ĊĠ Ġprivate Ġval Ġeven Log Files Provider Ġ= Ġobject Ġ: ĠFiles ToSend Provider Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġget Files ToSend (): ĠList < Event LogFile > Ġ= Ġlog Files . map Ġ{ ĠEvent LogFile ( it ) Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġis Send Enabled (): ĠBoolean Ġ= Ġsend Enabled ĊĊĠ Ġoverride Ġfun Ġget Files ToSend Provider (): ĠFiles ToSend Provider Ġ= Ġeven Log Files Provider Ċ } Ċ Ċ internal Ġfun Ġnew Send Service ( container : ĠApache Container , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġlog Files : ĠList < File >, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsettings Response File : ĠString Ġ= ĠSET T INGS _ ROOT , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsend Enabled : ĠBoolean Ġ= Ġtrue , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmachine Id : ĠMachine Id ? Ġ= Ġnull ): ĠEvent Log Statistics Service Ġ{ ĊĠ Ġval Ġapplication Info Ġ= ĠTest Event Log Application Info ( REC ORDER _ ID , Ġcontainer . get BaseUrl ( settings Response File ). toString ()) ĊĠ Ġval Ġconfig Ġ= ĠEvent Log Configuration . getInstance (). get OrCreate ( REC ORDER _ ID ) ĊĠ Ġreturn ĠEvent Log Statistics Service ( ĊĠĠĠ ĠDevice Configuration ( config . deviceId , Ġconfig . bucket , Ġmachine Id Ġ?: Ġconfig . machine Id ), ĊĠĠĠ ĠTest Event Log Recorder Config ( REC ORDER _ ID , Ġlog Files , Ġsend Enabled ), ĊĠĠĠ ĠEvent Log Send Listener Ġ{ Ġ_, Ġ_, Ġ_ Ġ-> ĠUnit Ġ}, ĊĠĠĠ ĠEvent Log Upload Settings Service ( REC ORDER _ ID , Ġapplication Info ) ĊĠ Ġ) Ċ }