Class BaseStreamingRetriever<I,Q,R>

java.lang.Object
com.atlassian.jira.issue.util.streamingretrievers.BaseStreamingRetriever<I,Q,R>
Type Parameters:
I - The type of entity ids used by this class descendants
Q - The type of parameter that is passed to method getting desired entity ids
R - The type of returned entities
Direct Known Subclasses:
StreamingActionDTORetriever, StreamingChangeItemDTORetriever, StreamingCustomFieldValueDTORetriever, StreamingGenericConfigurationDTORetriever, StreamingIssueDTORetriever, StreamingProjectDTORetriever, StreamingWorklogDTORetriever

public abstract class BaseStreamingRetriever<I,Q,R> extends Object
This is the base class for DTO streaming retrievers. The purpose of this class is to provide means to easily return batches of DTOs from database providing methods for getting desired entity ids and getting batches of entities with given ids from database.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract List<R>
    The implementation should return the entities based on provided ids list
    protected abstract List<I>
    getEntityIds(Q queryParam)
    The implementation should return all the ids of entities which will be then returned in batches
    stream(Q queryParam, int batchSize)
    Returns stream of batches ActionDTOs whose bodies contain specified text Note that the returned entities are sorted by the id of the issue they belong to

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BaseStreamingRetriever

      public BaseStreamingRetriever()
  • Method Details

    • stream

      public Stream<List<R>> stream(Q queryParam, int batchSize)
      Returns stream of batches ActionDTOs whose bodies contain specified text Note that the returned entities are sorted by the id of the issue they belong to
      Parameters:
      queryParam - parameter for the query returning entity ids from the database
      batchSize - size of single entity batch to be returned
      Returns:
      stream containing entity batches
    • getEntityIds

      protected abstract List<I> getEntityIds(Q queryParam)
      The implementation should return all the ids of entities which will be then returned in batches
      Parameters:
      queryParam - the parameter which is used to find the entities
    • getEntitiesBatchByIds

      protected abstract List<R> getEntitiesBatchByIds(List<I> idsBatch)
      The implementation should return the entities based on provided ids list
      Parameters:
      idsBatch - the batch of ids for the entities to be returned