public class DelegatingEntityPropertyService<E extends WithId> extends Object implements EntityPropertyService<E>
EntityPropertyService
to an instance of BaseEntityPropertyService
.EntityPropertyService.DeletePropertyValidationResult, EntityPropertyService.EntityPropertyInput, EntityPropertyService.PropertyInput, EntityPropertyService.PropertyKeys<E>, EntityPropertyService.PropertyResult, EntityPropertyService.PropertyServiceResult, EntityPropertyService.SetPropertyValidationResult
Constructor and Description |
---|
DelegatingEntityPropertyService(EntityPropertyService<E> delegate) |
Modifier and Type | Method and Description |
---|---|
void |
deleteProperty(ApplicationUser user,
EntityPropertyService.DeletePropertyValidationResult validationResult)
Removes the entity property with specified entity's id and entity's property key.
|
List<EntityProperty> |
getProperties(ApplicationUser user,
Long entityId)
Returns all properties.
|
List<EntityProperty> |
getProperties(ApplicationUser user,
Long entityId,
List<String> propertyKeys)
Returns properties with specified keys.
|
EntityPropertyService.PropertyKeys<E> |
getPropertiesKeys(ApplicationUser user,
Long entityId)
Returns the properties keys associated with the specified entity.
|
EntityPropertyService.PropertyKeys<E> |
getPropertiesKeys(ApplicationUser user,
Long entityId,
EntityPropertyOptions options)
Returns the properties keys associated with the specified entity.
|
EntityPropertyService.PropertyResult |
getProperty(ApplicationUser user,
E entity,
String propertyKey,
EntityPropertyOptions options)
Returns the JSON property with the specified key from specified entity.
|
EntityPropertyService.PropertyResult |
getProperty(ApplicationUser user,
Long entityId,
String propertyKey)
Returns the JSON property with the specified key from specified entity.
|
EntityPropertyService.PropertyResult |
getProperty(ApplicationUser user,
Long entityId,
String propertyKey,
EntityPropertyOptions options)
Returns the JSON property with the specified key from specified entity.
|
EntityPropertyService.PropertyResult |
setProperty(ApplicationUser user,
EntityPropertyService.SetPropertyValidationResult propertyValidationResult)
Associates validated property with the entity.
|
EntityPropertyService.DeletePropertyValidationResult |
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.
|
EntityPropertyService.DeletePropertyValidationResult |
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.
|
ErrorCollection |
validatePropertyInput(EntityPropertyService.PropertyInput propertyInput)
Validates the property's key and property's value without permission checking.
|
EntityPropertyService.SetPropertyValidationResult |
validateSetProperty(ApplicationUser user,
Long entityId,
EntityPropertyService.PropertyInput propertyInput)
Checks if the provided entity's property is valid.
|
EntityPropertyService.SetPropertyValidationResult |
validateSetProperty(ApplicationUser user,
Long entityId,
EntityPropertyService.PropertyInput propertyInput,
EntityPropertyOptions options)
Checks if the provided entity's property is valid.
|
public DelegatingEntityPropertyService(EntityPropertyService<E> delegate)
public ErrorCollection validatePropertyInput(EntityPropertyService.PropertyInput propertyInput)
EntityPropertyService
validatePropertyInput
in interface EntityPropertyService<E extends WithId>
propertyInput
- the key and value of the property.public EntityPropertyService.SetPropertyValidationResult validateSetProperty(ApplicationUser user, @Nonnull Long entityId, @Nonnull EntityPropertyService.PropertyInput propertyInput)
EntityPropertyService
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 then 32,768
.
validateSetProperty
in interface EntityPropertyService<E extends WithId>
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.public EntityPropertyService.SetPropertyValidationResult validateSetProperty(ApplicationUser user, @Nonnull Long entityId, @Nonnull EntityPropertyService.PropertyInput propertyInput, @Nonnull EntityPropertyOptions options)
EntityPropertyService
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 then 32,768
.
validateSetProperty
in interface EntityPropertyService<E extends WithId>
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.public EntityPropertyService.PropertyResult setProperty(ApplicationUser user, @Nonnull EntityPropertyService.SetPropertyValidationResult propertyValidationResult)
EntityPropertyService
EntityPropertySetEvent
is published.setProperty
in interface EntityPropertyService<E extends WithId>
user
- who the permission checks will be run against (can be null, indicating anonymous user).propertyValidationResult
- validated entity property.public EntityPropertyService.DeletePropertyValidationResult validateDeleteProperty(ApplicationUser user, @Nonnull Long entityId, @Nonnull String propertyKey)
EntityPropertyService
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.
validateDeleteProperty
in interface EntityPropertyService<E extends WithId>
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.public EntityPropertyService.DeletePropertyValidationResult validateDeleteProperty(ApplicationUser user, @Nonnull Long entityId, @Nonnull String propertyKey, @Nonnull EntityPropertyOptions options)
EntityPropertyService
This method checks if the property for given entity id and property key exists.
validateDeleteProperty
in interface EntityPropertyService<E extends WithId>
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.public void deleteProperty(ApplicationUser user, @Nonnull EntityPropertyService.DeletePropertyValidationResult validationResult)
EntityPropertyService
EntityPropertyDeletedEvent
is published.deleteProperty
in interface EntityPropertyService<E extends WithId>
user
- who the permission checks will be run against (can be null, indicating anonymous user).validationResult
- validation results of entity's property removal.public EntityPropertyService.PropertyResult getProperty(ApplicationUser user, @Nonnull Long entityId, @Nonnull String propertyKey)
EntityPropertyService
This method checks if the calling user has permissions to browse the entities and if the entity with given id exists.
getProperty
in interface EntityPropertyService<E extends WithId>
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.public EntityPropertyService.PropertyResult getProperty(ApplicationUser user, @Nonnull Long entityId, @Nonnull String propertyKey, @Nonnull EntityPropertyOptions options)
EntityPropertyService
This method checks if the entity with given id exists.
getProperty
in interface EntityPropertyService<E extends WithId>
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.public EntityPropertyService.PropertyResult getProperty(ApplicationUser user, @Nonnull E entity, @Nonnull String propertyKey, @Nonnull EntityPropertyOptions options)
EntityPropertyService
getProperty
in interface EntityPropertyService<E extends WithId>
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.public List<EntityProperty> getProperties(ApplicationUser user, Long entityId, List<String> propertyKeys)
EntityPropertyService
getProperties
in interface EntityPropertyService<E extends WithId>
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 propertiespublic List<EntityProperty> getProperties(ApplicationUser user, Long entityId)
EntityPropertyService
getProperties
in interface EntityPropertyService<E extends WithId>
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.public EntityPropertyService.PropertyKeys<E> getPropertiesKeys(ApplicationUser user, @Nonnull Long entityId)
EntityPropertyService
This method checks if the calling user has permissions to browse the entities and if the entity with given id exists.
getPropertiesKeys
in interface EntityPropertyService<E extends WithId>
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.public EntityPropertyService.PropertyKeys<E> getPropertiesKeys(ApplicationUser user, @Nonnull Long entityId, @Nonnull EntityPropertyOptions options)
EntityPropertyService
This method checks if the entity with given id exists.
getPropertiesKeys
in interface EntityPropertyService<E extends WithId>
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.Copyright © 2002-2022 Atlassian. All Rights Reserved.