@ExperimentalApi
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.AnonymizeUserRequest |
static class |
AnonymizeUserService.AnonymizeValidationResult |
static class |
AnonymizeUserService.OperationsReport<T> |
static class |
AnonymizeUserService.SingleOperationReport<T> |
static class |
AnonymizeUserService.UserState |
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(AnonymizeUserService.AnonymizeUserRequest 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(AnonymizeUserService.AnonymizeUserRequest request)
Validate the request and return a validation result.
|
@Nonnull AnonymizeUserService.AnonymizeValidationResult preValidateAnonymize(@Nonnull AnonymizeUserService.AnonymizeUserRequest request)
AnonymizeUserService.AnonymizeUserRequest
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 AnonymizeUserService.AnonymizeUserRequest request)
AnonymizeUserService.AnonymizeUserRequest.builder()
, like this:
AnonymizeUserRequest.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.AnonymizeUserService.AnonymizeUserRequest)
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-2019 Atlassian. All Rights Reserved.