public final class MessageNotifier extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
MessageNotifier.NotifierCallback
Called when new new messages are detected.
|
private static class |
MessageNotifier.Worker |
Modifier and Type | Field and Description |
---|---|
private static MessageNotifier.NotifierCallback |
callback |
private static java.util.concurrent.ScheduledExecutorService |
EXECUTOR |
static IntegerProperty |
PROP_INTERVAL
Property defining the update interval in minutes
|
static BooleanProperty |
PROP_NOTIFIER_ENABLED
Property defining if this task is enabled or not
|
private static java.util.concurrent.ScheduledFuture<?> |
task |
private static java.lang.Runnable |
WORKER |
Modifier | Constructor and Description |
---|---|
private |
MessageNotifier() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isRunning()
Determines if the message notifier is currently running
|
static boolean |
isUserEnoughIdentified()
Determines if user set enough information in JOSM preferences to make the request to OSM API without
prompting him for a password.
|
static void |
setNotifierCallback(MessageNotifier.NotifierCallback notifierCallback)
Sets the
MessageNotifier.NotifierCallback responsible of notifying the user when new messages are received. |
static void |
start()
Starts the message notifier task if not already started and if user is fully identified
|
static void |
stop()
Stops the message notifier task if started
|
private static volatile MessageNotifier.NotifierCallback callback
public static final BooleanProperty PROP_NOTIFIER_ENABLED
public static final IntegerProperty PROP_INTERVAL
private static final java.util.concurrent.ScheduledExecutorService EXECUTOR
private static final java.lang.Runnable WORKER
private static volatile java.util.concurrent.ScheduledFuture<?> task
private MessageNotifier()
public static void setNotifierCallback(MessageNotifier.NotifierCallback notifierCallback)
MessageNotifier.NotifierCallback
responsible of notifying the user when new messages are received.notifierCallback
- the new NotifierCallback
public static void start()
public static void stop()
public static boolean isRunning()
true
if the notifier is running, false
otherwisepublic static boolean isUserEnoughIdentified()
true
if user chose an OAuth token or supplied both its username and password, false otherwise