Class MediaItemEvent
- java.lang.Object
-
- nl.gx.webmanager.contentapi.event.MediaItemEvent
-
- All Implemented Interfaces:
EntityEvent
,Event
public class MediaItemEvent extends Object implements EntityEvent
This class represents a media item event posted by the media repository service to allow all subscribers to this event to do something with that information. This may be updating timestamps, updating a search index, etc.- Author:
- ivol
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface nl.gx.webmanager.services.event.Event
Event.Type
-
-
Constructor Summary
Constructors Constructor Description MediaItemEvent(Event.Type eventType, MediaItem mediaItem, String eventAction, Object source, int discussionId, Website[] websites)
Deprecated.MediaItemEvent(Event.Type eventType, MediaItem mediaItem, String eventAction, Object source, int discussionId, Website[] websites, Class<? extends MediaItem> scope)
Deprecated.MediaItemEvent(Event.Type eventType, MediaItem mediaItem, String eventAction, Object source, Website[] websites)
Constructor of the media item event.MediaItemEvent(Event.Type eventType, MediaItem mediaItem, String eventAction, Object source, Website[] websites, Class<? extends MediaItem> scope)
Constructor of the media item event.MediaItemEvent(Event.Type eventType, MediaItem mediaItem, MediaItem originalMediaItem, String eventAction, Object source, int discussionId, Website[] websites)
Deprecated.MediaItemEvent(Event.Type eventType, MediaItem mediaItem, MediaItem originalMediaItem, String eventAction, Object source, int discussionId, Website[] websites, Class<? extends MediaItem> scope)
Deprecated.MediaItemEvent(Event.Type eventType, MediaItem mediaItem, MediaItem originalMediaItem, String eventAction, Object source, Website[] websites)
Constructor of the media item event.MediaItemEvent(Event.Type eventType, MediaItem mediaItem, MediaItem originalMediaItem, String eventAction, Object source, Website[] websites, Class<? extends MediaItem> scope)
Constructor of the media item event.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
getDiscussionId()
Deprecated.As of 9.5, use getMediaItem().getPlanned().getForum().getId() insteadObject
getEntity()
Return the (new) entity on which the action was performed.String
getEventAction()
Returns the action that has been performedEvent.Type
getEventType()
Type of event notification.MediaItem
getMediaItem()
Returns the media item associated with the event.MediaItem
getOriginalMediaItem()
Returns the original media item associated with the event.Class<?>
getScope()
The scope of the object on which the action is performed.Object
getSource()
Returns the object that published the eventWebsite[]
getWebsites()
Returns the owner webid of this media itemString
toString()
Returns String representing information on the event
-
-
-
Constructor Detail
-
MediaItemEvent
public MediaItemEvent(Event.Type eventType, MediaItem mediaItem, String eventAction, Object source, Website[] websites)
Constructor of the media item event.- Parameters:
eventType
- The event type which can be either PRE or POST.mediaItem
- The media item which is the result of the performed action.eventAction
- Action performed on the media item. Typically one defined by theEntityEvent
interface.source
- The source object on which the event was published.websites
- Web sites to be updated.
-
MediaItemEvent
public MediaItemEvent(Event.Type eventType, MediaItem mediaItem, String eventAction, Object source, Website[] websites, Class<? extends MediaItem> scope)
Constructor of the media item event.- Parameters:
eventType
- The event type which can be either PRE or POST.mediaItem
- The media item which is the result of the performed action.eventAction
- Action performed on the media item. Typically one defined by theEntityEvent
interface.source
- The source object on which the event was published.websites
- Web sites to be updated.scope
- Scope of the event.
-
MediaItemEvent
public MediaItemEvent(Event.Type eventType, MediaItem mediaItem, MediaItem originalMediaItem, String eventAction, Object source, Website[] websites)
Constructor of the media item event.- Parameters:
eventType
- The event type which can be either PRE or POST.mediaItem
- The media item which is the result of the performed action.originalMediaItem
- The media item on which the action is performed. Useful in combination withEntityEvent.COPY
where media item is not the same as original media item.eventAction
- Action performed on the media item. Typically one defined by theEntityEvent
interface.source
- The source object on which the event was published.websites
- Web sites to be updated.
-
MediaItemEvent
public MediaItemEvent(Event.Type eventType, MediaItem mediaItem, MediaItem originalMediaItem, String eventAction, Object source, Website[] websites, Class<? extends MediaItem> scope)
Constructor of the media item event.- Parameters:
eventType
- The event type which can be either PRE or POST.mediaItem
- The media item which is the result of the performed action.originalMediaItem
- The media item on which the action is performed. Useful in combination withEntityEvent.COPY
where media item is not the same as original media item.eventAction
- Action performed on the media item. Typically one defined by theEntityEvent
interface.source
- The source object on which the event was published.websites
- Web sites to be updated.scope
- Scope of the event.
-
MediaItemEvent
@Deprecated public MediaItemEvent(Event.Type eventType, MediaItem mediaItem, String eventAction, Object source, int discussionId, Website[] websites)
Deprecated.
-
MediaItemEvent
@Deprecated public MediaItemEvent(Event.Type eventType, MediaItem mediaItem, String eventAction, Object source, int discussionId, Website[] websites, Class<? extends MediaItem> scope)
Deprecated.
-
MediaItemEvent
@Deprecated public MediaItemEvent(Event.Type eventType, MediaItem mediaItem, MediaItem originalMediaItem, String eventAction, Object source, int discussionId, Website[] websites)
Deprecated.
-
MediaItemEvent
@Deprecated public MediaItemEvent(Event.Type eventType, MediaItem mediaItem, MediaItem originalMediaItem, String eventAction, Object source, int discussionId, Website[] websites, Class<? extends MediaItem> scope)
Deprecated.
-
-
Method Detail
-
getEventType
public Event.Type getEventType()
Description copied from interface:Event
Type of event notification. This can be either PRE or POST. A PRE event is thrown just before the action is performed, a POST event immediately after.- Specified by:
getEventType
in interfaceEvent
- Returns:
- type of event notification.
-
getMediaItem
public MediaItem getMediaItem()
Returns the media item associated with the event.- Returns:
- the media item associated with the event
-
getOriginalMediaItem
public MediaItem getOriginalMediaItem()
Returns the original media item associated with the event.- Returns:
- The original media item.
-
getDiscussionId
@Deprecated public int getDiscussionId()
Deprecated.As of 9.5, use getMediaItem().getPlanned().getForum().getId() insteadReturns the discussion id associated with this media item- Returns:
- Id of the associated discussion, -1 otherwise
-
getWebsites
public Website[] getWebsites()
Returns the owner webid of this media item- Returns:
- Id of the owner webid
-
getEntity
public Object getEntity()
Description copied from interface:EntityEvent
Return the (new) entity on which the action was performed.- Specified by:
getEntity
in interfaceEntityEvent
- Returns:
- get the entity this event refers to.
-
getEventAction
public String getEventAction()
Description copied from interface:Event
Returns the action that has been performed- Specified by:
getEventAction
in interfaceEvent
- Returns:
- the action that has been performed.
-
getScope
public Class<?> getScope()
Description copied from interface:Event
The scope of the object on which the action is performed. The scope indicates the object's type indicated by its Class
-
getSource
public Object getSource()
Description copied from interface:Event
Returns the object that published the event
-
-