|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@ExperimentalApi public interface EntityPropertyService<T extends WithId>
The service used to add, update, retrieve and delete properties from entities. Each method of this service ensures that the user has permission to perform the operation. For each operation an appropriate event is published.
BaseEntityPropertyService
Nested Class Summary | |
---|---|
static class |
EntityPropertyService.DeletePropertyValidationResult
|
static class |
EntityPropertyService.EntityPropertyInput
Tuple with property value, property key, entity id and entity name, which will be persisted by the service. |
static class |
EntityPropertyService.PropertyInput
The key-value pair associated to the entity. |
static class |
EntityPropertyService.PropertyKeys<E>
|
static class |
EntityPropertyService.PropertyResult
|
static class |
EntityPropertyService.PropertyServiceResult
|
static class |
EntityPropertyService.SetPropertyValidationResult
|
Method Summary | |
---|---|
void |
deleteProperty(ApplicationUser user,
EntityPropertyService.DeletePropertyValidationResult validationResult)
Removes the entity property with specified entity's id and entity's property key. |
EntityPropertyService.PropertyKeys<T> |
getPropertiesKeys(ApplicationUser user,
Long entityId)
Returns the properties keys associated with the specified entity. |
EntityPropertyService.PropertyResult |
getProperty(ApplicationUser user,
Long entityId,
String propertyKey)
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.SetPropertyValidationResult |
validateSetProperty(ApplicationUser user,
Long entityId,
EntityPropertyService.PropertyInput propertyInput)
Checks if the provided entity's property is valid. |
Method Detail |
---|
EntityPropertyService.SetPropertyValidationResult validateSetProperty(ApplicationUser user, @NotNull Long entityId, @NotNull EntityPropertyService.PropertyInput propertyInput)
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
.
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.
EntityPropertyService.PropertyResult setProperty(ApplicationUser user, @NotNull EntityPropertyService.SetPropertyValidationResult propertyValidationResult)
EntityPropertySetEvent
is published.
user
- who the permission checks will be run against (can be null, indicating anonymous user).propertyValidationResult
- validated entity property.
EntityPropertyService.DeletePropertyValidationResult validateDeleteProperty(ApplicationUser user, @NotNull Long entityId, @NotNull String propertyKey)
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.
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.
void deleteProperty(ApplicationUser user, @NotNull EntityPropertyService.DeletePropertyValidationResult validationResult)
EntityPropertyDeletedEvent
is published.
user
- who the permission checks will be run against (can be null, indicating anonymous user).validationResult
- validation results of entity's property removal.EntityPropertyService.PropertyResult getProperty(ApplicationUser user, @NotNull Long entityId, @NotNull String propertyKey)
This method checks if the calling user has permissions to browse the entitys and if the entity with given id exists.
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.
EntityPropertyService.PropertyKeys<T> getPropertiesKeys(ApplicationUser user, @NotNull Long entityId)
This method checks if the calling user has permissions to browse the entities and if the entity with given id exists.
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |