Class BaseEntityPropertyService<E extends WithId>
- Type Parameters:
- E- the entity type which is identifiable by id.
- All Implemented Interfaces:
- EntityPropertyService<E>
- Direct Known Subclasses:
- BaseEntityWithKeyPropertyService,- DefaultChangeHistoryPropertyService,- DefaultCommentPropertyService,- DefaultDashboardItemPropertyService,- DefaultIssueTypePropertyService
EntityPropertyService<E extends WithId>.- Since:
- v6.2
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.atlassian.jira.entity.property.EntityPropertyServiceEntityPropertyService.DeletePropertyValidationResult, EntityPropertyService.EntityPropertyInput, EntityPropertyService.PropertyInput, EntityPropertyService.PropertyKeys<E>, EntityPropertyService.PropertyResult, EntityPropertyService.PropertyServiceResult, EntityPropertyService.SetPropertyValidationResult
- 
Constructor SummaryConstructorsConstructorDescriptionBaseEntityPropertyService(JsonEntityPropertyManager jsonEntityPropertyManager, I18nHelper i18n, com.atlassian.event.api.EventPublisher eventPublisher, EntityPropertyHelper<E> entityPropertyHelper) 
- 
Method SummaryModifier and TypeMethodDescriptionvoiddeleteProperty(ApplicationUser user, EntityPropertyService.DeletePropertyValidationResult validationResult) Removes the entity property with specified entity's id and entity's property key.getProperties(ApplicationUser user, Long entityId) Returns all properties.getProperties(ApplicationUser user, Long entityId, List<String> propertyKeys) Returns properties with specified keys.protected EntityPropertyService.PropertyKeys<E> getPropertiesKeys(ApplicationUser user, io.atlassian.fugue.Option<E> entity, EntityPropertyOptions options) getPropertiesKeys(ApplicationUser user, Long entityId) Returns the properties keys associated with the specified entity.getPropertiesKeys(ApplicationUser user, Long entityId, EntityPropertyOptions options) Returns the properties keys associated with the specified entity.getProperty(ApplicationUser user, E entity, String propertyKey, EntityPropertyOptions options) Returns the JSON property with the specified key from specified entity.protected EntityPropertyService.PropertyResultgetProperty(ApplicationUser user, io.atlassian.fugue.Option<E> entity, String propertyKey, EntityPropertyOptions options) getProperty(ApplicationUser user, Long entityId, String propertyKey) Returns the JSON property with the specified key from specified entity.getProperty(ApplicationUser user, Long entityId, String propertyKey, EntityPropertyOptions options) Returns the JSON property with the specified key from specified entity.setProperty(ApplicationUser user, EntityPropertyService.SetPropertyValidationResult propertyValidationResult) Associates validated property with the entity.setProperty(ApplicationUser user, EntityPropertyService.SetPropertyValidationResult propertyValidationResult, EntityPropertyOptions options) Associates validated property with the entity.validateDeleteProperty(ApplicationUser user, io.atlassian.fugue.Option<E> entity, String propertyKey, EntityPropertyOptions options) validateDeleteProperty(ApplicationUser user, Long entityId, String propertyKey) Check if it is possible to remove the entity property with specified entity's id and entity's property key.validateDeleteProperty(ApplicationUser user, Long entityId, String propertyKey, EntityPropertyOptions options) Check if it is possible to remove the entity property with specified entity's id and entity's property key.validatePropertyInput(EntityPropertyService.PropertyInput propertyInput) Validates the property's key and property's value without permission checking.validateSetProperty(ApplicationUser user, io.atlassian.fugue.Option<E> entity, EntityPropertyService.PropertyInput propertyInput, EntityPropertyOptions options) validateSetProperty(ApplicationUser user, Long entityId, EntityPropertyService.PropertyInput propertyInput) Checks if the provided entity's property is valid.validateSetProperty(ApplicationUser user, Long entityId, EntityPropertyService.PropertyInput propertyInput, EntityPropertyOptions options) Checks if the provided entity's property is valid.
- 
Constructor Details- 
BaseEntityPropertyServicepublic BaseEntityPropertyService(JsonEntityPropertyManager jsonEntityPropertyManager, I18nHelper i18n, com.atlassian.event.api.EventPublisher eventPublisher, EntityPropertyHelper<E> entityPropertyHelper) 
 
