Class LongRunningTaskMovePageCommandDecorator
java.lang.Object
com.atlassian.core.task.longrunning.AbstractLongRunningTask
com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask
com.atlassian.confluence.content.service.page.LongRunningTaskMovePageCommandDecorator
- All Implemented Interfaces:
- MovePageCommand,- ServiceCommand,- com.atlassian.core.task.longrunning.LongRunningTask,- Runnable
public class LongRunningTaskMovePageCommandDecorator
extends ConfluenceAbstractLongRunningTask
implements MovePageCommand
A Decorator for existing MovePageCommands to be run synchronously as a LongRunningTask.
- Since:
- 7.9
- 
Field SummaryFields inherited from class com.atlassian.core.task.longrunning.AbstractLongRunningTasklog, METRIC_NAME, progress, TASK_CLASSNAME_TAG, TASK_NAME_TAGFields inherited from interface com.atlassian.confluence.content.service.page.MovePageCommandPOSITION_ABOVE, POSITION_APPEND, POSITION_BELOW, POSITION_TOP_LEVEL
- 
Constructor SummaryConstructorsConstructorDescriptionLongRunningTaskMovePageCommandDecorator(MovePageCommand commandDelegate, LongRunningTaskManagerInternal longRunningTaskManager) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidexecute()Execute the command.getName()getPage()com.atlassian.core.util.ProgressMeterGets the list of errors that are preventing the command from being executed.booleanDetermine if the current user is authorized to execute this command.booleanisValid()Determine if the command is in a valid state to be executed.protected voidRun the long running process.Methods inherited from class com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTaskgetResourceBundle, runMethods inherited from class com.atlassian.core.task.longrunning.AbstractLongRunningTaskgetCurrentStatus, getElapsedTime, getEstimatedTimeRemaining, getNameKey, getPercentageComplete, getPrettyElapsedTime, getPrettyTimeRemaining, isComplete, isSuccessful, stopTimer
- 
Constructor Details- 
LongRunningTaskMovePageCommandDecoratorpublic LongRunningTaskMovePageCommandDecorator(MovePageCommand commandDelegate, LongRunningTaskManagerInternal longRunningTaskManager) 
 
- 
- 
Method Details- 
getCommandDelegate
- 
getPage- Specified by:
- getPagein interface- MovePageCommand
- Returns:
- the page which will be moved (or which has been moved, if the command has been executed)
 
- 
getProgressMeterpublic com.atlassian.core.util.ProgressMeter getProgressMeter()- Specified by:
- getProgressMeterin interface- MovePageCommand
 
- 
isValidpublic boolean isValid()Description copied from interface:ServiceCommandDetermine if the command is in a valid state to be executed. If this method returns true, thenServiceCommand.execute()is be expected to perform successfully (unless prevented by some system error). If this method returns false,executewill fail with aNotValidException.This method should be called after checking ServiceCommand.isAuthorized(). If the current user is not authorized to execute this command, this method must throw aNotAuthorizedException.If this method returns false, then ServiceCommand.getValidationErrors()must return a non-empty list of errors explaining why the command was not valid. If this method returns true, the collection returned bygetValidationErrors()must be empty.- Specified by:
- isValidin interface- ServiceCommand
- Returns:
- true if the command is in a valid state to be executed, false otherwise
 
- 
getValidationErrorsDescription copied from interface:ServiceCommandGets the list of errors that are preventing the command from being executed. Calling this method before callingServiceCommand.isValid()will always return an empty collection.- Specified by:
- getValidationErrorsin interface- ServiceCommand
- Returns:
- a collection of ValidationErrorobjects describing why command validation failed
 
- 
isAuthorizedpublic boolean isAuthorized()Description copied from interface:ServiceCommandDetermine if the current user is authorized to execute this command. The "current user" for a command is the user returned byAuthenticatedUserThreadLocal.get().- Specified by:
- isAuthorizedin interface- ServiceCommand
- Returns:
- true if the current user is authorized to execute this command, false otherwise.
 
- 
runInternal@Transactional(propagation=REQUIRES_NEW) protected void runInternal()Description copied from class:ConfluenceAbstractLongRunningTaskRun the long running process. When this method exits, the process should be complete.- Specified by:
- runInternalin class- ConfluenceAbstractLongRunningTask
 
- 
executepublic void execute()Description copied from interface:ServiceCommandExecute the command. After execution, the command should offer any indication of the results or products of the command as implementation-specific getter methods.- Specified by:
- executein interface- ServiceCommand
 
- 
getName- Specified by:
- getNamein interface- com.atlassian.core.task.longrunning.LongRunningTask
 
- 
getLongTaskId
 
-