org.openstreetmap.josm.gui.io
Enum UploadStrategy

java.lang.Object
  extended by java.lang.Enum<UploadStrategy>
      extended by org.openstreetmap.josm.gui.io.UploadStrategy
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<UploadStrategy>

public enum UploadStrategy
extends java.lang.Enum<UploadStrategy>


Enum Constant Summary
CHUNKED_DATASET_STRATEGY
          Upload the objects in junks of n objects using m diff uploads
INDIVIDUAL_OBJECTS_STRATEGY
          Uploads the objects individually, one request per object
SINGLE_REQUEST_STRATEGY
          Upload the objects in one request using 1 diff upload
 
Field Summary
static UploadStrategy DEFAULT_UPLOAD_STRATEGY
          the default upload strategy
private  java.lang.String preferenceValue
           
 
Method Summary
static UploadStrategy fromPreference(java.lang.String preferenceValue)
           
static UploadStrategy getFromPreferences()
          Replies the upload strategy currently configured in the preferences.
 java.lang.String getPreferenceValue()
          Replies the value which is written to the preferences for a specific upload strategy
static void saveToPreferences(UploadStrategy strategy)
          Saves the upload strategy strategy to the preferences.
static UploadStrategy valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static UploadStrategy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

INDIVIDUAL_OBJECTS_STRATEGY

public static final UploadStrategy INDIVIDUAL_OBJECTS_STRATEGY
Uploads the objects individually, one request per object


CHUNKED_DATASET_STRATEGY

public static final UploadStrategy CHUNKED_DATASET_STRATEGY
Upload the objects in junks of n objects using m diff uploads


SINGLE_REQUEST_STRATEGY

public static final UploadStrategy SINGLE_REQUEST_STRATEGY
Upload the objects in one request using 1 diff upload

Field Detail

preferenceValue

private java.lang.String preferenceValue

DEFAULT_UPLOAD_STRATEGY

public static final UploadStrategy DEFAULT_UPLOAD_STRATEGY
the default upload strategy

Method Detail

values

public static UploadStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (UploadStrategy c : UploadStrategy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static UploadStrategy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

fromPreference

public static UploadStrategy fromPreference(java.lang.String preferenceValue)

getPreferenceValue

public java.lang.String getPreferenceValue()
Replies the value which is written to the preferences for a specific upload strategy

Returns:
the value which is written to the preferences for a specific upload strategy

getFromPreferences

public static UploadStrategy getFromPreferences()
Replies the upload strategy currently configured in the preferences. First checks for the preference key
osm-server.upload-strategy
. If not present, checks for the legacy preference key
osm-server.atomic-upload
. If both are missing or if the preference value is illegal, DEFAULT_UPLOAD_STRATEGY is replied.

Returns:
the upload strategy currently configured in the preferences.

saveToPreferences

public static void saveToPreferences(UploadStrategy strategy)
Saves the upload strategy strategy to the preferences.

Parameters:
strategy - the strategy to save


JOSM