- All Implemented Interfaces:
EntityPropertyService<E>
,EntityWithKeyPropertyService<E>
EntityWithKeyPropertyService<E extends WithKey & WithId>
. This should be used for entities which are
identifiable by both: key and id, such as Issue
.- Since:
- v6.2
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.entity.property.EntityPropertyService
EntityPropertyService.DeletePropertyValidationResult, EntityPropertyService.EntityPropertyInput, EntityPropertyService.PropertyInput, EntityPropertyService.PropertyKeys<E>, EntityPropertyService.PropertyResult, EntityPropertyService.PropertyServiceResult, EntityPropertyService.SetPropertyValidationResult
-
Constructor Summary
ConstructorsConstructorDescriptionBaseEntityWithKeyPropertyService
(JsonEntityPropertyManager jsonEntityPropertyManager, I18nHelper i18n, com.atlassian.event.api.EventPublisher eventPublisher, EntityWithKeyPropertyHelper<E> entityHelper) -
Method Summary
Modifier and TypeMethodDescriptiongetPropertiesKeys
(ApplicationUser user, String entityKey) Returns the properties keys associated with the specified entity.getPropertiesKeys
(ApplicationUser user, String entityKey, EntityPropertyOptions options) Returns the properties keys associated with the specified entity.getProperty
(ApplicationUser user, String entityKey, String propertyKey) Returns the JSON property with the specified key from specified entity.getProperty
(ApplicationUser user, String entityKey, String propertyKey, EntityPropertyOptions options) Returns the JSON property with the specified key from specified entity.validateDeleteProperty
(ApplicationUser user, String entityKey, String propertyKey) Check if it is possible to remove the entity property with specified entity's key and entity's property key.validateDeleteProperty
(ApplicationUser user, String entityKey, String propertyKey, EntityPropertyOptions options) Check if it is possible to remove the entity property with specified entity's key and entity's property key.validateSetProperty
(ApplicationUser user, String entityKey, EntityPropertyService.PropertyInput propertyInput) Checks if the provided entity's property is valid.validateSetProperty
(ApplicationUser user, String entityKey, EntityPropertyService.PropertyInput propertyInput, EntityPropertyOptions options) Checks if the provided entity's property is valid.Methods inherited from class com.atlassian.jira.entity.property.BaseEntityPropertyService
deleteProperty, getProperties, getProperties, getPropertiesKeys, getPropertiesKeys, getPropertiesKeys, getProperty, getProperty, getProperty, getProperty, setProperty, setProperty, validateDeleteProperty, validateDeleteProperty, validateDeleteProperty, validatePropertyInput, validateSetProperty, validateSetProperty, validateSetProperty
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.entity.property.EntityPropertyService
deleteProperty, getProperties, getProperties, getPropertiesKeys, getPropertiesKeys, getProperty, getProperty, getProperty, setProperty, setProperty, validateDeleteProperty, validateDeleteProperty, validatePropertyInput, validateSetProperty, validateSetProperty
-
Constructor Details
-
BaseEntityWithKeyPropertyService
public BaseEntityWithKeyPropertyService(JsonEntityPropertyManager jsonEntityPropertyManager, I18nHelper i18n, com.atlassian.event.api.EventPublisher eventPublisher, EntityWithKeyPropertyHelper<E> entityHelper)
-
-
Method Details
-
validateSetProperty
public EntityPropertyService.SetPropertyValidationResult validateSetProperty(ApplicationUser user, String entityKey, EntityPropertyService.PropertyInput propertyInput) Description copied from interface:EntityWithKeyPropertyService
Checks 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
255
characters. It also checks if the length of the property's value is less then32,768
.- Specified by:
validateSetProperty
in interfaceEntityWithKeyPropertyService<E extends WithKey & WithId>
- Parameters:
user
- who the permission checks will be run against (can be null, indicating anonymous user).entityKey
- the key 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.
-
validateSetProperty
public EntityPropertyService.SetPropertyValidationResult validateSetProperty(ApplicationUser user, @Nonnull String entityKey, @Nonnull EntityPropertyService.PropertyInput propertyInput, @Nonnull EntityPropertyOptions options) Description copied from interface:EntityWithKeyPropertyService
Checks 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
255
characters. It also checks if the length of the property's value is less then32,768
.- Specified by:
validateSetProperty
in interfaceEntityWithKeyPropertyService<E extends WithKey & WithId>
- Parameters:
user
- who the permission checks will be run against (can be null, indicating anonymous user).entityKey
- the key 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.
-
validateDeleteProperty
public EntityPropertyService.DeletePropertyValidationResult validateDeleteProperty(ApplicationUser user, String entityKey, String propertyKey) Description copied from interface:EntityWithKeyPropertyService
Check if it is possible to remove the entity property with specified entity's key 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 key and property key exists.
- Specified by:
validateDeleteProperty
in interfaceEntityWithKeyPropertyService<E extends WithKey & WithId>
- Parameters:
user
- who the permission checks will be run against (can be null, indicating anonymous user).entityKey
- the key 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.
-
validateDeleteProperty
public EntityPropertyService.DeletePropertyValidationResult validateDeleteProperty(ApplicationUser user, @Nonnull String entityKey, @Nonnull String propertyKey, @Nonnull EntityPropertyOptions options) Description copied from interface:EntityWithKeyPropertyService
Check if it is possible to remove the entity property with specified entity's key and entity's property key.This method checks if the property for given entity key and property key exists.
- Specified by:
validateDeleteProperty
in interfaceEntityWithKeyPropertyService<E extends WithKey & WithId>
- Parameters:
user
- who the permission checks will be run against (can be null, indicating anonymous user).entityKey
- the key 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.
-
getProperty
public EntityPropertyService.PropertyResult getProperty(ApplicationUser user, String entityKey, String propertyKey) Description copied from interface:EntityWithKeyPropertyService
Returns 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 key exists.
- Specified by:
getProperty
in interfaceEntityWithKeyPropertyService<E extends WithKey & WithId>
- Parameters:
user
- who the permission checks will be run against (can be null, indicating anonymous user).entityKey
- the key 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.
-
getProperty
public EntityPropertyService.PropertyResult getProperty(ApplicationUser user, @Nonnull String entityKey, @Nonnull String propertyKey, @Nonnull EntityPropertyOptions options) Description copied from interface:EntityWithKeyPropertyService
Returns the JSON property with the specified key from specified entity.This method checks if the entity with given key exists.
- Specified by:
getProperty
in interfaceEntityWithKeyPropertyService<E extends WithKey & WithId>
- Parameters:
user
- who the permission checks will be run against (can be null, indicating anonymous user).entityKey
- the key 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.
-
getPropertiesKeys
public EntityPropertyService.PropertyKeys<E> getPropertiesKeys(ApplicationUser user, String entityKey) Description copied from interface:EntityWithKeyPropertyService
Returns the properties keys associated with the specified entity.This method checks if the calling user has permissions to browse the entitys and if the entity with given id exists.
- Specified by:
getPropertiesKeys
in interfaceEntityWithKeyPropertyService<E extends WithKey & WithId>
- Parameters:
user
- who the permission checks will be run against (can be null, indicating anonymous user).entityKey
- the key of the entity with which the property is associated.- Returns:
- the list of properties keys and associated entity or a collection with errors.
-
getPropertiesKeys
public EntityPropertyService.PropertyKeys<E> getPropertiesKeys(ApplicationUser user, @Nonnull String entityKey, @Nonnull EntityPropertyOptions options) Description copied from interface:EntityWithKeyPropertyService
Returns the properties keys associated with the specified entity.This method checks if the entity with given id exists.
- Specified by:
getPropertiesKeys
in interfaceEntityWithKeyPropertyService<E extends WithKey & WithId>
- Parameters:
user
- who the permission checks will be run against (can be null, indicating anonymous user).entityKey
- the key 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.
-