Package com.adobe.granite.timeline
Interface TimelineEventProvider
-
public interface TimelineEventProviderATimelineEntryProviderprovidesTimelineEvents to aTimeline. 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 givenResource. A provider may decide (seeaccepts(org.apache.sling.api.resource.Resource)) whether to provide events or not for a given resource. Events are provided viagetEvents(org.apache.sling.api.resource.Resource).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaccepts(Resource resource)Indicates to the timeline aggregator whether this provider accepts the givenresourceor not.java.util.Collection<TimelineEvent>getEvents(Resource resource)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.TimelineEventTypegetType()Returns theTimelineEventTypethis provider provides.
-
-
-
Method Detail
-
accepts
boolean accepts(Resource resource)
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
java.util.Collection<TimelineEvent> getEvents(Resource resource)
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.
-
-