@AlfrescoPublicApi
public interface AttributeService
['a','b']
is equivalent to ['a','b',null]
in all cases except where multiple search results
are possible. Keys can be any simple Serializable
type, typically being convertable using
DefaultTypeConverter
. The attribute values persisted can be any Serializable
(including collections) but the raw values should be convertable by the DefaultTypeConverter
for
the most efficient persistence.Modifier and Type | Interface and Description |
---|---|
static interface |
AttributeService.AttributeQueryCallback
Callback used for querying for lists of attributes.
|
Modifier and Type | Method and Description |
---|---|
void |
createAttribute(Serializable value,
Serializable... keys)
Create an attribute with an optional value, assuming there is no existing attribute
using the same keys.
|
boolean |
exists(Serializable... keys)
Determine if a particular attribute exists.
|
Serializable |
getAttribute(Serializable... keys)
Get an attribute using a list of unique keys
|
void |
getAttributes(AttributeService.AttributeQueryCallback callback,
Serializable... keys)
Get all attributes that share the starter keys provided.
|
void |
removeAttribute(Serializable... keys)
Remove a specific attribute.
|
void |
removeAttributes(Serializable... keys)
Remove all attributes that share a set of keys (in order)
|
void |
setAttribute(Serializable value,
Serializable... keys)
Set an attribute, overwriting its prior value if it already existed.
|
void |
updateOrCreateAttribute(Serializable keyBefore1,
Serializable keyBefore2,
Serializable keyBefore3,
Serializable keyAfter1,
Serializable keyAfter2,
Serializable keyAfter3)
Update an attribute key whilst preserving the associated value (if any).
|
boolean exists(Serializable... keys)
keys
- List of 1 to 3 keys to uniquely identify the attributeSerializable getAttribute(Serializable... keys)
keys
- List of 1 to 3 keys to uniquely identify the attributevoid getAttributes(AttributeService.AttributeQueryCallback callback, Serializable... keys)
callback
- the callback that handles the resultskeys
- 0 to 3 key values to search againstvoid setAttribute(Serializable value, Serializable... keys)
exists(Serializable...)
will still return true. If the attribute doesn't
exist, it will be created otherwise it will be modified.value
- The value to store (can be a collection or null)keys
- List of 1 to 3 keys to uniquely identify the attributevoid createAttribute(Serializable value, Serializable... keys)
value
- The value to store (can be a collection or null)keys
- List of 1 to 3 keys to uniquely identify the attributeDuplicateAttributeException
- if the attribute already existsvoid updateOrCreateAttribute(Serializable keyBefore1, Serializable keyBefore2, Serializable keyBefore3, Serializable keyAfter1, Serializable keyAfter2, Serializable keyAfter3)
keyBefore1
- the first part of the original unique key (never null)keyBefore2
- the second part of the original unique key (null allowed)keyBefore3
- the third part of the original unique key (null allowed)keyAfter1
- the first part of the new unique key (never null)keyAfter2
- the second part of the new unique key (null allowed)keyAfter3
- the third part of the new unique key (null allowed)void removeAttribute(Serializable... keys)
keys
- up to 3 keys to uniquely identify the attributevoid removeAttributes(Serializable... keys)
keys
- up to 3 keys to identify attributes to removeCopyright © 2005–2017 Alfresco Software. All rights reserved.