public abstract class BaseBackgroundTaskDisplay extends Object implements BackgroundTaskDisplay
Modifier and Type | Field and Description |
---|---|
protected BackgroundTask |
backgroundTask |
protected BackgroundTaskStatus |
backgroundTaskStatus |
protected static int |
PERCENTAGE_MAX |
protected static int |
PERCENTAGE_MIN |
protected static int |
PERCENTAGE_NONE |
Constructor and Description |
---|
BaseBackgroundTaskDisplay(BackgroundTask backgroundTask) |
Modifier and Type | Method and Description |
---|---|
protected long |
getBackgroundTaskStatusAttributeLong(String attributeKey) |
protected String |
getBackgroundTaskStatusAttributeString(String attributeKey) |
abstract int |
getPercentage() |
int |
getStatus() |
String |
getStatusLabel() |
String |
getStatusLabel(Locale locale) |
protected JSONObject |
getStatusMessageJSONObject(Locale locale) |
protected abstract TemplateResource |
getTemplateResource() |
protected abstract Map<String,Object> |
getTemplateVars() |
protected boolean |
hasBackgroundTaskStatus() |
boolean |
hasPercentage() |
String |
renderDisplayTemplate() |
String |
renderDisplayTemplate(Locale locale) |
protected JSONArray |
translateJSON(JSONArray jsonArray,
Locale locale) |
protected JSONObject |
translateJSON(JSONObject jsonObject,
Locale locale) |
protected static final int PERCENTAGE_MAX
protected static final int PERCENTAGE_MIN
protected static final int PERCENTAGE_NONE
protected final BackgroundTask backgroundTask
protected final BackgroundTaskStatus backgroundTaskStatus
public BaseBackgroundTaskDisplay(BackgroundTask backgroundTask)
public abstract int getPercentage()
getPercentage
in interface BackgroundTaskDisplay
public int getStatus()
getStatus
in interface BackgroundTaskDisplay
public String getStatusLabel()
getStatusLabel
in interface BackgroundTaskDisplay
public String getStatusLabel(Locale locale)
getStatusLabel
in interface BackgroundTaskDisplay
public boolean hasPercentage()
hasPercentage
in interface BackgroundTaskDisplay
public String renderDisplayTemplate()
renderDisplayTemplate
in interface BackgroundTaskDisplay
public String renderDisplayTemplate(Locale locale)
renderDisplayTemplate
in interface BackgroundTaskDisplay
protected long getBackgroundTaskStatusAttributeLong(String attributeKey)
protected String getBackgroundTaskStatusAttributeString(String attributeKey)
protected JSONObject getStatusMessageJSONObject(Locale locale)
protected abstract TemplateResource getTemplateResource()
protected abstract Map<String,Object> getTemplateVars()
protected boolean hasBackgroundTaskStatus()
protected JSONObject translateJSON(JSONObject jsonObject, Locale locale)