public interface JiraPropertySetFactory
Property sets belong to an "entity", as defined by an entityName
and entityId
. Normally,
the entity name is one of those defined by JIRA's entitymodel.xml
file, such as "Issue"
or
"CustomField"
and the entity ID is the value of its "id"
field, but this is not strictly
required. Plugins may store their own property sets without attaching them to any actual database entity.
It is recommended that the plugin's key be used as a prefix for the entity name when storing a property set
for this purpose. JIRA stores its own properties for some entities, and plugins should avoid modifying
these values directly, as an entity's property set contents are not considered part of its API.
The factory methods that return a non-caching property set return an implementation that does not interact with caches in any way. Any access to them, read or write, will result in a database call. Any caching property sets for the same entity will not be notified that their cached state is invalid, potentially leaving them with stale values. For this reason, as well as for performance reasons, a caching property set should usually be preferred.
The factory methods that return a caching property set return an implementation that caches its properties.
Calls to getKeys
and write operations will access the database, but queries
like exists
, getType
, and the various
getters
to retrieve a property's value will rely on cached information
whenever possible. The caching property sets are cluster-safe unless otherwise noted.
Plugin developers that are looking for a general storage mechanism might also want to consider one of the alternatives that are available:
Plugin Settings
— a storage class
that is suitable for use by cross-product plugins.JSON Entity Properties
— similar
to a property set, but using JSON as the storage format.Custom Fields
— issue-specific values that
are user-visible and searchable.Modifier and Type | Method and Description |
---|---|
com.opensymphony.module.propertyset.PropertySet |
buildCachingDefaultPropertySet(String entityName)
Returns a caching
PropertySet for the given entity name and an assumed
entity ID of 1 . |
com.opensymphony.module.propertyset.PropertySet |
buildCachingDefaultPropertySet(String entityName,
boolean bulkLoad)
Deprecated.
The
bulkLoad flag is no longer relevant. Use buildCachingDefaultPropertySet(String)
instead. Since v6.2. |
com.opensymphony.module.propertyset.PropertySet |
buildCachingPropertySet(com.opensymphony.module.propertyset.PropertySet propertySet,
boolean bulkLoad)
Deprecated.
These property sets can become stale if multiple instances are created with the same backing
propertySet delegate and are also unsafe in a clustered environment. Use
buildCachingDefaultPropertySet(String) or buildCachingPropertySet(String, Long)
instead. Since v6.2. |
com.opensymphony.module.propertyset.PropertySet |
buildCachingPropertySet(String entityName,
Long entityId)
Returns a caching
PropertySet for the given entity name and ID. |
com.opensymphony.module.propertyset.PropertySet |
buildCachingPropertySet(String entityName,
Long entityId,
boolean bulkLoad)
Deprecated.
The
bulkLoad flag is no longer relevant. Use buildCachingPropertySet(String, Long)
instead. Since v6.2. |
com.opensymphony.module.propertyset.PropertySet |
buildMemoryPropertySet(String entityName,
Long entityId)
Returns an in-memory copy of a property set from the database.
|
com.opensymphony.module.propertyset.PropertySet |
buildNoncachingPropertySet(String entityName)
Returns a non-caching
PropertySet for the given entity name and an assumed
entity ID of 1 . |
com.opensymphony.module.propertyset.PropertySet |
buildNoncachingPropertySet(String entityName,
Long entityId)
Returns a non-caching
PropertySet for the given entity name and ID. |
@Nonnull com.opensymphony.module.propertyset.PropertySet buildNoncachingPropertySet(String entityName)
PropertySet
for the given entity name and an assumed
entity ID of 1
.entityName
- the entity name for the entity that owns this property setPropertySet
@Nonnull com.opensymphony.module.propertyset.PropertySet buildNoncachingPropertySet(String entityName, Long entityId)
PropertySet
for the given entity name and ID.entityName
- the entity name for the entity that owns this property setentityId
- the entity ID for the entity that owns this property setPropertySet
@Deprecated @Nonnull com.opensymphony.module.propertyset.PropertySet buildCachingDefaultPropertySet(String entityName, boolean bulkLoad)
bulkLoad
flag is no longer relevant. Use buildCachingDefaultPropertySet(String)
instead. Since v6.2.buildCachingDefaultPropertySet(String)
.
Its bulkLoad
option is no longer significant.entityName
- the entity name for the entity that owns this property setbulkLoad
- IgnoredPropertySet
@Deprecated @Nonnull com.opensymphony.module.propertyset.PropertySet buildCachingPropertySet(String entityName, Long entityId, boolean bulkLoad)
bulkLoad
flag is no longer relevant. Use buildCachingPropertySet(String, Long)
instead. Since v6.2.buildCachingPropertySet(String, Long)
.
Its bulkLoad
option is no longer significant.entityName
- the entity name for the entity that owns this property setentityId
- the entity ID for the entity that owns this property setbulkLoad
- IgnoredPropertySet
@Nonnull com.opensymphony.module.propertyset.PropertySet buildCachingDefaultPropertySet(String entityName)
PropertySet
for the given entity name and an assumed
entity ID of 1
.entityName
- the entity name for the entity that owns this property setPropertySet
@Nonnull com.opensymphony.module.propertyset.PropertySet buildCachingPropertySet(String entityName, Long entityId)
PropertySet
for the given entity name and ID.entityName
- the entity name for the entity that owns this property setentityId
- the entity ID for the entity that owns this property setPropertySet
@Deprecated @Nonnull com.opensymphony.module.propertyset.PropertySet buildCachingPropertySet(com.opensymphony.module.propertyset.PropertySet propertySet, boolean bulkLoad)
propertySet
delegate and are also unsafe in a clustered environment. Use
buildCachingDefaultPropertySet(String)
or buildCachingPropertySet(String, Long)
instead. Since v6.2.PropertySet
that caches the return values of the PropertySet
that is provided.
This can be used to provide short-term caching around another property set implementation, but its use
is now discouraged.
WARNING: These property sets are not cluster-safe and generally not safe to hold
onto for extended time periods. They do not share cache state with any other cached property set,
even if exactly the same delegate propertySet
is supplied to this method multiple times.
propertySet
- the PropertySet
to which requests should be delegated when the request is not cachedbulkLoad
- If true
, then all properties will be loaded into the cache during initialisation of the
property set.PropertySet
which wraps the supplied property set with a short term, non-cluster-safe cache@Nonnull com.opensymphony.module.propertyset.PropertySet buildMemoryPropertySet(String entityName, Long entityId)
entityName
- the entity name for the entity that owns this property setentityId
- the entity ID for the entity that owns this property setPropertySet
held completely in memory. Changes will not be
written to the database.Copyright © 2002-2019 Atlassian. All Rights Reserved.