Class UserNameChangePluginPointsOperationStep
java.lang.Object
com.atlassian.jira.user.anonymize.operations.UserNameChangePluginPointsOperationStep
- All Implemented Interfaces:
AnonymizeOperationStep
,StepWithPluginPointInvocations
public class UserNameChangePluginPointsOperationStep
extends Object
implements AnonymizeOperationStep, StepWithPluginPointInvocations
-
Constructor Summary
ConstructorsConstructorDescriptionUserNameChangePluginPointsOperationStep
(UserNameChangeService userNameChangeService) -
Method Summary
Modifier and TypeMethodDescriptiongetAffectedEntities
(AnonymizeUserService.AnonymizeProcessData anonymizationData) Gets affected entities for this action.Type of operation this handler supports.int
getNumberOfTasks
(AnonymizeUserService.AnonymizeValidationResult validationResult) Returns number of tasks/stages to be executed as part of this anonymization step.performOperation
(AnonymizeUserService.OperationsReport<Void> anonymizeReport, AnonymizeUserService.AnonymizeValidationResult validationResult, Context asyncTaskContext) Performs operations only if all proper parameters are filled in passed parameters.validate
(AnonymizeUserService.AnonymizeProcessData anonymizationData, I18nHelper i18nHelper, boolean preValidate) Validate should ensure that request and anonymizationProcessData contain all data needed toAnonymizeOperationStep.performOperation(OperationsReport, AnonymizeValidationResult, Context)
.validateBusinessLogic
(AnonymizationParameters anonymizationParameters) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.jira.user.anonymize.operations.AnonymizeOperationStep
shouldPerformOperation
-
Constructor Details
-
UserNameChangePluginPointsOperationStep
-
-
Method Details
-
performOperation
@Nonnull public Optional<AnonymizeUserService.SingleOperationReport<Void>> performOperation(@Nonnull AnonymizeUserService.OperationsReport<Void> anonymizeReport, @Nonnull AnonymizeUserService.AnonymizeValidationResult validationResult, @Nonnull Context asyncTaskContext) Description copied from interface:AnonymizeOperationStep
Performs operations only if all proper parameters are filled in passed parameters.AnonymizeOperationStep.validate(AnonymizeProcessData, I18nHelper, boolean)
should be called prior this method to ensure that all required parameters to perform operation are present.- Specified by:
performOperation
in interfaceAnonymizeOperationStep
- Parameters:
anonymizeReport
- Anonymization report, can be used to check if previous operations were executed/succeeded/failed.validationResult
- Validation result. SeeAnonymizeUserService.validateAnonymize(AnonymizationParameters)
asyncTaskContext
- Task context to report the anonymization process progress to- Returns:
- Result of operation. Empty optional if operation wasn't executed.
-
getAffectedEntities
@Nonnull public ServiceOutcomeWithWarnings<Collection<AffectedEntity>> getAffectedEntities(AnonymizeUserService.AnonymizeProcessData anonymizationData) Description copied from interface:AnonymizeOperationStep
Gets affected entities for this action. This should run event without proper parameters provided (enter default values eg. anonymized user key/username)- Specified by:
getAffectedEntities
in interfaceAnonymizeOperationStep
- Parameters:
anonymizationData
- Anonymization data.- Returns:
- Affected entities.
-
validate
@Nonnull public ServiceResult validate(@Nonnull AnonymizeUserService.AnonymizeProcessData anonymizationData, I18nHelper i18nHelper, boolean preValidate) Description copied from interface:AnonymizeOperationStep
Validate should ensure that request and anonymizationProcessData contain all data needed toAnonymizeOperationStep.performOperation(OperationsReport, AnonymizeValidationResult, Context)
. Also validates if system allows specific operation eg. in order for user to be renamed it has to be editable in system.- Specified by:
validate
in interfaceAnonymizeOperationStep
- Parameters:
anonymizationData
- Data to validate.i18nHelper
- I18n helperpreValidate
- True for pre-validation phase. SeeAnonymizeUserService.preValidateAnonymize(AnonymizationParameters)
- Returns:
- Validation result.
-
getNumberOfTasks
public int getNumberOfTasks(@Nonnull AnonymizeUserService.AnonymizeValidationResult validationResult) Description copied from interface:AnonymizeOperationStep
Returns number of tasks/stages to be executed as part of this anonymization step. The number returned here must be consistent with the number of updates performed as part ofAnonymizeOperationStep.performOperation(OperationsReport, AnonymizeValidationResult, Context)
.- Specified by:
getNumberOfTasks
in interfaceAnonymizeOperationStep
- Parameters:
validationResult
- Validation result- Returns:
- Number of tasks/stages to be executed
-
validateBusinessLogic
@Nonnull public BusinessLogicValidationResult validateBusinessLogic(@Nonnull AnonymizationParameters anonymizationParameters) - Specified by:
validateBusinessLogic
in interfaceStepWithPluginPointInvocations
-
getAnonymizeOperation
Description copied from interface:AnonymizeOperationStep
Type of operation this handler supports.- Specified by:
getAnonymizeOperation
in interfaceAnonymizeOperationStep
- Returns:
- Operation this handler supports.
-