1919/**
2020 * An external bridge for {@link Pipeline}
2121 */
22- public class PipelineBridge extends StableBridgeAPI .ProxyInternal <Pipeline > {
23- public static PipelineBridge fromInternal (final Pipeline pipeline ) {
24- return new PipelineBridge (pipeline );
22+ public interface PipelineBridge extends StableBridgeAPI <Pipeline > {
23+
24+ String getId ();
25+
26+ void execute (IngestDocumentBridge bridgedIngestDocument , BiConsumer <IngestDocumentBridge , Exception > bridgedHandler );
27+
28+ static PipelineBridge fromInternal (final Pipeline pipeline ) {
29+ return new ProxyInternal (pipeline );
2530 }
2631
27- public static PipelineBridge create (
32+ static PipelineBridge create (
2833 String id ,
2934 Map <String , Object > config ,
3035 Map <String , ProcessorBridge .Factory > processorFactories ,
@@ -41,18 +46,23 @@ public static PipelineBridge create(
4146 );
4247 }
4348
44- public PipelineBridge (final Pipeline delegate ) {
45- super (delegate );
46- }
49+ class ProxyInternal extends StableBridgeAPI .ProxyInternal <Pipeline > implements PipelineBridge {
4750
48- public String getId ( ) {
49- return internalDelegate . getId ( );
50- }
51+ public ProxyInternal ( final Pipeline delegate ) {
52+ super ( delegate );
53+ }
5154
52- public void execute (final IngestDocumentBridge ingestDocumentBridge , final BiConsumer <IngestDocumentBridge , Exception > handler ) {
53- this .internalDelegate .execute (
54- StableBridgeAPI .toInternalNullable (ingestDocumentBridge ),
55- (ingestDocument , e ) -> handler .accept (IngestDocumentBridge .fromInternalNullable (ingestDocument ), e )
56- );
55+ @ Override
56+ public String getId () {
57+ return internalDelegate .getId ();
58+ }
59+
60+ @ Override
61+ public void execute (final IngestDocumentBridge ingestDocumentBridge , final BiConsumer <IngestDocumentBridge , Exception > handler ) {
62+ this .internalDelegate .execute (
63+ StableBridgeAPI .toInternalNullable (ingestDocumentBridge ),
64+ (ingestDocument , e ) -> handler .accept (IngestDocumentBridge .fromInternalNullable (ingestDocument ), e )
65+ );
66+ }
5767 }
5868}
0 commit comments