Package org.openstreetmap.josm.io
Class MessageNotifier
java.lang.Object
org.openstreetmap.josm.io.MessageNotifier
Notifies user periodically of new received (unread) messages
- Since:
- 6349
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCalled when new new messages are detected.private static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static MessageNotifier.NotifierCallbackprivate static final ScheduledExecutorServicestatic final IntegerPropertyProperty defining the update interval in minutesstatic final BooleanPropertyProperty defining if this task is enabled or notprivate static ScheduledFuture<?>private static final Runnable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanDetermines if the message notifier is currently runningstatic booleanDetermines if user set enough information in JOSM preferences to make the request to OSM API without prompting him for a password.static voidsetNotifierCallback(MessageNotifier.NotifierCallback notifierCallback) Sets theMessageNotifier.NotifierCallbackresponsible of notifying the user when new messages are received.static voidstart()Starts the message notifier task if not already started and if user is fully identifiedstatic voidstop()Stops the message notifier task if started
-
Field Details
-
callback
-
PROP_NOTIFIER_ENABLED
Property defining if this task is enabled or not -
PROP_INTERVAL
Property defining the update interval in minutes -
EXECUTOR
-
WORKER
-
task
-
-
Constructor Details
-
MessageNotifier
private MessageNotifier()
-
-
Method Details
-
setNotifierCallback
Sets theMessageNotifier.NotifierCallbackresponsible of notifying the user when new messages are received.- Parameters:
notifierCallback- the newNotifierCallback
-
start
Starts the message notifier task if not already started and if user is fully identified -
stop
Stops the message notifier task if started -
isRunning
Determines if the message notifier is currently running- Returns:
trueif the notifier is running,falseotherwise
-
isUserEnoughIdentified
Determines if user set enough information in JOSM preferences to make the request to OSM API without prompting him for a password.- Returns:
trueif user chose an OAuth token or supplied both its username and password,false otherwise
-