Jive API (3.0.13) Core Javadocs

com.jivesoftware.community
Interface RecentContentEventHandlingStrategy


public interface RecentContentEventHandlingStrategy

A strategy for the general Recent Content 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 determining if the recent content in the event payload is recordable. Where most strategies would use JiveContentObject.getStatus().isVisible() to determine this, (the way done in the default strategy), the VideoRecentContentInfoProvider's strategy may want to override DefaultRecentContentEventHandlingStrategy.isRecordable(...) so that it excludes embedded videos from being recordable.

See Also:
com.jivesoftware.community.impl.recentcontent.DefaultRecentContentEventHandlingStrategy, com.jivesoftware.community.impl.recentcontent.ContentEventListener

Method Summary
 JiveContentObject getContentObject(BaseJiveEvent event)
          Returns the content object from the event payload.
 JiveObject getObject(BaseJiveEvent event)
          Returns the event payload as a JiveObject.
 EntityDescriptor getOldContainerDescriptor(BaseJiveEvent event)
          Returns an entity descriptor for the event payload's "old" container.
 JiveContainer getTargetContainer(BaseJiveEvent event)
          If the event payload is a JiveContentObject, this method tries to return that object's container.
 EntityDescriptor getTargetContainerDescriptor(BaseJiveEvent event)
          Returns an entity descriptor for the event payload's container.
 User getUser(BaseJiveEvent event)
          If the event payload is a JiveContentObject, this method tries to return that object's user.
 boolean isRecordable(BaseJiveEvent event)
          Returns true if the payload is in a recordable state.
 boolean shouldDeleteRecentContent(BaseJiveEvent event)
          Returns whether or not the event constitutes a recent content removal for the content object in the payload.
 

Method Detail

isRecordable

boolean isRecordable(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 content object is not tracked by the recent content manager. Only com.jivesoftware.base.event.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

getContentObject

JiveContentObject getContentObject(BaseJiveEvent event)
Returns the content object from the event payload. Only com.jivesoftware.base.event.ContentEvent events are supported.

Parameters:
event - the content event
Returns:
the content object from the event payload

getObject

JiveObject getObject(BaseJiveEvent event)
Returns the event payload as a JiveObject. Only com.jivesoftware.base.event.ContentEvent events are supported.

Parameters:
event - the content event
Returns:
the event payload

getTargetContainer

JiveContainer getTargetContainer(BaseJiveEvent event)
If the event payload is a JiveContentObject, this method tries to return that object's container. Only com.jivesoftware.base.event.ContentEvent events are supported.

Parameters:
event - the content event
Returns:
the event payload's container

getUser

User getUser(BaseJiveEvent event)
If the event payload is a JiveContentObject, this method tries to return that object's user. Only com.jivesoftware.base.event.ContentEvent events are supported.

Parameters:
event - the content event
Returns:
the event payload's user

getTargetContainerDescriptor

EntityDescriptor getTargetContainerDescriptor(BaseJiveEvent event)
Returns an entity descriptor for the event payload's container. Only com.jivesoftware.base.event.ContentEvent events are supported.

Parameters:
event - the content event
Returns:
an entity descriptor for the event payload's container

getOldContainerDescriptor

EntityDescriptor getOldContainerDescriptor(BaseJiveEvent event)
Returns an entity descriptor for the event payload's "old" container. Used during a ContentEvent.ModificationType.Move Only com.jivesoftware.base.event.ContentEvent events are supported.

Parameters:
event - the content event
Returns:
an entity descriptor for the event payload's "old" container

shouldDeleteRecentContent

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

Parameters:
event - the content event
Returns:
whether or not the event constitutes a recent content removal for the content object in the payload

Jive Product Page

Copyright © 1999-2007 Jive Software.