public class BasePropertyResource<E extends WithId> extends Object
Constructor and Description |
---|
BasePropertyResource(EntityPropertyService<E> entityPropertyService,
JiraAuthenticationContext authContext,
JiraBaseUrls jiraBaseUrls,
I18nHelper i18n,
java.util.function.BiFunction<Long,String,String> entityIdAndPropertyKeyToSelfFunction,
EntityPropertyType entityPropertyType) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
deleteProperty(String id,
String propertyKey) |
protected EntityPropertyService.PropertyKeys<E> |
getPropertiesKeys(ApplicationUser user,
String id) |
javax.ws.rs.core.Response |
getPropertiesKeys(String id)
Returns the keys of all properties for the entity identified by the id.
|
protected EntityPropertyService.PropertyResult |
getProperty(ApplicationUser user,
String propertyKey,
String id) |
javax.ws.rs.core.Response |
getProperty(String entityId,
String propertyKey)
Returns the value of the property with a given key from the entity identified by the the id.
|
javax.ws.rs.core.Response |
setProperty(String id,
String propertyKey,
javax.servlet.http.HttpServletRequest request)
Sets the value of the specified entity's property.
|
protected EntityPropertyService.DeletePropertyValidationResult |
validateDeleteProperty(ApplicationUser user,
String propertyKey,
String id) |
protected EntityPropertyService.SetPropertyValidationResult |
validateSetProperty(ApplicationUser user,
EntityPropertyService.PropertyInput propertyInput,
String id) |
protected <T> T |
withIdValidation(String id,
java.util.function.Function<Long,T> idFunction) |
BasePropertyResource<E> |
withSelfFunction(java.util.function.BiFunction<Long,String,String> selfFunction)
Returns a new instance of this class which behaves in the same way as this
but uses a newly supplied function to calculate self links of properties.
|
public BasePropertyResource(EntityPropertyService<E> entityPropertyService, JiraAuthenticationContext authContext, JiraBaseUrls jiraBaseUrls, I18nHelper i18n, java.util.function.BiFunction<Long,String,String> entityIdAndPropertyKeyToSelfFunction, EntityPropertyType entityPropertyType)
public BasePropertyResource<E> withSelfFunction(java.util.function.BiFunction<Long,String,String> selfFunction)
selfFunction
- function that will be used by the returned instance to calculate self linkspublic javax.ws.rs.core.Response getPropertiesKeys(String id)
id
- the entity from which keys will be returned.public javax.ws.rs.core.Response setProperty(String id, String propertyKey, javax.servlet.http.HttpServletRequest request)
This method can used to store a custom data against the entity identified by the key or by the id. The user who stores the data is required to have permissions to edit the entity.
id
- the entity's id on which the property will be set.propertyKey
- the key of the entity's property. The maximum length of the key is 255 bytes.request
- the request containing value of the entity's property. The value has to a valid, non-empty JSON conforming
to http://tools.ietf.org/html/rfc4627. The maximum length of the property value is 32768 bytes.public javax.ws.rs.core.Response getProperty(String entityId, String propertyKey)
entityId
- the id of the entity from which the property will be returned.propertyKey
- the key of the property to returned.EntityPropertyBean
.protected EntityPropertyService.PropertyKeys<E> getPropertiesKeys(ApplicationUser user, String id)
protected EntityPropertyService.PropertyResult getProperty(ApplicationUser user, String propertyKey, String id)
protected EntityPropertyService.DeletePropertyValidationResult validateDeleteProperty(ApplicationUser user, String propertyKey, String id)
protected EntityPropertyService.SetPropertyValidationResult validateSetProperty(ApplicationUser user, EntityPropertyService.PropertyInput propertyInput, String id)
protected <T> T withIdValidation(String id, java.util.function.Function<Long,T> idFunction)
Copyright © 2002-2022 Atlassian. All Rights Reserved.