Class MapRouletteCommand

  • Direct Known Subclasses:
    MapRouletteUploadCommand

    public abstract class MapRouletteCommand
    extends org.openstreetmap.atlas.geography.atlas.AtlasLoadingCommand
    This 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.openstreetmap.atlas.utilities.runtime.Command.Switch<java.lang.String> OUTPUT_PATH  
      • Fields inherited from class org.openstreetmap.atlas.geography.atlas.AtlasLoadingCommand

        EXCLUDE_THESE_COUNTRIES_PARAMETER, INCLUDE_ONLY_THESE_COUNTRIES_PARAMETER, INPUT, INPUT_FOLDER
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addTask​(java.lang.String challengeName, Task task)  
      protected void addTask​(Challenge challenge, Task task)  
      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.
      protected abstract void execute​(org.openstreetmap.atlas.utilities.runtime.CommandMap commandMap, MapRouletteConfiguration configuration)  
      MapRouletteClient getClient()  
      protected MapRouletteClient getMapRouletteClient()  
      protected int onRun​(org.openstreetmap.atlas.utilities.runtime.CommandMap commandMap)  
      protected int onRun​(org.openstreetmap.atlas.utilities.runtime.CommandMap commandMap, java.util.function.BiFunction<MapRouletteConfiguration,​org.apache.http.HttpHost,​MapRouletteClient> clientConstructor)  
      protected org.openstreetmap.atlas.utilities.runtime.Command.SwitchList switches()  
      protected void uploadTasks()  
      • Methods inherited from class org.openstreetmap.atlas.geography.atlas.AtlasLoadingCommand

        loadAtlas, loadAtlas
      • Methods inherited from class org.openstreetmap.atlas.utilities.runtime.Command

        commandSummary, getCommandMap, lastRawCommand, run, runWithoutQuitting
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • OUTPUT_PATH

        protected static final org.openstreetmap.atlas.utilities.runtime.Command.Switch<java.lang.String> OUTPUT_PATH
    • Constructor Detail

      • MapRouletteCommand

        public MapRouletteCommand()
    • Method Detail

      • addTask

        protected void addTask​(java.lang.String challengeName,
                               Task task)
                        throws java.io.UnsupportedEncodingException,
                               java.net.URISyntaxException
        Throws:
        java.io.UnsupportedEncodingException
        java.net.URISyntaxException
      • addTask

        protected void addTask​(Challenge challenge,
                               Task task)
                        throws java.io.UnsupportedEncodingException,
                               java.net.URISyntaxException
        Throws:
        java.io.UnsupportedEncodingException
        java.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)
      • onRun

        protected int onRun​(org.openstreetmap.atlas.utilities.runtime.CommandMap commandMap)
        Specified by:
        onRun in class org.openstreetmap.atlas.utilities.runtime.Command
      • onRun

        protected int onRun​(org.openstreetmap.atlas.utilities.runtime.CommandMap commandMap,
                            java.util.function.BiFunction<MapRouletteConfiguration,​org.apache.http.HttpHost,​MapRouletteClient> clientConstructor)
      • switches

        protected org.openstreetmap.atlas.utilities.runtime.Command.SwitchList switches()
        Overrides:
        switches in class org.openstreetmap.atlas.geography.atlas.AtlasLoadingCommand
      • uploadTasks

        protected void uploadTasks()