package Ġjet brains . build Server . nuget . feed . server . json Ċ Ċ import Ġjet brains . build Server . nuget . feed . server . NuGet Feed Constants Ċ import Ġjet brains . build Server . nuget . feed . server . controllers . NuGet Feed Handler Ċ import Ġjet brains . build Server . nuget . feed . server . index . NuGet Feed Data Ċ import Ġjet brains . build Server . nuget . feed . server . index . NuGet Feed Factory Ċ import Ġjet brains . build Server . server Side . Team City Properties Ċ import Ġjavax . servlet . http . HttpServletRequest Ċ import Ġjavax . servlet . http . HttpServletResponse Ċ Ċ class ĠJson Search Query Handler ( ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġfeed Factory : ĠNuGet Feed Factory , ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġpackage Source Factory : ĠJson Package Source Factory , ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġadapter Factory : ĠJson Package Adapter Factory ) Ġ: ĠNuGet Feed Handler Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġhandle Request ( feed Data : ĠNuGet Feed Data , Ġrequest : ĠHttpServletRequest , Ġresponse : ĠHttpServletResponse ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfeed Ġ= Ġfeed Factory . create Feed ( feed Data ) ĊĠĠĠĠĠĠĠ Ġval Ġcontext Ġ= ĠJson NuGet Feed Context ( feed , Ġrequest ) ĊĊĠĠĠĠĠĠĠ Ġif Ġ( Dispatcher Utils . is Async Enabled ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠDispatcher Utils . dispatch Search Packages ( request , Ġresponse , Ġcontext ) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsearch Packages ( request , Ġresponse , Ġcontext ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġsearch Packages ( request : ĠHttpServletRequest , Ġresponse : ĠHttpServletResponse , Ġcontext : ĠJson NuGet Feed Context ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġquery Ġ= Ġrequest . getParameter (" q ") ĊĠĠĠĠĠĠĠ Ġval Ġskip Ġ= Ġrequest . getParameter (" skip ") ?. toInt OrNull () ĊĠĠĠĠĠĠĠ Ġval Ġtake Ġ= Ġrequest . getParameter (" take ") ?. toInt OrNull () Ġ?: ĠNuGet Feed Constants . NU GET _ FEED _ PACKAGE _ SIZE ĊĠĠĠĠĠĠĠ Ġval Ġpr erelease Ġ= Ġrequest . getParameter (" pr erelease ") ?. to Boolean () Ġ?: Ġfalse ĊĠĠĠĠĠĠĠ Ġval Ġinclude Sem Ver 2 Ġ= Ġrequest . include Sem Ver 2 () ĊĊĠĠĠĠĠĠĠ Ġval Ġpackage Source Ġ= Ġpackage Source Factory . create ( context . feed ) ĊĠĠĠĠĠĠĠ Ġval Ġpackages Ġ= Ġpackage Source . search Packages ( query , Ġpr erelease , Ġinclude Sem Ver 2 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġadapter Ġ= Ġadapter Factory . create ( context ) ĊĠĠĠĠĠĠĠ Ġresponse . write Json ( adapter . create Search Packages Response ( packages , Ġtake , Ġskip )) ĊĠĠĠ Ġ} Ċ } Ċ