Class LoadObjectHandler
java.lang.Object
org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler
org.openstreetmap.josm.io.remotecontrol.handler.LoadObjectHandler
Loads OSM primitives using their ID
similar to the "Download object" dialog (@see DownloadPrimitiveAction}.
For instance,
/load_object?objects=n1,w2,r3[&new_layer=false&relation_members=true].-
Nested Class Summary
Nested classes/interfaces inherited from class org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler
RequestHandler.PermissionCache, RequestHandler.RawURLParseRequestHandler, RequestHandler.RequestHandlerBadRequestException, RequestHandler.RequestHandlerErrorException, RequestHandler.RequestHandlerException, RequestHandler.RequestHandlerForbiddenException, RequestHandler.RequestHandlerOsmApiException -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe remote control command name used to load objects using their ID.private final List<PrimitiveId>Fields inherited from class org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler
args, content, contentType, GLOBAL_CONFIRMATION, LOAD_IN_NEW_LAYER, myCommand, OSM_DOWNLOAD_TIMEOUT, PERMISSIONS, request, sender, SPLITTER_COMMA, SPLITTER_SEMIC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]Returns the mandatory parameters.String[]Returns the optional parameters.Get a specific message to ask the user for permission for the operation requested via remote control.Get a PermissionPref object containing the name of a special permission preference to individually allow the requested operation and an error message to be displayed when a disabled operation is requested.getUsage()Returns usage description, for bad requests and documentation.String[]Returns usage examples, for bad requests and documentation.protected voidHandle a specific command sent as remote control.protected voidValidates the request before attempting to perform it.Methods inherited from class org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler
checkMandatoryParams, checkPermission, getCommand, getContent, getContentType, getDownloadParams, getRequestParameter, getUsageExamples, handle, parseArgs, setCommand, setSender, setUrl, splitArg, validateDownloadParams
-
Field Details
-
command
The remote control command name used to load objects using their ID.- See Also:
-
ps
-
-
Constructor Details
-
LoadObjectHandler
public LoadObjectHandler()
-
-
Method Details
-
getMandatoryParams
Description copied from class:RequestHandlerReturns the mandatory parameters. Both used to enforce their presence at runtime and for documentation.- Specified by:
getMandatoryParamsin classRequestHandler- Returns:
- the mandatory parameters
-
getOptionalParams
Description copied from class:RequestHandlerReturns the optional parameters. Both used to enforce their presence at runtime and for documentation.- Overrides:
getOptionalParamsin classRequestHandler- Returns:
- the optional parameters
-
getUsage
Description copied from class:RequestHandlerReturns usage description, for bad requests and documentation.- Overrides:
getUsagein classRequestHandler- Returns:
- usage description
-
getUsageExamples
Description copied from class:RequestHandlerReturns usage examples, for bad requests and documentation.- Overrides:
getUsageExamplesin classRequestHandler- Returns:
- Usage examples
-
handleRequest
protected void handleRequest() throws RequestHandler.RequestHandlerErrorException, RequestHandler.RequestHandlerBadRequestExceptionDescription copied from class:RequestHandlerHandle a specific command sent as remote control. Any time-consuming operation must be performed asynchronously to avoid delaying the HTTP response.This method of the subclass will do the real work.
- Specified by:
handleRequestin classRequestHandler- Throws:
RequestHandler.RequestHandlerErrorException- if an error occurs while processing requestRequestHandler.RequestHandlerBadRequestException- if request is invalid
-
getPermissionMessage
Description copied from class:RequestHandlerGet a specific message to ask the user for permission for the operation requested via remote control.This message will be displayed to the user if the preference remotecontrol.always-confirm is true.
- Specified by:
getPermissionMessagein classRequestHandler- Returns:
- the message
-
getPermissionPref
Description copied from class:RequestHandlerGet a PermissionPref object containing the name of a special permission preference to individually allow the requested operation and an error message to be displayed when a disabled operation is requested.Default is not to check any special preference. Override this in a subclass to define permission preference and error message.
- Specified by:
getPermissionPrefin classRequestHandler- Returns:
- the preference name and error message or null
-
validateRequest
Description copied from class:RequestHandlerValidates the request before attempting to perform it.- Specified by:
validateRequestin classRequestHandler- Throws:
RequestHandler.RequestHandlerBadRequestException- if request is invalid
-