Class MapRouletteCommand
- java.lang.Object
-
- org.openstreetmap.atlas.utilities.runtime.Command
-
- org.openstreetmap.atlas.geography.atlas.AtlasLoadingCommand
-
- org.openstreetmap.atlas.checks.maproulette.MapRouletteCommand
-
- Direct Known Subclasses:
MapRouletteUploadCommand
public abstract class MapRouletteCommand extends org.openstreetmap.atlas.geography.atlas.AtlasLoadingCommandThis is an abstract command that gives you a base that can be used for executing data against MapRoulette
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.atlas.geography.atlas.AtlasLoadingCommand
org.openstreetmap.atlas.geography.atlas.AtlasLoadingCommand.AcceptableInputFileFilter
-
Nested classes/interfaces inherited from class org.openstreetmap.atlas.utilities.runtime.Command
org.openstreetmap.atlas.utilities.runtime.Command.Flag, org.openstreetmap.atlas.utilities.runtime.Command.Optionality, org.openstreetmap.atlas.utilities.runtime.Command.Switch<T extends java.lang.Object>, org.openstreetmap.atlas.utilities.runtime.Command.SwitchList
-
-
Constructor Summary
Constructors Constructor Description MapRouletteCommand()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddTask(java.lang.String challengeName, Task task)protected voidaddTask(Challenge challenge, Task task)protected voidcheckUploadTasks(int threshold)Function will check to see how many tasks are currently added in the batch, and if there are more than the current threshold, then it will upload the current tasks otherwise it will do nothing.protected abstract voidexecute(org.openstreetmap.atlas.utilities.runtime.CommandMap commandMap, MapRouletteConfiguration configuration)MapRouletteClientgetClient()protected MapRouletteClientgetMapRouletteClient()protected intonRun(org.openstreetmap.atlas.utilities.runtime.CommandMap commandMap)protected intonRun(org.openstreetmap.atlas.utilities.runtime.CommandMap commandMap, java.util.function.Function<MapRouletteConfiguration,MapRouletteClient> clientConstructor)protected org.openstreetmap.atlas.utilities.runtime.Command.SwitchListswitches()protected voiduploadTasks()-
Methods inherited from class org.openstreetmap.atlas.geography.atlas.AtlasLoadingCommand
loadAtlas, loadAtlas
-
-
-
-
Method Detail
-
getClient
public MapRouletteClient getClient()
-
addTask
protected void addTask(java.lang.String challengeName, Task task) throws java.io.UnsupportedEncodingException, java.net.URISyntaxException- Throws:
java.io.UnsupportedEncodingExceptionjava.net.URISyntaxException
-
addTask
protected void addTask(Challenge challenge, Task task) throws java.io.UnsupportedEncodingException, java.net.URISyntaxException
- Throws:
java.io.UnsupportedEncodingExceptionjava.net.URISyntaxException
-
checkUploadTasks
protected void checkUploadTasks(int threshold)
Function will check to see how many tasks are currently added in the batch, and if there are more than the current threshold, then it will upload the current tasks otherwise it will do nothing.- Parameters:
threshold- the number of tasks that it needs to execute the upload
-
execute
protected abstract void execute(org.openstreetmap.atlas.utilities.runtime.CommandMap commandMap, MapRouletteConfiguration configuration)
-
getMapRouletteClient
protected MapRouletteClient getMapRouletteClient()
-
onRun
protected int onRun(org.openstreetmap.atlas.utilities.runtime.CommandMap commandMap)
- Specified by:
onRunin classorg.openstreetmap.atlas.utilities.runtime.Command
-
onRun
protected int onRun(org.openstreetmap.atlas.utilities.runtime.CommandMap commandMap, java.util.function.Function<MapRouletteConfiguration,MapRouletteClient> clientConstructor)
-
switches
protected org.openstreetmap.atlas.utilities.runtime.Command.SwitchList switches()
- Overrides:
switchesin classorg.openstreetmap.atlas.geography.atlas.AtlasLoadingCommand
-
uploadTasks
protected void uploadTasks()
-
-