1515import org .elasticsearch .ingest .IngestService ;
1616import org .elasticsearch .ingest .Processor ;
1717import org .elasticsearch .logstashbridge .StableBridgeAPI ;
18+ import org .elasticsearch .logstashbridge .common .ProjectIdBridge ;
1819import org .elasticsearch .logstashbridge .env .EnvironmentBridge ;
1920import org .elasticsearch .logstashbridge .script .ScriptServiceBridge ;
2021import org .elasticsearch .logstashbridge .threadpool .ThreadPoolBridge ;
@@ -178,22 +179,23 @@ public Processor.Parameters toInternal() {
178179 * An external bridge for {@link Processor.Factory}
179180 */
180181 interface Factory extends StableBridgeAPI <Processor .Factory > {
181- @ Deprecated // supply ProjectId
182+
183+ @ Deprecated // supply ProjectIdBridge
182184 default ProcessorBridge create (
183185 Map <String , ProcessorBridge .Factory > registry ,
184186 String processorTag ,
185187 String description ,
186188 Map <String , Object > config
187189 ) throws Exception {
188- return this .create (registry , processorTag , description , config , ProjectId . DEFAULT );
190+ return this .create (registry , processorTag , description , config , ProjectIdBridge . getDefault () );
189191 }
190192
191193 ProcessorBridge create (
192194 Map <String , ProcessorBridge .Factory > registry ,
193195 String processorTag ,
194196 String description ,
195197 Map <String , Object > config ,
196- ProjectId projectId
198+ ProjectIdBridge projectId
197199 ) throws Exception ;
198200
199201 static Factory fromInternal (final Processor .Factory delegate ) {
@@ -218,10 +220,11 @@ public ProcessorBridge create(
218220 final String processorTag ,
219221 final String description ,
220222 final Map <String , Object > config ,
221- final ProjectId projectId
223+ final ProjectIdBridge bridgedProjectId
222224 ) throws Exception {
223225 final Map <String , Processor .Factory > internalRegistry = StableBridgeAPI .toInternal (registry );
224226 final Processor .Factory internalFactory = toInternal ();
227+ final ProjectId projectId = bridgedProjectId .toInternal ();
225228 final Processor internalProcessor = internalFactory .create (internalRegistry , processorTag , description , config , projectId );
226229 return ProcessorBridge .fromInternal (internalProcessor );
227230 }
@@ -260,14 +263,15 @@ public Processor create(
260263 ) throws Exception {
261264 final Map <String , ProcessorBridge .Factory > bridgedProcessorFactories = StableBridgeAPI .fromInternal (
262265 processorFactories ,
263- ProcessorBridge .Factory . ProxyInternal :: new
266+ ProcessorBridge .Factory :: fromInternal
264267 );
268+ final ProjectIdBridge bridgedProjectId = ProjectIdBridge .fromInternal (projectId );
265269 final ProcessorBridge bridgedProcessor = AbstractExternal .this .create (
266270 bridgedProcessorFactories ,
267271 tag ,
268272 description ,
269273 config ,
270- projectId
274+ bridgedProjectId
271275 );
272276 return bridgedProcessor .toInternal ();
273277 }
0 commit comments