public interface AnonymizeUserService
Modifier and Type | Interface and Description |
---|---|
static class |
AnonymizeUserService.AnonymizeOperation |
static class |
AnonymizeUserService.AnonymizePerformResult |
static class |
AnonymizeUserService.AnonymizeProcessData
Contains data about anonymization process.
|
static class |
AnonymizeUserService.AnonymizeValidationResult |
static class |
AnonymizeUserService.OperationsReport<T> |
static class |
AnonymizeUserService.SingleOperationReport<T> |
Modifier and Type | Method and Description |
---|---|
int |
getStepCount(AnonymizeUserService.AnonymizeValidationResult anonymizeValidationResult)
Gets amount of distinct operations performed in the process of anonymization.
|
AnonymizeUserService.AnonymizePerformResult |
perform(AnonymizeUserService.AnonymizeValidationResult validationResult,
Context asyncTaskContext)
Perform the operation.
|
AnonymizeUserService.AnonymizeValidationResult |
preValidateAnonymize(AnonymizationParameters request)
Pre-validates anonymization - fills all data that can be obtained from initial user key passed in the request:
if user name/key is anonymized, generates new anonymized user key/name if needed, gets list of affected entities etc.
|
AnonymizeUserService.AnonymizeValidationResult |
validateAnonymize(AnonymizationParameters request)
Validate the request and return a validation result.
|
@Nonnull AnonymizeUserService.AnonymizeValidationResult preValidateAnonymize(@Nonnull AnonymizationParameters request)
AnonymizationParameters
with AnonymizeUserService.AnonymizeProcessData
that can be used on UI.
Doesn't validate additional parameters required by handlers eg. new owner for entities.request
- Anonymize request@Nonnull AnonymizeUserService.AnonymizeValidationResult validateAnonymize(@Nonnull AnonymizationParameters request)
AnonymizationParameters.builder()
, like this:
AnonymizationParameters.builder()
.targetUser(activeUser.getKey())
.newOwner(admin)
.executor(admin)
.build());
You must always verify the validation result before proceeding:
AnonymizeValidationResult result = validateAnonymize(request);
if (result.isValid()) {
...perform the operation...
} else {
...handle the errors...
}
@Nonnull AnonymizeUserService.AnonymizePerformResult perform(@Nonnull AnonymizeUserService.AnonymizeValidationResult validationResult, @Nonnull Context asyncTaskContext)
validateAnonymize(com.atlassian.jira.user.anonymize.AnonymizationParameters)
first and pass its return value here.validationResult
- Validation resultasyncTaskContext
- Task context to report the anonymization process progress toint getStepCount(@Nonnull AnonymizeUserService.AnonymizeValidationResult anonymizeValidationResult)
TaskContextAware.getContext()
passed in
perform(AnonymizeValidationResult, Context)
and AnonymizationHandler.update(Object)
.Copyright © 2002-2022 Atlassian. All Rights Reserved.