Package com.adobe.granite.timeline
Interface TimelineEventProvider
-
public interface TimelineEventProvider
ATimelineEntryProvider
providesTimelineEvent
s 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 boolean
accepts(Resource resource)
Indicates to the timeline aggregator whether this provider accepts the givenresource
or not.java.util.Collection<TimelineEvent>
getEvents(Resource resource)
Ifaccepts(org.apache.sling.api.resource.Resource)
returnstrue
for a given resource, this method is called with the same resource parameter in order for the provider to return aCollection
ofTimelineEvent
s for the given resource.TimelineEventType
getType()
Returns theTimelineEventType
this provider provides.
-
-
-
Method Detail
-
accepts
boolean accepts(Resource resource)
Indicates to the timeline aggregator whether this provider accepts the givenresource
or not. In case the provider doesn not accept the resource,getEvents(org.apache.sling.api.resource.Resource)
is never called.- Parameters:
resource
- TheResource
to indicate for whether it is accepted or not.- Returns:
true
if the provider accepts providing events for the given resource.
-
getEvents
java.util.Collection<TimelineEvent> getEvents(Resource resource)
Ifaccepts(org.apache.sling.api.resource.Resource)
returnstrue
for a given resource, this method is called with the same resource parameter in order for the provider to return aCollection
ofTimelineEvent
s for the given resource.- Parameters:
resource
- TheResource
for which to returnTimelineEvent
s.- Returns:
- A
Collection
ofTimelineEvent
s or an empty collection if the provider did not find/generate any events.
-
getType
TimelineEventType getType()
Returns theTimelineEventType
this provider provides.- Returns:
- The
TimelineEventType
.
-
-