- 
- 
Method Details- 
validateSetPropertypublic EntityPropertyService.SetPropertyValidationResult validateSetProperty(ApplicationUser user, Long entityId, EntityPropertyService.PropertyInput propertyInput) Description copied from interface:EntityPropertyServiceChecks if the provided entity's property is valid.This method checks if the entity with which the property will be associated exists and if the calling user has permissions to edit the entity. It validates if the property's key length is less then 255characters. It also checks if the length of the property's value is less then32,768.- Specified by:
- validateSetPropertyin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- entityId- the id of the entity with which the property will be associated.
- propertyInput- the pair of key and value which will be associated with the entity.
- Returns:
- either entity ready to be persisted in DB or collection of errors.
 
- 
validateSetPropertypublic EntityPropertyService.SetPropertyValidationResult validateSetProperty(ApplicationUser user, @Nonnull Long entityId, @Nonnull EntityPropertyService.PropertyInput propertyInput, @Nonnull EntityPropertyOptions options) Description copied from interface:EntityPropertyServiceChecks if the provided entity's property is valid.This method checks if the entity with which the property will be associated exists. It validates if the property's key length is less then 255characters. It also checks if the length of the property's value is less then32,768.- Specified by:
- validateSetPropertyin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- entityId- the id of the entity with which the property will be associated.
- propertyInput- the pair of key and value which will be associated with the entity.
- options- options to skip permission while performing the validation.
- Returns:
- either entity ready to be persisted in DB or collection of errors.
 
- 
validateSetPropertyprotected EntityPropertyService.SetPropertyValidationResult validateSetProperty(ApplicationUser user, io.atlassian.fugue.Option<E> entity, EntityPropertyService.PropertyInput propertyInput, EntityPropertyOptions options) 
- 
validatePropertyInputDescription copied from interface:EntityPropertyServiceValidates the property's key and property's value without permission checking.- Specified by:
- validatePropertyInputin interface- EntityPropertyService<E extends WithId>
- Parameters:
- propertyInput- the key and value of the property.
- Returns:
- all validation errors or empty error collection.
 
- 
setPropertypublic EntityPropertyService.PropertyResult setProperty(ApplicationUser user, @Nonnull EntityPropertyService.SetPropertyValidationResult propertyValidationResult, @Nonnull EntityPropertyOptions options) Description copied from interface:EntityPropertyServiceAssociates validated property with the entity. Upon successful set an instance ofEntityPropertySetEventis published.- Specified by:
- setPropertyin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- propertyValidationResult- validated entity property.
- options- options to skip permission while performing the validation.
- Returns:
- the persisted entity property or the error collection.
 
- 
setPropertypublic EntityPropertyService.PropertyResult setProperty(ApplicationUser user, @Nonnull EntityPropertyService.SetPropertyValidationResult propertyValidationResult) Description copied from interface:EntityPropertyServiceAssociates validated property with the entity. Upon successful set an instance ofEntityPropertySetEventis published.- Specified by:
- setPropertyin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- propertyValidationResult- validated entity property.
- Returns:
- the persisted entity property or the error collection.
 
- 
validateDeletePropertypublic EntityPropertyService.DeletePropertyValidationResult validateDeleteProperty(ApplicationUser user, Long entityId, String propertyKey) Description copied from interface:EntityPropertyServiceCheck if it is possible to remove the entity property with specified entity's id and entity's property key.This method checks if the calling user has permissions to edit the selected entity and if the property for given entity id and property key exists. - Specified by:
- validateDeletePropertyin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- entityId- the id of the entity with which the property is associated.
- propertyKey- the key of the entity's property.
- Returns:
- either entity ready to be removed or collection of errors.
 
- 
validateDeletePropertypublic EntityPropertyService.DeletePropertyValidationResult validateDeleteProperty(ApplicationUser user, @Nonnull Long entityId, @Nonnull String propertyKey, @Nonnull EntityPropertyOptions options) Description copied from interface:EntityPropertyServiceCheck if it is possible to remove the entity property with specified entity's id and entity's property key.This method checks if the property for given entity id and property key exists. - Specified by:
- validateDeletePropertyin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- entityId- the id of the entity with which the property is associated.
- propertyKey- the key of the entity's property.
- options- options to skip permission while performing the validation.
- Returns:
- either entity ready to be removed or collection of errors.
 
