Class BasePropertyResource<E extends WithId>
java.lang.Object
com.atlassian.jira.rest.v2.entity.property.BasePropertyResource<E>
- Direct Known Subclasses:
BasePropertyWithKeyResource
- Since:
- v6.2
-
Constructor Summary
ConstructorsConstructorDescriptionBasePropertyResource(EntityPropertyService<E> entityPropertyService, JiraAuthenticationContext authContext, JiraBaseUrls jiraBaseUrls, I18nHelper i18n, BiFunction<Long, String, String> entityIdAndPropertyKeyToSelfFunction, EntityPropertyType entityPropertyType) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.ResponsedeleteProperty(String id, String propertyKey) protected EntityPropertyService.PropertyKeys<E>getPropertiesKeys(ApplicationUser user, String id) javax.ws.rs.core.ResponseReturns the keys of all properties for the entity identified by the id.protected EntityPropertyService.PropertyResultgetProperty(ApplicationUser user, String propertyKey, String id) javax.ws.rs.core.ResponsegetProperty(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.ResponsesetProperty(String id, String propertyKey, javax.servlet.http.HttpServletRequest request) Sets the value of the specified entity's property.validateDeleteProperty(ApplicationUser user, String propertyKey, String id) validateSetProperty(ApplicationUser user, EntityPropertyService.PropertyInput propertyInput, String id) protected <T> TwithIdValidation(String id, Function<Long, T> idFunction) withSelfFunction(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.
-
Constructor Details
-
BasePropertyResource
@Inject public BasePropertyResource(EntityPropertyService<E> entityPropertyService, JiraAuthenticationContext authContext, JiraBaseUrls jiraBaseUrls, I18nHelper i18n, BiFunction<Long, String, String> entityIdAndPropertyKeyToSelfFunction, EntityPropertyType entityPropertyType)
-
-
Method Details
-
withSelfFunction
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.- Parameters:
selfFunction- function that will be used by the returned instance to calculate self links- Returns:
- a new instance
-
getPropertiesKeys
Returns the keys of all properties for the entity identified by the id.- Parameters:
id- the entity from which keys will be returned.- Returns:
- a response containing EntityPropertiesKeysBean.
-
setProperty
public javax.ws.rs.core.Response setProperty(String id, String propertyKey, javax.servlet.http.HttpServletRequest request) Sets the value of the specified entity's property.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.
- Parameters:
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 be a valid, non-empty JSON conforming to http://tools.ietf.org/html/rfc4627. The maximum length of the property value is 32768 bytes.
-
getProperty
Returns the value of the property with a given key from the entity identified by the the id. The user who retrieves the property is required to have permissions to read the entity.- Parameters:
entityId- the id of the entity from which the property will be returned.propertyKey- the key of the property to returned.- Returns:
- a response containing
EntityPropertyBean.
-
deleteProperty
-
getPropertiesKeys
-
getProperty
protected EntityPropertyService.PropertyResult getProperty(ApplicationUser user, String propertyKey, String id) -
validateDeleteProperty
protected EntityPropertyService.DeletePropertyValidationResult validateDeleteProperty(ApplicationUser user, String propertyKey, String id) -
validateSetProperty
protected EntityPropertyService.SetPropertyValidationResult validateSetProperty(ApplicationUser user, EntityPropertyService.PropertyInput propertyInput, String id) -
withIdValidation
-