Package org.apache.nifi.dbcp
Interface DBCPService
- All Superinterfaces:
ConfigurableComponent,ControllerService
@Tags({"dbcp","jdbc","database","connection","pooling","store"})
@CapabilityDescription("Provides Database Connection Pooling Service. Connections can be asked from pool and returned after usage.")
public interface DBCPService
extends ControllerService
Definition for Database Connection Pooling Service.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ConnectiongetConnection(Map<String, String> attributes) Allows a Map of attributes to be passed to the DBCPService for use in configuration, etc.default FlowFileFilterImplementation classes should override this method to provide DBCPService specific FlowFile filtering rule.default FlowFileFiltergetFlowFileFilter(int batchSize) An utility default method to composite DBCPService specific filtering provided bygetFlowFileFilter()and batch size limitation.Methods inherited from interface org.apache.nifi.components.ConfigurableComponent
getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.controller.ControllerService
initialize, isStateful, migrateProperties
-
Method Details
-
getConnection
- Throws:
ProcessException
-
getConnection
Allows a Map of attributes to be passed to the DBCPService for use in configuration, etc. An implementation will want to override getConnection() to return getConnection(Collections.emptyMap()), and override this method (possibly with its existing getConnection() implementation).- Parameters:
attributes- a Map of attributes to be passed to the DBCPService. The use of these attributes is implementation-specific, and the source of the attributes is processor-specific- Returns:
- a Connection from the specifed/configured connection pool(s)
- Throws:
ProcessException- if an error occurs while getting a connection
-
getFlowFileFilter
Implementation classes should override this method to provide DBCPService specific FlowFile filtering rule. For example, when processing multiple incoming FlowFiles at the same time, every FlowFile should have the same attribute value. Components using this service and also accepting multiple incoming FlowFiles should use the FlowFileFilter returned by this method to get target FlowFiles from a process session.- Returns:
- a FlowFileFilter or null if no service specific filtering is required
-
getFlowFileFilter
An utility default method to composite DBCPService specific filtering provided bygetFlowFileFilter()and batch size limitation. Implementation classes do not have to override this method. Instead, overridegetFlowFileFilter()to provide service specific filtering. Components using this service and also accepting multiple incoming FlowFiles should use the FlowFileFilter returned by this method to get target FlowFiles from a process session.- Parameters:
batchSize- the maximum number of FlowFiles to accept- Returns:
- a composited FlowFileFilter having service specific filtering and batch size limitation, or null if no service specific filtering is required.
-