Jive API (4.5.7.0) Core Javadocs

com.jivesoftware.community
Interface ActivityEventHandlingStrategy

All Known Implementing Classes:
DefaultContentActivityEventHandlingStrategy

public interface ActivityEventHandlingStrategy

A strategy for the general Activity event listener to handle events in a manner specific to the object type of the event payload. For example, not all object types have the same strategy for retrieving the Activity's actor from the event payload. Where most strategies would get the actor from JiveContentObject.getUser() (the default way in DefaultContentActivityEventHandlingStrategy), the DocumentRecentActivityInfoProvider's strategy may want to override DefaultContentActivityEventHandlingStrategy.getActivityActor(...) so that it returns the DocumentVersion.getAuthor() result.

See Also:
DefaultContentActivityEventHandlingStrategy, ContentEventListener

Method Summary
 EntityDescriptor getActivityActor(com.jivesoftware.base.event.v2.BaseJiveEvent event)
          Returns an entity descriptor for the actor in the activity (eg. a user).
 EntityDescriptor getActivityTargetContainer(com.jivesoftware.base.event.v2.BaseJiveEvent event)
          Returns an entity descriptor for the container of the object that the activity in the event payload targets.
 EntityDescriptor getActivityTargetObject(com.jivesoftware.base.event.v2.BaseJiveEvent event)
          Returns an entity descriptor for the object that the activity in the event payload targets.
 Activity.Type getActivityTypeFrom(com.jivesoftware.base.event.v2.BaseJiveEvent event)
          Maps content event types to an activity type.
 boolean isActivityRecordable(com.jivesoftware.base.event.v2.BaseJiveEvent event)
          Returns true if the payload is in a recordable state.
 boolean shouldDeleteActivities(com.jivesoftware.base.event.v2.BaseJiveEvent event)
          Returns whether or not the event constitutes activity removals for the content object in the payload.
 

Method Detail

isActivityRecordable

boolean isActivityRecordable(com.jivesoftware.base.event.v2.BaseJiveEvent event)
Returns true if the payload is in a recordable state. For example, if the payload was in an unpublished state we would want to return false here so that the activity is not recorded. Only ContentEvent events are supported, and for payloads which are JiveContentObjects.

Parameters:
event - the content event
Returns:
true if the payload is in a recordable state

getActivityTypeFrom

Activity.Type getActivityTypeFrom(com.jivesoftware.base.event.v2.BaseJiveEvent event)
Maps content event types to an activity type. Only ContentEvent events are supported.

Parameters:
event - the content event
Returns:
the content event type's corresponding activity type

getActivityTargetObject

EntityDescriptor getActivityTargetObject(com.jivesoftware.base.event.v2.BaseJiveEvent event)
Returns an entity descriptor for the object that the activity in the event payload targets. Only ContentEvent events are supported.

Parameters:
event - the content event
Returns:
an entity descriptor for the object that the activity in the event payload targets

getActivityTargetContainer

EntityDescriptor getActivityTargetContainer(com.jivesoftware.base.event.v2.BaseJiveEvent event)
Returns an entity descriptor for the container of the object that the activity in the event payload targets. Only ContentEvent events are supported.

Parameters:
event - the content event
Returns:
an entity descriptor for the container of the object that the activity in the event payload targets

getActivityActor

EntityDescriptor getActivityActor(com.jivesoftware.base.event.v2.BaseJiveEvent event)
Returns an entity descriptor for the actor in the activity (eg. a user). Only ContentEvent events are supported.

Parameters:
event - the content event
Returns:
an entity descriptor for the actor in the activity

shouldDeleteActivities

boolean shouldDeleteActivities(com.jivesoftware.base.event.v2.BaseJiveEvent event)
Returns whether or not the event constitutes activity removals for the content object in the payload. This might be true on ContentEvent.ModificationType.Deleted or ContentEvent.ModificationType.Moderate, for example. Only ContentEvent events are supported.

Parameters:
event - the content event
Returns:
whether or not the event constitutes activity removals for the content object in the payload

Jive Product Page

Copyright © 1999-2007 Jive Software.