Class RemoteControl
- java.lang.Object
-
- org.openstreetmap.josm.io.remotecontrol.RemoteControl
-
public class RemoteControl extends java.lang.Object
Manager class for remote control operations. IMPORTANT! increment the minor version on compatible API extensions and increment the major version and set minor to 0 on incompatible changes.
-
-
Field Summary
Fields Modifier and Type Field Description static BooleanProperty
PROP_REMOTECONTROL_ENABLED
If the remote control feature is enabled or disabled.(package private) static int
protocolMajorVersion
RemoteControl HTTP protocol version.(package private) static int
protocolMinorVersion
-
Constructor Summary
Constructors Constructor Description RemoteControl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRequestHandler(java.lang.String command, java.lang.Class<? extends RequestHandler> handlerClass)
Adds external request handler.static java.net.InetAddress
getInet4Address()
Returns the IPv4 address used for remote control.static java.net.InetAddress
getInet6Address()
Returns the IPv6 address used for remote control.static java.lang.String
getRemoteControlDir()
Returns the remote control directory.static java.lang.String
getVersion()
Returns the RemoteControl HTTP protocol versionstatic void
start()
Starts the remote control serverstatic void
stop()
Stops the remote control server
-
-
-
Field Detail
-
PROP_REMOTECONTROL_ENABLED
public static final BooleanProperty PROP_REMOTECONTROL_ENABLED
If the remote control feature is enabled or disabled. If disabled, it should not start the server.
-
protocolMajorVersion
static final int protocolMajorVersion
RemoteControl HTTP protocol version. Change minor number for compatible interface extensions. Change major number in case of incompatible changes.- See Also:
- Constant Field Values
-
protocolMinorVersion
static final int protocolMinorVersion
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RemoteControl
public RemoteControl()
-
-
Method Detail
-
start
public static void start()
Starts the remote control server
-
stop
public static void stop()
Stops the remote control server- Since:
- 5861
-
addRequestHandler
public void addRequestHandler(java.lang.String command, java.lang.Class<? extends RequestHandler> handlerClass)
Adds external request handler. Can be used by plugins that want to use remote control.- Parameters:
command
- The command name.handlerClass
- The additional request handler.
-
getRemoteControlDir
public static java.lang.String getRemoteControlDir()
Returns the remote control directory.- Returns:
- The remote control directory
- Since:
- 7335
-
getInet6Address
public static java.net.InetAddress getInet6Address() throws java.net.UnknownHostException
Returns the IPv6 address used for remote control.- Returns:
- the IPv6 address used for remote control
- Throws:
java.net.UnknownHostException
- if the local host name could not be resolved into an address.- Since:
- 8337
-
getInet4Address
public static java.net.InetAddress getInet4Address() throws java.net.UnknownHostException
Returns the IPv4 address used for remote control.- Returns:
- the IPv4 address used for remote control
- Throws:
java.net.UnknownHostException
- if the local host name could not be resolved into an address.- Since:
- 8337
-
getVersion
public static java.lang.String getVersion()
Returns the RemoteControl HTTP protocol version- Returns:
- the RemoteControl HTTP protocol version
-
-