Class UserPropertyChangeManager<T extends AnonymizationHandler<P>,P extends TaskContextAware>
java.lang.Object
com.atlassian.jira.user.anonymize.UserPropertyChangeManager<T,P>
- Direct Known Subclasses:
OwnershipTransferChangeManager
,UserAnonymizationManager
,UserKeyChangeManager
,UserNameChangeManager
public abstract class UserPropertyChangeManager<T extends AnonymizationHandler<P>,P extends TaskContextAware>
extends Object
Contains common logic used across user property change managers.
- Since:
- v8.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.atlassian.event.api.EventPublisher
-
Constructor Summary
ConstructorsConstructorDescriptionUserPropertyChangeManager
(com.atlassian.plugin.PluginAccessor pluginAccessor, com.atlassian.event.api.EventPublisher eventPublisher, BusinessLogicValidator businessLogicValidator) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
changeProperty
(P userPropertyChangeParameter) Changes user property in app_user table.protected ServiceResult
executeHandler
(AnonymizationHandlerModuleDescriptor<T, P> handlerModuleDescriptor, P userPropertyChangeParameter, I18nHelper i18nBean) executeHandlers
(P parameter, I18nHelper i18nBean) Updates affected entities by calling registered handlers (AnonymizationHandler
.getAffectedEntities
(P parameter) Gets affected entities from registered handlers (AnonymizationHandler
.protected ServiceOutcome<Collection<AffectedEntity>>
getAffectedEntitiesFromHandler
(AnonymizationHandlerModuleDescriptor<T, P> handlerModuleDescriptor, P userPropertyChangeParameter) protected abstract Class<? extends AnonymizationHandlerModuleDescriptor<T,
P>> validateBusinessLogic
(AnonymizationParameters anonymizationParameters)
-
Field Details
-
eventPublisher
protected final com.atlassian.event.api.EventPublisher eventPublisher
-
-
Constructor Details
-
UserPropertyChangeManager
public UserPropertyChangeManager(com.atlassian.plugin.PluginAccessor pluginAccessor, com.atlassian.event.api.EventPublisher eventPublisher, BusinessLogicValidator businessLogicValidator)
-
-
Method Details
-
changeProperty
Changes user property in app_user table.- Parameters:
userPropertyChangeParameter
- Contains old/new user property value.
-
getModuleDescriptorClass
protected abstract Class<? extends AnonymizationHandlerModuleDescriptor<T,P>> getModuleDescriptorClass() -
getAffectedEntities
@Nonnull public Map<AnonymizationHandlerModuleDescriptor,ServiceOutcome<Collection<AffectedEntity>>> getAffectedEntities(@Nonnull P parameter) Gets affected entities from registered handlers (AnonymizationHandler
. In case of exception during obtaining of affected entitiesServiceOutcome
will contain error with message from exception.- Parameters:
parameter
- Contains old/new user property value.- Returns:
- Map of
ServiceOutcome<Collection>
from each registeredAnonymizationHandlerModuleDescriptor
.
-
executeHandlers
@Nonnull public Map<AnonymizationHandlerModuleDescriptor,ServiceResult> executeHandlers(@Nonnull P parameter, @Nonnull I18nHelper i18nBean) Updates affected entities by calling registered handlers (AnonymizationHandler
. In case of error/exceptionServiceResult
value will contain errors for certain handler (AnonymizationHandlerModuleDescriptor
).- Parameters:
parameter
- Contains old/new user property value.i18nBean
- Used for i18n messages.- Returns:
- Map of {@link ServiceResult>} for each registered
AnonymizationHandlerModuleDescriptor
.
-
validateBusinessLogic
@Nonnull public BusinessLogicValidationResult validateBusinessLogic(@Nonnull AnonymizationParameters anonymizationParameters) -
getAffectedEntitiesFromHandler
@Nonnull protected ServiceOutcome<Collection<AffectedEntity>> getAffectedEntitiesFromHandler(@Nonnull AnonymizationHandlerModuleDescriptor<T, P> handlerModuleDescriptor, @Nonnull P userPropertyChangeParameter) -
executeHandler
@Nonnull protected ServiceResult executeHandler(@Nonnull AnonymizationHandlerModuleDescriptor<T, P> handlerModuleDescriptor, @Nonnull P userPropertyChangeParameter, @Nonnull I18nHelper i18nBean)
-