Class ChallengeBatch


  • public class ChallengeBatch
    extends java.lang.Object
    Batches tasks for a challenge
    • Constructor Detail

      • ChallengeBatch

        public ChallengeBatch​(MapRouletteConfiguration configuration,
                              Challenge challenge)
        This constructor allows us to check whether the challenge has actually been created or not.
        Parameters:
        configuration - MapRouletteConfiguration object for the MapRoulette Server
        challenge - The challenge to create if not exists on the server
      • ChallengeBatch

        public ChallengeBatch​(IMapRouletteConnection connection,
                              long challengeId,
                              int maxBatchSize)
    • Method Detail

      • addTasks

        public void addTasks​(java.util.List<Task> tasks)
                      throws MapRouletteException
        Adds a set of Tasks to the batch. If the batch hits the maximum size it will automatically flush the batch.
        Parameters:
        tasks - The tasks to add to the batch.
        Throws:
        MapRouletteException - If it flushes, it may through a MapRouletteException when pushing data to MapRoulette
      • addTask

        public void addTask​(Task task)
                     throws MapRouletteException
        Adds a task to the Challenge batch. If the batch hits the maximum size it will automatially flush the batch.
        Parameters:
        task - Tasks are unique based on the Task identifier.
        Throws:
        MapRouletteException - If it flushes, it may through a MapRouletteException when pushing data to MapRoulette
      • getLogger

        public org.slf4j.Logger getLogger()
      • getMapper

        public com.fasterxml.jackson.databind.ObjectMapper getMapper()
      • getChallengeId

        public long getChallengeId()
      • getMaxBatchSize

        public int getMaxBatchSize()
      • getBatch

        public java.util.List<Task> getBatch()