Jive API (3.0.13) Core Javadocs

com.jivesoftware.community.media
Interface MediaManager

All Superinterfaces:
JiveManager

public interface MediaManager
extends JiveManager

Manager for multimedia content objects supported CRUD operations including inserting, retrieving, updating, counting, deleting, listing, and moving multimedia items.


Method Summary
 void delete(Media mediaObj)
          Deletes the given media object from the system
<T extends Media>
T
getMedia(Class<T> type, long mediaID)
          Retrieves the item from the system of the given type with the specified id.
<M extends Media,T extends MediaResultFilter<Class<? extends M>>>
M
getMedia(T resultFilter)
          Retrieves the first multimedia item that matches the given result filter
<T extends Media>
T
getMediaByExternalID(Class<T> type, String externalID)
          Retrieves the item from the system of the given type with the specified external id obtained from the VideoProvider service
<T extends MediaResultFilter>
JiveIterator<? extends Media>
getMediaCollection(T resultFilter)
          Returns the collection of all multimedia items matching the given result filter
<T extends MediaResultFilter>
JiveIterator<? extends Media>
getMediaCollection(TagSet tagSet, T resultFilter)
          Returns the collection of all multimedia items within the given tag set matching the given result filter
<T extends MediaResultFilter>
int
getMediaCount(T resultFilter)
          Gets the count of all multimedia items matching the given result filter
 int getMediaCount(TagSet tagSet, Class<? extends Media> type)
          Gets the count of all multimedia items of the specified type within the given tag set
<T extends Media>
T
insert(T mediaObj)
          Inserts the given media object into the system
 void move(Media toMove, JiveContainer target)
          Moves a video from one container to another.
 void update(Media mediaObj)
          Updates the media object with an id and content type matching the id and type of the given item with the new values contained in the given mediaObj
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

Method Detail

update

void update(Media mediaObj)
            throws RejectedException,
                   UnauthorizedException
Updates the media object with an id and content type matching the id and type of the given item with the new values contained in the given mediaObj

Parameters:
mediaObj - to update
Throws:
RejectedException - if the update is invalid or may put the system in an invalid state
UnauthorizedException - if the effective user doesn't have permission to update the item

getMedia

<T extends Media> T getMedia(Class<T> type,
                             long mediaID)
                         throws UnauthorizedException
Retrieves the item from the system of the given type with the specified id.

Parameters:
type - of multimedia content object implementation
mediaID - the object id in the system of the item to retrieve
Returns:
the item with the matching id
Throws:
UnauthorizedException - if the effective user doesn't have permission to update the item

getMediaByExternalID

<T extends Media> T getMediaByExternalID(Class<T> type,
                                         String externalID)
                                     throws UnauthorizedException
Retrieves the item from the system of the given type with the specified external id obtained from the VideoProvider service

Parameters:
type - of multimedia content object implementation
externalID - retrieved from the video service associated to the multimedia item in the system
Returns:
the item with the matching external id
Throws:
UnauthorizedException - if the effective user doesn't have permission to update the item

getMedia

<M extends Media,T extends MediaResultFilter<Class<? extends M>>> M getMedia(T resultFilter)
                         throws UnauthorizedException
Retrieves the first multimedia item that matches the given result filter

Parameters:
resultFilter - used to constrain and sort results
Returns:
the first item matching the filter
Throws:
UnauthorizedException - if the effective user doesn't have permission to update the item

getMediaCount

<T extends MediaResultFilter> int getMediaCount(T resultFilter)
Gets the count of all multimedia items matching the given result filter

Parameters:
resultFilter - used to constrain results
Returns:
total number of all items matching the filter

getMediaCount

int getMediaCount(TagSet tagSet,
                  Class<? extends Media> type)
Gets the count of all multimedia items of the specified type within the given tag set

Parameters:
tagSet - used to filter results
type - of multimedia content object implementation
Returns:
total number of all items of the specific type tagged with a tag in the given tag set

insert

<T extends Media> T insert(T mediaObj)
                       throws RejectedException,
                              UnauthorizedException
Inserts the given media object into the system

Parameters:
mediaObj - to insert
Returns:
the inserted object
Throws:
RegistrationManager - if the object creation is invalid or would put the system in an invalid state
UnauthorizedException - if the effective user doesn't have permission to update the item
RejectedException

delete

void delete(Media mediaObj)
            throws UnauthorizedException
Deletes the given media object from the system

Parameters:
mediaObj - to be deleted
Throws:
UnauthorizedException - if the effective user doesn't have permission to delete the item

getMediaCollection

<T extends MediaResultFilter> JiveIterator<? extends Media> getMediaCollection(T resultFilter)
Returns the collection of all multimedia items matching the given result filter

Parameters:
resultFilter - used to constrain results
Returns:
a JiveIterator of all multimedia items matching the filter

getMediaCollection

<T extends MediaResultFilter> JiveIterator<? extends Media> getMediaCollection(TagSet tagSet,
                                                                               T resultFilter)
Returns the collection of all multimedia items within the given tag set matching the given result filter

Parameters:
tagSet - to limit results
resultFilter - used to constrain results
Returns:
a JiveIterator of all multimdia items tagged with a tag in the given tag set and matching the filter

move

void move(Media toMove,
          JiveContainer target)
          throws UnauthorizedException,
                 RejectedException
Moves a video from one container to another. For this to work, the user calling this method must have admin or moderator permissions for the container the media currently belongs to and the target container.

or be the author of the media and have rights to create new media in the target container

Parameters:
toMove - media to move to another container
target - the new container to move the media to
Throws:
UnauthorizedException - if does not have admin or moderator permissions for the thread's current container and the target container.
RejectedException - if the move is rejected for any reason

Jive Product Page

Copyright © 1999-2007 Jive Software.