public class AddWayHandler extends RequestHandler
/add_way?way=lat1,lon2;lat2,lon2.RequestHandler.PermissionCache, RequestHandler.RawURLParseRequestHandler, RequestHandler.RequestHandlerBadRequestException, RequestHandler.RequestHandlerErrorException, RequestHandler.RequestHandlerException, RequestHandler.RequestHandlerForbiddenException| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<LatLon,Node> |
addedNodes
The place to remember already added nodes (they are reused if needed @since 5845
|
private java.util.List<LatLon> |
allCoordinates |
static java.lang.String |
command
The remote control command name used to add a way.
|
private Way |
way |
args, content, contentType, globalConfirmationDefault, globalConfirmationKey, loadInNewLayerDefault, loadInNewLayerKey, myCommand, PERMISSIONS, request, sender, SPLITTER_COMMA, SPLITTER_SEMIC| Constructor and Description |
|---|
AddWayHandler() |
| Modifier and Type | Method and Description |
|---|---|
private Way |
addWay() |
(package private) Node |
findOrCreateNode(LatLon ll,
java.util.List<Command> commands)
Find the node with almost the same coords in dataset or in already added nodes
|
java.lang.String[] |
getMandatoryParams() |
java.lang.String[] |
getOptionalParams() |
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.
|
java.lang.String |
getUsage() |
java.lang.String[] |
getUsageExamples() |
protected void |
handleRequest()
Handle a specific command sent as remote control.
|
protected void |
validateRequest()
Validates the request before attempting to perform it.
|
checkMandatoryParams, checkPermission, getContent, getContentType, getDownloadParams, getRequestParameter, getUsageExamples, handle, parseArgs, setCommand, setSender, setUrl, splitArg, validateDownloadParamspublic static final java.lang.String command
private final java.util.List<LatLon> allCoordinates
private java.util.Map<LatLon,Node> addedNodes
public AddWayHandler()
public java.lang.String[] getMandatoryParams()
getMandatoryParams in class RequestHandlerpublic java.lang.String[] getOptionalParams()
getOptionalParams in class RequestHandlerpublic java.lang.String getUsage()
getUsage in class RequestHandlerpublic java.lang.String[] getUsageExamples()
getUsageExamples in class RequestHandlerprotected void handleRequest() throws RequestHandler.RequestHandlerErrorException, RequestHandler.RequestHandlerBadRequestException
RequestHandlerhandleRequest in class RequestHandlerRequestHandler.RequestHandlerErrorException - if an error occurs while processing requestRequestHandler.RequestHandlerBadRequestException - if request is invalidpublic java.lang.String getPermissionMessage()
RequestHandlergetPermissionMessage in class RequestHandlerpublic PermissionPrefWithDefault getPermissionPref()
RequestHandlergetPermissionPref in class RequestHandlerprotected void validateRequest() throws RequestHandler.RequestHandlerBadRequestException
RequestHandlervalidateRequest in class RequestHandlerRequestHandler.RequestHandlerBadRequestException - if request is invalidNode findOrCreateNode(LatLon ll, java.util.List<Command> commands)
ll - coordinatescommands - list of commands that will be modified if needed