source: josm/trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java@ 6941

Last change on this file since 6941 was 6941, checked in by Don-vip, 10 years ago

fix #9720 - Remote control: listen also in HTTPS

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.io.remotecontrol;
3
4import org.openstreetmap.josm.data.preferences.BooleanProperty;
5import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler;
6
7/**
8 * Manager class for remote control operations.
9 *
10 * IMPORTANT! increment the minor version on compatible API extensions
11 * and increment the major version and set minor to 0 on incompatible changes.
12 */
13public class RemoteControl
14{
15 /**
16 * If the remote control feature is enabled or disabled. If disabled,
17 * it should not start the server.
18 */
19 public static final BooleanProperty PROP_REMOTECONTROL_ENABLED = new BooleanProperty("remotecontrol.enabled", false);
20
21 /**
22 * RemoteControl HTTP protocol version. Change minor number for compatible
23 * interface extensions. Change major number in case of incompatible
24 * changes.
25 */
26 static final int protocolMajorVersion = 1;
27 static final int protocolMinorVersion = 5;
28
29 /**
30 * Starts the remote control server
31 */
32 public static void start() {
33 RemoteControlHttpServer.restartRemoteControlHttpServer();
34 RemoteControlHttpsServer.restartRemoteControlHttpsServer();
35 }
36
37 /**
38 * Stops the remote control server
39 * @since 5861
40 */
41 public static void stop() {
42 RemoteControlHttpServer.stopRemoteControlHttpServer();
43 RemoteControlHttpsServer.stopRemoteControlHttpsServer();
44 }
45
46 /**
47 * Adds external request handler.
48 * Can be used by plugins that want to use remote control.
49 *
50 * @param command The command name.
51 * @param handlerClass The additional request handler.
52 */
53 public void addRequestHandler(String command, Class<? extends RequestHandler> handlerClass) {
54 RequestProcessor.addRequestHandlerClass(command, handlerClass);
55 }
56}
Note: See TracBrowser for help on using the repository browser.