com.atlassian.confluence.api.extension
Interface ModelMetadataProvider

All Known Implementing Classes:
ContentLikesMetadataProvider, LabelsModelMetadataProvider

@PublicSpi
public interface ModelMetadataProvider

Provides additional metadata such as Likes and Watches to API Model objects.


Method Summary
 Map<String,?> getMetadata(Object entity, Expansions expansions)
          Returns keyed metadata based on the passed entity and the expansions.
 Map<Object,Map<String,?>> getMetadataForAll(Iterable<Object> entities, Expansions expansions)
          Fetches metadata for a list of entities, returning a map of maps of metadata.
 List<String> getMetadataProperties()
          get the list of properties that the MetadataProvider provides metadata for
 

Method Detail

getMetadata

Map<String,?> getMetadata(Object entity,
                          Expansions expansions)
Returns keyed metadata based on the passed entity and the expansions.

Parameters:
entity - a Confluence API object (e.g. Content, Space)
expansions - indicating which metadata (and at which depth) to include
Returns:
Jackson-serializable metadata keyed by globally-unique strings, else an empty Map

getMetadataForAll

Map<Object,Map<String,?>> getMetadataForAll(Iterable<Object> entities,
                                            Expansions expansions)
Fetches metadata for a list of entities, returning a map of maps of metadata. Initially keyed by the entity, and then by the metadata property. Implementors should attempt to fetch the metadata efficiently and try to avoid performing an individual query per entity.

Parameters:
entities - - a list of entities to fetch the metadata for
expansions - - indicating which metadata (and at which depth) should be fetched for each entity
Returns:
a map of maps of metadata, keyed by entity.

getMetadataProperties

List<String> getMetadataProperties()
get the list of properties that the MetadataProvider provides metadata for

Returns:


Copyright © 2003–2015 Atlassian. All rights reserved.