Package com.adobe.granite.timeline
Interface TimelineEventProvider
public interface TimelineEventProvider
A
TimelineEntryProvider provides TimelineEvents to a Timeline. Implementations must
register themselves as an OSGi-component and declare itself as a service on this interface. This way the timeline
aggregator service is able to dynamically use available providers to generate timline events for a given Resource. A provider may decide (see accepts(org.apache.sling.api.resource.Resource)) whether to provide
events or not for a given resource. Events are provided via getEvents(org.apache.sling.api.resource.Resource).-
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates to the timeline aggregator whether this provider accepts the givenresourceor not.Ifaccepts(org.apache.sling.api.resource.Resource)returnstruefor a given resource, this method is called with the same resource parameter in order for the provider to return aCollectionofTimelineEvents for the given resource.getType()Returns theTimelineEventTypethis provider provides.
-
Method Details
-
accepts
Indicates to the timeline aggregator whether this provider accepts the givenresourceor not. In case the provider doesn not accept the resource,getEvents(org.apache.sling.api.resource.Resource)is never called.- Parameters:
resource- TheResourceto indicate for whether it is accepted or not.- Returns:
trueif the provider accepts providing events for the given resource.
-
getEvents
Ifaccepts(org.apache.sling.api.resource.Resource)returnstruefor a given resource, this method is called with the same resource parameter in order for the provider to return aCollectionofTimelineEvents for the given resource.- Parameters:
resource- TheResourcefor which to returnTimelineEvents.- Returns:
- A
CollectionofTimelineEvents or an empty collection if the provider did not find/generate any events.
-
getType
TimelineEventType getType()Returns theTimelineEventTypethis provider provides.- Returns:
- The
TimelineEventType.
-