/* Ċ Ġ* ĠCopyright ĠOpen Search ĠContributors Ċ Ġ* ĠSPDX - License - Identifier : ĠApache - 2 . 0 Ċ Ġ*/ Ċ Ċ package Ġorg . opense arch . index management . index state management . rest handler Ċ Ċ import Ġorg . opense arch . action . support . master . Master Node Request . DEFAULT _ MASTER _ NODE _ TIMEOUT Ċ import Ġorg . opense arch . client . node . Node Client Ċ import Ġorg . opense arch . common . Strings Ċ import Ġorg . opense arch . common . x content . X Content Helper Ċ import Ġorg . opense arch . index management . Index Management Plugin . Companion . IS M _ BASE _ URI Ċ import Ġorg . opense arch . index management . Index Management Plugin . Companion . LEG ACY _ IS M _ BASE _ URI Ċ import Ġorg . opense arch . index management . index state management . transport . action . retry failed managed index . Retry Failed Managed Index Action Ċ import Ġorg . opense arch . index management . index state management . transport . action . retry failed managed index . Retry Failed Managed Index Request Ċ import Ġorg . opense arch . index management . index state management . util . DEFAULT _ INDEX _ TYPE Ċ import Ġorg . opense arch . index management . index state management . util . TYPE _ PARAM _ KEY Ċ import Ġorg . opense arch . rest . Base Rest Handler Ċ import Ġorg . opense arch . rest . Base Rest Handler . Rest Channel Consumer Ċ import Ġorg . opense arch . rest . Rest Handler . Re placed Route Ċ import Ġorg . opense arch . rest . Rest Handler . Route Ċ import Ġorg . opense arch . rest . Rest Request Ċ import Ġorg . opense arch . rest . Rest Request . Method . POST Ċ import Ġorg . opense arch . rest . action . Rest To X Content Listener Ċ Ċ class ĠRest Retry Failed Managed Index Action Ġ: ĠBase Rest Handler () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġroutes (): ĠList < Route > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġempty List () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġreplaced Routes (): ĠList < Re placed Route > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRe placed Route ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠPOST , ĠRET RY _ BASE _ URI , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠPOST , ĠLE G ACY _ RETRY _ BASE _ URI ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRe placed Route ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠPOST , Ġ"$ RETRY _ BASE _ URI /{ index }", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠPOST , Ġ"$ LEG ACY _ RETRY _ BASE _ URI /{ index }" ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetName (): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġ" retry _ failed _ managed _ index " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Suppress (" Spread Operator ") Ġ// ĠThere Ġis Ġno Ġway Ġaround Ġdealing Ġwith Ġjava Ġvar arg Ġwithout Ġspread Ġoperator . ĊĠĠĠ Ġoverride Ġfun Ġprepare Request ( request : ĠRest Request , Ġclient : ĠNode Client ): ĠRest Channel Consumer Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġindices : ĠArray < String >? Ġ= ĠStrings . split String By Comma ToArray ( request . param (" index ")) ĊĠĠĠĠĠĠĠ Ġif Ġ( indices Ġ== Ġnull Ġ|| Ġindices . isEmpty ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthrow ĠIllegalArgumentException (" Missing Ġindices ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġbody Ġ= Ġif Ġ( request . has Content ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠX Content Helper . convertTo Map ( request . required Content (), Ġfalse , Ġrequest . x ContentType ). v 2 () ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmap Of () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġindex Type Ġ= Ġrequest . param ( TYPE _ PARAM _ KEY , ĠDEFAULT _ INDEX _ TYPE ) ĊĊĠĠĠĠĠĠĠ Ġval Ġretry Failed Request Ġ= ĠRetry Failed Managed Index Request ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġindices . toList (), Ġbody [" state "] Ġas ĠString ?, ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrequest . param As Time (" master _ timeout ", ĠDEFAULT _ MASTER _ NODE _ TIMEOUT ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġindex Type ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġreturn ĠRest Channel Consumer Ġ{ Ġchannel Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġclient . execute ( Retry Failed Managed Index Action . INSTANCE , Ġretry Failed Request , ĠRest To X Content Listener ( channel )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠRET RY _ BASE _ URI Ġ= Ġ"$ IS M _ BASE _ URI / retry " ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠLE G ACY _ RETRY _ BASE _ URI Ġ= Ġ"$ LEG ACY _ IS M _ BASE _ URI / retry " ĊĠĠĠ Ġ} Ċ } Ċ