com.atlassian.jira.rest.v2.entity.property
Class BasePropertyResource<E extends WithId>

java.lang.Object
  extended by com.atlassian.jira.rest.v2.entity.property.BasePropertyResource<E>
Direct Known Subclasses:
BasePropertyWithKeyResource

public class BasePropertyResource<E extends WithId>
extends Object

Since:
v6.2

Constructor Summary
BasePropertyResource(EntityPropertyService<E> entityPropertyService, JiraAuthenticationContext authContext, JiraBaseUrls jiraBaseUrls, I18nHelper i18n, com.atlassian.fugue.Function2<Long,String,String> entityIdAndPropertyKeyToSelfFunction, EntityPropertyType entityPropertyType)
           
 
Method Summary
 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, com.google.common.base.Function<Long,T> idFunction)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePropertyResource

public BasePropertyResource(EntityPropertyService<E> entityPropertyService,
                            JiraAuthenticationContext authContext,
                            JiraBaseUrls jiraBaseUrls,
                            I18nHelper i18n,
                            com.atlassian.fugue.Function2<Long,String,String> entityIdAndPropertyKeyToSelfFunction,
                            EntityPropertyType entityPropertyType)
Method Detail

getPropertiesKeys

public javax.ws.rs.core.Response getPropertiesKeys(String id)
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 a valid, non-empty JSON conforming to http://tools.ietf.org/html/rfc4627. The maximum length of the property value is 32768 bytes.

getProperty

public 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. 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

public javax.ws.rs.core.Response deleteProperty(String id,
                                                String propertyKey)

getPropertiesKeys

protected EntityPropertyService.PropertyKeys<E> getPropertiesKeys(ApplicationUser user,
                                                                  String id)

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

protected <T> T withIdValidation(String id,
                                 com.google.common.base.Function<Long,T> idFunction)


Copyright © 2002-2014 Atlassian. All Rights Reserved.