Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
Context |
build()
Returns the completed
Context . |
Context.Builder |
event(com.atlassian.johnson.event.Event event)
A global
atlassian-johnson event that will be used to block access to the application. |
Context.Builder |
log(org.apache.log4j.Logger log,
String format)
A convenience method that calls assumes
DEBUG logging. |
Context.Builder |
log(org.apache.log4j.Logger log,
String format,
org.apache.log4j.Level level)
Provides a logger to which progress will be logged at the specified level.
|
Context.Builder |
progress(TaskProgressSink progressSink,
I18nHelper i18n,
String uiMessageKeyPercentage,
String uiMessageKeyCurrent)
Uses the specified
TaskProgressSink , using the provided I18nHelper to supply translated
messages about the task. |
Context.Builder |
progressPercentage(TaskProgressSink progressSink,
I18nHelper i18n,
String uiMessageKeyPercentage)
Uses the specified
TaskProgressSink , using the provided I18nHelper to supply translated
messages about the task. |
Context.Builder |
progressSubTask(TaskProgressSink progressSink,
I18nHelper i18n,
String uiMessageKeyCurrent)
Uses the specified
TaskProgressSink , using the provided I18nHelper to supply translated
messages about the task. |
Context.Builder |
sized(Sized sized)
Something that can provide an estimate of the amount of work that the background task will perform.
|
public Context.Builder sized(@Nonnull Sized sized)
If this method is invoked multiple times, only the last value supplied will be used.
sized
- whatever is providing an estimate for the amount of workthis
FixedSized
,
CollectionEnclosedIterable
public Context.Builder event(@Nonnull com.atlassian.johnson.event.Event event)
atlassian-johnson
event that will be used to block access to the application.
Some activities, like restoring from a backup file, require blocking all access to JIRA. This passes progress information on to this event when it is supplied to the builder.
event
- the global atlassian-johnson
eventthis
public Context.Builder log(@Nonnull org.apache.log4j.Logger log, @Nonnull String format)
DEBUG
logging.
It is exactly equivalent to log(log, format, Level.DEBUG)
.log
- as for log(org.apache.log4j.Logger, String, org.apache.log4j.Level)
format
- as for log(org.apache.log4j.Logger, String, org.apache.log4j.Level)
this
public Context.Builder log(@Nonnull org.apache.log4j.Logger log, @Nonnull String format, @Nonnull org.apache.log4j.Level level)
log
- the logger to which progress messages will be loggedformat
- a message format string, such as for String.format(String, Object...)
. It will
be called with a single argument that represents the progress percentage; a number between
0
and 100
, inclusive.level
- the logging level to usethis
public Context.Builder progress(@Nonnull TaskProgressSink progressSink, @Nonnull I18nHelper i18n, @Nonnull String uiMessageKeyPercentage, @Nullable String uiMessageKeyCurrent)
TaskProgressSink
, using the provided I18nHelper
to supply translated
messages about the task.progressSink
- the delegate TaskProgressSink
to which translated messages are relayedi18n
- the I18N helper for formatting the progress messagesuiMessageKeyPercentage
- the message key for messages about the progressuiMessageKeyCurrent
- the message key for messages about the current subtaskthis
public Context.Builder progressPercentage(@Nonnull TaskProgressSink progressSink, @Nonnull I18nHelper i18n, @Nullable String uiMessageKeyPercentage)
TaskProgressSink
, using the provided I18nHelper
to supply translated
messages about the task.progressSink
- the delegate TaskProgressSink
to which translated messages are relayedi18n
- the I18N helper for formatting the progress messagesuiMessageKeyPercentage
- the message key for messages about the progressthis
public Context.Builder progressSubTask(@Nonnull TaskProgressSink progressSink, @Nonnull I18nHelper i18n, @Nullable String uiMessageKeyCurrent)
TaskProgressSink
, using the provided I18nHelper
to supply translated
messages about the task.progressSink
- the delegate TaskProgressSink
to which translated messages are relayedi18n
- the I18N helper for formatting the progress messagesuiMessageKeyCurrent
- the message key for messages about the current subtaskthis
public Context build()
Context
.Context
.Copyright © 2002-2019 Atlassian. All Rights Reserved.