Package org.maproulette.client.batch
Class ChallengeBatch
- java.lang.Object
-
- org.maproulette.client.batch.ChallengeBatch
-
public class ChallengeBatch extends java.lang.ObjectBatches tasks for a challenge
-
-
Constructor Summary
Constructors Constructor Description ChallengeBatch(MapRouletteConfiguration configuration, long challengeId)ChallengeBatch(MapRouletteConfiguration configuration, Challenge challenge)This constructor allows us to check whether the challenge has actually been created or not.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTask(Task task)Adds a task to the Challenge batch.voidaddTasks(java.util.List<Task> tasks)Adds a set of Tasks to the batch.voidflush()Flushes all the tasks from the Challenge batchstatic longgetChallengeId(MapRouletteConfiguration configuration, Challenge challenge)
-
-
-
Constructor Detail
-
ChallengeBatch
public ChallengeBatch(MapRouletteConfiguration configuration, long challengeId)
-
ChallengeBatch
public ChallengeBatch(MapRouletteConfiguration configuration, Challenge challenge)
This constructor allows us to check whether the challenge has actually been created or not.- Parameters:
configuration-MapRouletteConfigurationobject for the MapRoulette Serverchallenge- The challenge to create if not exists on the server
-
-
Method Detail
-
getChallengeId
public static long getChallengeId(MapRouletteConfiguration configuration, Challenge challenge)
-
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
-
flush
public void flush() throws MapRouletteExceptionFlushes all the tasks from the Challenge batch- Throws:
MapRouletteException- If there are any failures during the upload
-
-