Subject: [PATCH] Add the ability to know the OSM server via Remote Control
---
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/core/src/org/openstreetmap/josm/io/remotecontrol/handler/VersionHandler.java b/core/src/org/openstreetmap/josm/io/remotecontrol/handler/VersionHandler.java
|
a
|
b
|
|
| 19 | 19 | @Override |
| 20 | 20 | protected void handleRequest() throws RequestHandlerErrorException, |
| 21 | 21 | RequestHandlerBadRequestException { |
| 22 | | content = RequestProcessor.PROTOCOLVERSION; |
| | 22 | content = RequestProcessor.getProtocolVersion(); |
| 23 | 23 | contentType = "application/json"; |
| 24 | 24 | if (args.containsKey("jsonp")) { |
| 25 | 25 | content = args.get("jsonp") + " && " + args.get("jsonp") + '(' + content + ')'; |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/core/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java b/core/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java
|
a
|
b
|
|
| 31 | 31 | * changes. |
| 32 | 32 | */ |
| 33 | 33 | static final int protocolMajorVersion = 1; |
| 34 | | static final int protocolMinorVersion = 12; |
| | 34 | static final int protocolMinorVersion = 13; |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * Starts the remote control server |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/core/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java b/core/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
|
a
|
b
|
|
| 29 | 29 | |
| 30 | 30 | import org.openstreetmap.josm.data.Version; |
| 31 | 31 | import org.openstreetmap.josm.gui.help.HelpUtil; |
| | 32 | import org.openstreetmap.josm.io.OsmApi; |
| 32 | 33 | import org.openstreetmap.josm.io.remotecontrol.handler.AddNodeHandler; |
| 33 | 34 | import org.openstreetmap.josm.io.remotecontrol.handler.AddWayHandler; |
| 34 | 35 | import org.openstreetmap.josm.io.remotecontrol.handler.AuthorizationHandler; |
| … |
… |
|
| 71 | 72 | * interface extensions. Change major number in case of incompatible |
| 72 | 73 | * changes. |
| 73 | 74 | */ |
| 74 | | public static final String PROTOCOLVERSION = Json.createObjectBuilder() |
| 75 | | .add("protocolversion", Json.createObjectBuilder() |
| 76 | | .add("major", RemoteControl.protocolMajorVersion) |
| 77 | | .add("minor", RemoteControl.protocolMinorVersion)) |
| 78 | | .add("application", JOSM_REMOTE_CONTROL) |
| 79 | | .add("version", Version.getInstance().getVersion()) |
| 80 | | .build().toString(); |
| | 75 | public static String getProtocolVersion() { |
| | 76 | return Json.createObjectBuilder() |
| | 77 | .add("protocolversion", Json.createObjectBuilder() |
| | 78 | .add("major", RemoteControl.protocolMajorVersion) |
| | 79 | .add("minor", RemoteControl.protocolMinorVersion)) |
| | 80 | .add("application", JOSM_REMOTE_CONTROL) |
| | 81 | .add("version", Version.getInstance().getVersion()) |
| | 82 | .add("osm_server_url", OsmApi.getOsmApi().getServerUrl()) |
| | 83 | .build().toString(); |
| | 84 | } |
| 81 | 85 | |
| 82 | 86 | /** The socket this processor listens on */ |
| 83 | 87 | private final Socket request; |