org.openstreetmap.josm.io.remotecontrol.handler
Class ImageryHandler

java.lang.Object
  extended by org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler
      extended by org.openstreetmap.josm.io.remotecontrol.handler.ImageryHandler

public class ImageryHandler
extends RequestHandler

Adds an imagery (WMS/TMS) layer. For instance, /imagery?title=...&type=...&url=....

Since:
3715

Nested Class Summary
 
Nested classes/interfaces inherited from class org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler
RequestHandler.RequestHandlerBadRequestException, RequestHandler.RequestHandlerErrorException, RequestHandler.RequestHandlerException, RequestHandler.RequestHandlerForbiddenException
 
Field Summary
static java.lang.String command
          The remote control command name used to add an imagery layer.
 
Fields inherited from class org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler
args, content, contentType, globalConfirmationDefault, globalConfirmationKey, loadInNewLayerDefault, loadInNewLayerKey, myCommand, request
 
Constructor Summary
ImageryHandler()
           
 
Method Summary
private  java.lang.String decodeParam(java.lang.String param)
           
 java.lang.String[] getMandatoryParams()
           
 java.lang.String getPermissionMessage()
          Get a specific message to ask the user for permission for the operation requested via remote control.
 PermissionPrefWithDefault getPermissionPref()
          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.
protected  void handleRequest()
          Handle a specific command sent as remote control.
protected  void parseArgs()
          Parse the request parameters as key=value pairs.
 
Methods inherited from class org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler
checkMandatoryParams, checkPermission, getContent, getContentType, handle, isLoadInNewLayer, setCommand, setUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

command

public static final java.lang.String command
The remote control command name used to add an imagery layer.

See Also:
Constant Field Values
Constructor Detail

ImageryHandler

public ImageryHandler()
Method Detail

getPermissionMessage

public java.lang.String getPermissionMessage()
Description copied from class: RequestHandler
Get 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:
getPermissionMessage in class RequestHandler
Returns:
the message

getMandatoryParams

public java.lang.String[] getMandatoryParams()
Specified by:
getMandatoryParams in class RequestHandler

getPermissionPref

public PermissionPrefWithDefault getPermissionPref()
Description copied from class: RequestHandler
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. Default is not to check any special preference. Override this in a subclass to define permission preference and error message.

Specified by:
getPermissionPref in class RequestHandler
Returns:
the preference name and error message or null

handleRequest

protected void handleRequest()
                      throws RequestHandler.RequestHandlerErrorException
Description copied from class: RequestHandler
Handle a specific command sent as remote control. This method of the subclass will do the real work.

Specified by:
handleRequest in class RequestHandler
Throws:
RequestHandler.RequestHandlerErrorException

parseArgs

protected void parseArgs()
Description copied from class: RequestHandler
Parse the request parameters as key=value pairs. The result will be stored in this.args. Can be overridden by subclass.

Overrides:
parseArgs in class RequestHandler

decodeParam

private java.lang.String decodeParam(java.lang.String param)


JOSM