- 
validateDeletePropertyprotected EntityPropertyService.DeletePropertyValidationResult validateDeleteProperty(ApplicationUser user, io.atlassian.fugue.Option<E> entity, @Nonnull String propertyKey, @Nonnull EntityPropertyOptions options) 
- 
deletePropertypublic void deleteProperty(ApplicationUser user, @Nonnull EntityPropertyService.DeletePropertyValidationResult validationResult) Description copied from interface:EntityPropertyServiceRemoves the entity property with specified entity's id and entity's property key. Upon successful removal,EntityPropertyDeletedEventis published.- Specified by:
- deletePropertyin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- validationResult- validation results of entity's property removal.
 
- 
getPropertypublic EntityPropertyService.PropertyResult getProperty(ApplicationUser user, Long entityId, String propertyKey) Description copied from interface:EntityPropertyServiceReturns the JSON property with the specified key from specified entity.This method checks if the calling user has permissions to browse the entities and if the entity with given id exists. - Specified by:
- getPropertyin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- entityId- the id of the entity with which the property is associated.
- propertyKey- the key of the entity's property.
- Returns:
- the chosen property of the entity if found or the error collection.
 
- 
getPropertypublic EntityPropertyService.PropertyResult getProperty(ApplicationUser user, @Nonnull Long entityId, @Nonnull String propertyKey, @Nonnull EntityPropertyOptions options) Description copied from interface:EntityPropertyServiceReturns the JSON property with the specified key from specified entity.This method checks if the entity with given id exists. - Specified by:
- getPropertyin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- entityId- the id of the entity with which the property is associated.
- propertyKey- the key of the entity's property.
- options- options to skip permission while performing the validation.
- Returns:
- the chosen property of the entity if found or the error collection.
 
- 
getPropertiespublic List<EntityProperty> getProperties(ApplicationUser user, Long entityId, List<String> propertyKeys) Description copied from interface:EntityPropertyServiceReturns properties with specified keys. Only properties that exist will be returned, non-existent keys are ignored. If the user does not have permissions to read properties of the entity, empty list will be returned.- Specified by:
- getPropertiesin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- entityId- the id of the entity with which the properties are associated.
- propertyKeys- the keys of the requested properties
- Returns:
- a list of entity properties
 
- 
getPropertiesDescription copied from interface:EntityPropertyServiceReturns all properties. If the user does not have permissions to read properties of the entity, empty list will be returned.- Specified by:
- getPropertiesin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- entityId- the id of the entity with which the properties are associated.
- Returns:
- a list of entity properties
 
- 
getPropertypublic EntityPropertyService.PropertyResult getProperty(ApplicationUser user, @Nonnull E entity, @Nonnull String propertyKey, @Nonnull EntityPropertyOptions options) Description copied from interface:EntityPropertyServiceReturns the JSON property with the specified key from specified entity.- Specified by:
- getPropertyin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- entity- the entity with which the property is associated.
- propertyKey- the key of the entity's property.
- options- options to skip permission while performing the validation.
- Returns:
- the chosen property of the entity if found or the error collection.
 
- 
getPropertyprotected EntityPropertyService.PropertyResult getProperty(ApplicationUser user, io.atlassian.fugue.Option<E> entity, @Nonnull String propertyKey, EntityPropertyOptions options) 
- 
getPropertiesKeysDescription copied from interface:EntityPropertyServiceReturns the properties keys associated with the specified entity.This method checks if the calling user has permissions to browse the entities and if the entity with given id exists. - Specified by:
- getPropertiesKeysin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- entityId- the id of the entity with which the property is associated.
- Returns:
- the list of properties keys and associated entity or a collection with errors.
 
- 
getPropertiesKeyspublic EntityPropertyService.PropertyKeys<E> getPropertiesKeys(ApplicationUser user, @Nonnull Long entityId, @Nonnull EntityPropertyOptions options) Description copied from interface:EntityPropertyServiceReturns the properties keys associated with the specified entity.This method checks if the entity with given id exists. - Specified by:
- getPropertiesKeysin interface- EntityPropertyService<E extends WithId>
- Parameters:
- user- who the permission checks will be run against (can be null, indicating anonymous user).
- entityId- the id of the entity with which the property is associated.
- options- options to skip permission while performing the validation.
- Returns:
- the list of properties keys and associated entity or a collection with errors.
 
- 
getPropertiesKeysprotected EntityPropertyService.PropertyKeys<E> getPropertiesKeys(ApplicationUser user, io.atlassian.fugue.Option<E> entity, EntityPropertyOptions options) 
 
-