Package net.solarnetwork.node.runtime
Class SimplePlatformTaskInfo
java.lang.Object
net.solarnetwork.node.runtime.SimplePlatformTaskInfo
- All Implemented Interfaces:
PlatformService.PlatformTaskInfo
Simple implementation of
PlatformService.PlatformTaskInfo.- Version:
- 1.0
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionSimplePlatformTaskInfo(String taskId, String title, String message, double percentComplete, boolean complete, boolean restartRequired) Construct from values.SimplePlatformTaskInfo(PlatformService.PlatformTaskStatus status, Locale locale) Construct from a status and locale. -
Method Summary
Modifier and TypeMethodDescriptionGet a message describing what the task is currently doing.doubleGet the amount of work that has been completed, as a fractional percentage between 0 and 1.Get a unique task ID for this task.getTitle()Get a title of this task.booleanGet a flag that indicates if the task is complete.booleanGet a flag that indicates if a system restart is required after the task completes.
-
Constructor Details
-
SimplePlatformTaskInfo
public SimplePlatformTaskInfo(String taskId, String title, String message, double percentComplete, boolean complete, boolean restartRequired) Construct from values.- Parameters:
taskId- the task IDtitle- the titlemessage- the messagepercentComplete- the percent completecomplete- true if the task is completerestartRequired- the restart required flag
-
SimplePlatformTaskInfo
Construct from a status and locale.- Parameters:
status- the statuslocale- the desired locale
-
-
Method Details
-
getTaskId
Description copied from interface:PlatformService.PlatformTaskInfoGet a unique task ID for this task.- Specified by:
getTaskIdin interfacePlatformService.PlatformTaskInfo- Returns:
- the unique ID
-
getTitle
Description copied from interface:PlatformService.PlatformTaskInfoGet a title of this task.- Specified by:
getTitlein interfacePlatformService.PlatformTaskInfo- Returns:
- the title
-
getMessage
Description copied from interface:PlatformService.PlatformTaskInfoGet a message describing what the task is currently doing.- Specified by:
getMessagein interfacePlatformService.PlatformTaskInfo- Returns:
- the message
-
getPercentComplete
public double getPercentComplete()Description copied from interface:PlatformService.PlatformTaskInfoGet the amount of work that has been completed, as a fractional percentage between 0 and 1.- Specified by:
getPercentCompletein interfacePlatformService.PlatformTaskInfo- Returns:
- the amount of work completed, or anything < 0 if not known
-
isComplete
public boolean isComplete()Description copied from interface:PlatformService.PlatformTaskInfoGet a flag that indicates if the task is complete.- Specified by:
isCompletein interfacePlatformService.PlatformTaskInfo- Returns:
- the complete flag
-
isRestartRequired
public boolean isRestartRequired()Description copied from interface:PlatformService.PlatformTaskInfoGet a flag that indicates if a system restart is required after the task completes.- Specified by:
isRestartRequiredin interfacePlatformService.PlatformTaskInfo- Returns:
- a restart required flag
-