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 Details

    • getConnection

      Connection getConnection() throws ProcessException
      Throws:
      ProcessException
    • getConnection

      default Connection getConnection(Map<String,String> attributes) throws ProcessException
      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

      default FlowFileFilter 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

      default FlowFileFilter getFlowFileFilter(int batchSize)
      An utility default method to composite DBCPService specific filtering provided by getFlowFileFilter() and batch size limitation. Implementation classes do not have to override this method. Instead, override getFlowFileFilter() 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.