com.brightcove.mediaapi.wrapper
Class ReadApi

java.lang.Object
  extended by com.brightcove.mediaapi.wrapper.ReadApi

public class ReadApi
extends java.lang.Object

This is a wrapper for the HTTP/JSON Media API provided by Brightcove (http://www.brightcove.com)

The purpose of this library is to provide a simple interface from Java applications to the Brightcove Media API. This class provides the interface to the READ portion of the Media API.

This library relies on several external libraries:

For more information on the Media API, see http://support.brightcove.com/en/docs/getting-started-media-api.

Author:
three4clavin

Constructor Summary
ReadApi()
          Default constructor
ReadApi(java.util.logging.Logger log)
          Constructor with logging
ReadApi(java.util.logging.Logger log, java.lang.String characterEncoding)
          Constructor with character set and logging
ReadApi(java.lang.String characterEncoding)
          Constructor with character set
 
Method Summary
 com.brightcove.commons.catalog.objects.Playlists FindAllPlaylists(java.lang.String readToken, java.lang.Integer pageSize, java.lang.Integer pageNumber, com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy, com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.PlaylistFieldEnum> playlistFields)
          Looks in the specified account for all playlists
 com.brightcove.commons.catalog.objects.Videos FindAllVideos(java.lang.String readToken, java.lang.Integer pageSize, java.lang.Integer pageNumber, com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy, com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for all videos
 com.brightcove.commons.catalog.objects.Videos FindModifiedVideos(java.lang.String readToken, java.lang.Long fromDate, java.util.Set<com.brightcove.commons.catalog.objects.enumerations.VideoStateFilterEnum> filter, java.lang.Integer pageSize, java.lang.Integer pageNumber, com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy, com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Gets all the videos that have been modified since the given time
 com.brightcove.commons.catalog.objects.Playlist FindPlaylistById(java.lang.String readToken, java.lang.Long playlistId, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.PlaylistFieldEnum> playlistFields)
          Looks in the specified account for the specified playlist
 com.brightcove.commons.catalog.objects.Playlist FindPlaylistByReferenceId(java.lang.String readToken, java.lang.String referenceId, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.PlaylistFieldEnum> playlistFields)
          Looks in the specified account for the specified playlist
 com.brightcove.commons.catalog.objects.Playlists FindPlaylistsByIds(java.lang.String readToken, java.util.Set<java.lang.Long> playlistIds, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.PlaylistFieldEnum> playlistFields)
          Looks in the specified account for the specified playlists
 com.brightcove.commons.catalog.objects.Playlists FindPlaylistsByReferenceIds(java.lang.String readToken, java.util.Set<java.lang.String> referenceIds, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.PlaylistFieldEnum> playlistFields)
          Looks in the specified account for the specified playlists
 com.brightcove.commons.catalog.objects.Playlists FindPlaylistsForPlayerId(java.lang.String readToken, java.lang.String playerId, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.PlaylistFieldEnum> playlistFields)
          Looks in the specified account for the specified playlists
 com.brightcove.commons.catalog.objects.Videos FindRelatedVideos(java.lang.String readToken, java.lang.Long videoId, java.lang.String referenceId, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for related videos.
 com.brightcove.commons.catalog.objects.Video FindVideoById(java.lang.String readToken, java.lang.Long videoId, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for a video with the specified video id (not the reference id).
 com.brightcove.commons.catalog.objects.Video FindVideoByIdUnfiltered(java.lang.String readToken, java.lang.Long videoId, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for a video with the specified video id (not the reference id).
 com.brightcove.commons.catalog.objects.Video FindVideoByReferenceId(java.lang.String readToken, java.lang.String referenceId, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for a video with the specified reference id (not the video id).
 com.brightcove.commons.catalog.objects.Video FindVideoByReferenceIdUnfiltered(java.lang.String readToken, java.lang.String referenceId, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for a video with the specified reference id (not the video id).
 com.brightcove.commons.catalog.objects.Videos FindVideosByCampaignId(java.lang.String readToken, java.lang.String campaignId, java.lang.Integer pageSize, java.lang.Integer pageNumber, com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy, com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Gets all the videos associated with the given campaign id.
 com.brightcove.commons.catalog.objects.Videos FindVideosByIds(java.lang.String readToken, java.util.Set<java.lang.Long> videoIds, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for videos with the specified video ids (not the reference id).
 com.brightcove.commons.catalog.objects.Videos FindVideosByIdsUnfiltered(java.lang.String readToken, java.util.Set<java.lang.Long> videoIds, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for videos with the specified video ids (not the reference id).
 com.brightcove.commons.catalog.objects.Videos FindVideosByReferenceIds(java.lang.String readToken, java.util.Set<java.lang.String> referenceIds, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for videos with the specified reference ids (not the video id).
 com.brightcove.commons.catalog.objects.Videos FindVideosByReferenceIdsUnfiltered(java.lang.String readToken, java.util.Set<java.lang.String> referenceIds, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Looks in the specified account for videos with the specified reference ids (not the video id).
 com.brightcove.commons.catalog.objects.Videos FindVideosByTags(java.lang.String readToken, java.util.Set<java.lang.String> andTags, java.util.Set<java.lang.String> orTags, java.lang.Integer pageSize, java.lang.Integer pageNumber, com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy, com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Performs a search on all the tags of the videos in this account, and returns a collection of videos that contain the specified tags.
 com.brightcove.commons.catalog.objects.Videos FindVideosByText(java.lang.String readToken, java.lang.String text, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Searches through all the videos in this account, and returns a collection of videos whose name, short description, or long description contain a match for the specified text
 com.brightcove.commons.catalog.objects.Videos FindVideosByUserId(java.lang.String readToken, java.lang.String userId, java.lang.Integer pageSize, java.lang.Integer pageNumber, com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy, com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Retrieves the videos uploaded by the specified user id.
 java.lang.String getDeliveryProtocol()
          For advanced users...
 java.lang.Boolean getEnableUds()
          Deprecated. 
 void OverrideHttpClientFactory(com.brightcove.commons.http.HttpClientFactory clientFactory)
          Overrides the standard factory used to create HTTPClients to connect to the Read API Server.
 void OverrideReadApiServerSettings(java.lang.String scheme, java.lang.String host, java.lang.Integer port, java.lang.String path)
          Overrides the standard Read API Server settings to make calls against a test/staging server.
 com.brightcove.commons.catalog.objects.Videos SearchVideos(java.lang.String readToken, java.util.List<java.lang.String> all, java.util.List<java.lang.String> any, java.util.List<java.lang.String> none, java.lang.Boolean exact, com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy, com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields, java.util.Set<java.lang.String> customFields)
          Searches videos according to the criteria provided by the user.
 void setBrightcoveExceptionHandler(BrightcoveExceptionHandler exceptionHandler)
           
 void setDeliveryProtocol(java.lang.String deliveryProtocol)
          For advanced users...
 void setEnableUds(java.lang.Boolean enableUds)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadApi

public ReadApi()

Default constructor

Creates a new Read API wrapper object with default settings


ReadApi

public ReadApi(java.util.logging.Logger log)

Constructor with logging

Creates a new Read API wrapper object with the following settings

Parameters:
log - java.util.logging.Logger object to log to

ReadApi

public ReadApi(java.lang.String characterEncoding)

Constructor with character set

Creates a new Read API wrapper object with the following settings

Parameters:
characterEncoding - Character encoding to use for HTTP URLs and responses

ReadApi

public ReadApi(java.util.logging.Logger log,
               java.lang.String characterEncoding)

Constructor with character set and logging

Creates a new Read API wrapper object with the following settings

Parameters:
log - java.util.logging.Logger object to log to
characterEncoding - Character encoding to use for HTTP URLs and responses
Method Detail

OverrideReadApiServerSettings

public void OverrideReadApiServerSettings(java.lang.String scheme,
                                          java.lang.String host,
                                          java.lang.Integer port,
                                          java.lang.String path)

Overrides the standard Read API Server settings to make calls against a test/staging server.

Parameters:
scheme - Protocol to use for call (usually http)
host - Host/IP address to call
port - Port to call on server
path - Path to API application on server

OverrideHttpClientFactory

public void OverrideHttpClientFactory(com.brightcove.commons.http.HttpClientFactory clientFactory)

Overrides the standard factory used to create HTTPClients to connect to the Read API Server.

Parameters:
clientFactory - HttpClientFactory to use to generate HttpClient objects

FindVideoById

public com.brightcove.commons.catalog.objects.Video FindVideoById(java.lang.String readToken,
                                                                  java.lang.Long videoId,
                                                                  java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                  java.util.Set<java.lang.String> customFields)
                                                           throws BrightcoveException

Looks in the specified account for a video with the specified video id (not the reference id).

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
videoId - Brightcove id for the video to look for
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
Video object matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Video can not be found
  • Response from the Media API couldn't be parsed

FindVideoByIdUnfiltered

public com.brightcove.commons.catalog.objects.Video FindVideoByIdUnfiltered(java.lang.String readToken,
                                                                            java.lang.Long videoId,
                                                                            java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                            java.util.Set<java.lang.String> customFields)
                                                                     throws BrightcoveException

Looks in the specified account for a video with the specified video id (not the reference id). This unfiltered version also returns videos that are unscheduled, inactive, or deleted

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
videoId - Brightcove id for the video to look for
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
Video object matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Video can not be found
  • Response from the Media API couldn't be parsed

FindAllVideos

public com.brightcove.commons.catalog.objects.Videos FindAllVideos(java.lang.String readToken,
                                                                   java.lang.Integer pageSize,
                                                                   java.lang.Integer pageNumber,
                                                                   com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy,
                                                                   com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType,
                                                                   java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                   java.util.Set<java.lang.String> customFields)
                                                            throws BrightcoveException

Looks in the specified account for all videos

Note that the Media API will only return at most 100 video per request. So to truly "find all videos", the caller must request "pages" of 1-100 videos at a time.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
pageSize - Number of videos per page (affects the number of videos returned by this call and the offset dictated by the pageNumber parameter)
pageNumber - Number of page to request (page size 100 and page number 1 returns videos 100-199)
sortBy - Sets the field to sort the videos on before cutting up the pages
sortOrderType - Sets the order to sort the videos in before cutting up the pages
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindRelatedVideos

public com.brightcove.commons.catalog.objects.Videos FindRelatedVideos(java.lang.String readToken,
                                                                       java.lang.Long videoId,
                                                                       java.lang.String referenceId,
                                                                       java.lang.Integer pageSize,
                                                                       java.lang.Integer pageNumber,
                                                                       java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                       java.util.Set<java.lang.String> customFields)
                                                                throws BrightcoveException

Looks in the specified account for related videos.

From http://docs.brightcove.com/en/media/:
Finds videos related to the given video. Combines the name and short description of the given video and searches for any partial matches in the name, description, and tags of all videos in the Brightcove media library for this account. More precise ways of finding related videos include tagging your videos by subject and using the find_videos_by_tags method to find videos that share the same tags: or creating a playlist that includes videos that you know are related.

Parameters:
readToken - The authentication token provided to authorize using the Media APIs. A string, generally ending in . (dot).
videoId - The id of the video we'd like related videos for. Optional (pass null to omit)
referenceId - The publisher-assigned reference id of the video we'd like related videos for. Optional (pass null to omit)
pageSize - Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100. Optional (pass null to omit)
pageNumber - The zero-indexed number of the page to return. Optional (pass null to omit)
videoFields - Set of video fields to populate on the returned Video object.
customFields - Set of custom fields to populate on the returned Video object.
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindVideosByIds

public com.brightcove.commons.catalog.objects.Videos FindVideosByIds(java.lang.String readToken,
                                                                     java.util.Set<java.lang.Long> videoIds,
                                                                     java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                     java.util.Set<java.lang.String> customFields)
                                                              throws BrightcoveException

Looks in the specified account for videos with the specified video ids (not the reference id).

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
videoIds - Brightcove ids for the videos to look for
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Response from the Media API couldn't be parsed

FindVideosByIdsUnfiltered

public com.brightcove.commons.catalog.objects.Videos FindVideosByIdsUnfiltered(java.lang.String readToken,
                                                                               java.util.Set<java.lang.Long> videoIds,
                                                                               java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                               java.util.Set<java.lang.String> customFields)
                                                                        throws BrightcoveException

Looks in the specified account for videos with the specified video ids (not the reference id). This unfiltered version also returns videos that are unscheduled, inactive, or deleted

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
videoIds - Brightcove ids for the videos to look for
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Response from the Media API couldn't be parsed

FindVideoByReferenceId

public com.brightcove.commons.catalog.objects.Video FindVideoByReferenceId(java.lang.String readToken,
                                                                           java.lang.String referenceId,
                                                                           java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                           java.util.Set<java.lang.String> customFields)
                                                                    throws BrightcoveException

Looks in the specified account for a video with the specified reference id (not the video id).

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
referenceId - Custom reference id for the video to look for
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
Video object matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Video can not be found
  • Response from the Media API couldn't be parsed

FindVideoByReferenceIdUnfiltered

public com.brightcove.commons.catalog.objects.Video FindVideoByReferenceIdUnfiltered(java.lang.String readToken,
                                                                                     java.lang.String referenceId,
                                                                                     java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                                     java.util.Set<java.lang.String> customFields)
                                                                              throws BrightcoveException

Looks in the specified account for a video with the specified reference id (not the video id). This unfiltered version also returns videos that are unscheduled, inactive, or deleted

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
referenceId - Custom reference id for the video to look for
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
Video object matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Video can not be found
  • Response from the Media API couldn't be parsed

FindVideosByReferenceIdsUnfiltered

public com.brightcove.commons.catalog.objects.Videos FindVideosByReferenceIdsUnfiltered(java.lang.String readToken,
                                                                                        java.util.Set<java.lang.String> referenceIds,
                                                                                        java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                                        java.util.Set<java.lang.String> customFields)
                                                                                 throws BrightcoveException

Looks in the specified account for videos with the specified reference ids (not the video id). This unfiltered version also returns videos that are unscheduled, inactive, or deleted

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
referenceIds - Reference ids for the videos to look for
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • One or more Reference Ids contains a comma
  • Response from the Media API couldn't be parsed

FindVideosByReferenceIds

public com.brightcove.commons.catalog.objects.Videos FindVideosByReferenceIds(java.lang.String readToken,
                                                                              java.util.Set<java.lang.String> referenceIds,
                                                                              java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                              java.util.Set<java.lang.String> customFields)
                                                                       throws BrightcoveException

Looks in the specified account for videos with the specified reference ids (not the video id).

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
referenceIds - Reference ids for the videos to look for
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • One or more Reference Ids contains a comma
  • Response from the Media API couldn't be parsed

FindVideosByUserId

public com.brightcove.commons.catalog.objects.Videos FindVideosByUserId(java.lang.String readToken,
                                                                        java.lang.String userId,
                                                                        java.lang.Integer pageSize,
                                                                        java.lang.Integer pageNumber,
                                                                        com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy,
                                                                        com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType,
                                                                        java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                        java.util.Set<java.lang.String> customFields)
                                                                 throws BrightcoveException

Retrieves the videos uploaded by the specified user id. This method can be used to find videos submitted using the consumer- generated media (CGM) module.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
userId - The id of the user whose videos we'd like to retrieve
pageSize - Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100. Optional (pass null to omit)
pageNumber - The zero-indexed number of the page to return. Optional (pass null to omit)
sortBy - Sets the field to sort the videos on before cutting up the pages
sortOrderType - Sets the order to sort the videos in before cutting up the pages
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindVideosByCampaignId

public com.brightcove.commons.catalog.objects.Videos FindVideosByCampaignId(java.lang.String readToken,
                                                                            java.lang.String campaignId,
                                                                            java.lang.Integer pageSize,
                                                                            java.lang.Integer pageNumber,
                                                                            com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy,
                                                                            com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType,
                                                                            java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                            java.util.Set<java.lang.String> customFields)
                                                                     throws BrightcoveException

Gets all the videos associated with the given campaign id. Campaigns are a feature of the consumer-generated media (CGM) module

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
campaignId - The id of the campaign you'd like to fetch videos for
pageSize - Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100. Optional (pass null to omit)
pageNumber - The zero-indexed number of the page to return. Optional (pass null to omit)
sortBy - Sets the field to sort the videos on before cutting up the pages
sortOrderType - Sets the order to sort the videos in before cutting up the pages
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindModifiedVideos

public com.brightcove.commons.catalog.objects.Videos FindModifiedVideos(java.lang.String readToken,
                                                                        java.lang.Long fromDate,
                                                                        java.util.Set<com.brightcove.commons.catalog.objects.enumerations.VideoStateFilterEnum> filter,
                                                                        java.lang.Integer pageSize,
                                                                        java.lang.Integer pageNumber,
                                                                        com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy,
                                                                        com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType,
                                                                        java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                        java.util.Set<java.lang.String> customFields)
                                                                 throws BrightcoveException

Gets all the videos that have been modified since the given time

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
fromDate - The date, specified in minutes since January 1st, 1970 00:00:00 GMT, of the oldest Video which you would like returned
filter - Filters the set of videos to return
pageSize - Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100. Optional (pass null to omit)
pageNumber - The zero-indexed number of the page to return. Optional (pass null to omit)
sortBy - Sets the field to sort the videos on before cutting up the pages
sortOrderType - Sets the order to sort the videos in before cutting up the pages
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

SearchVideos

public com.brightcove.commons.catalog.objects.Videos SearchVideos(java.lang.String readToken,
                                                                  java.util.List<java.lang.String> all,
                                                                  java.util.List<java.lang.String> any,
                                                                  java.util.List<java.lang.String> none,
                                                                  java.lang.Boolean exact,
                                                                  com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy,
                                                                  com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType,
                                                                  java.lang.Integer pageSize,
                                                                  java.lang.Integer pageNumber,
                                                                  java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                  java.util.Set<java.lang.String> customFields)
                                                           throws BrightcoveException

Searches videos according to the criteria provided by the user. The criteria are constructed using field/value pairs specified in the command.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
all - (optional) Specifies the field:value pairs for search criteria that MUST be present in the index in order to return a hit in the result set. The format is fieldName:value. If the field's name is not present, it is assumed to be name and shortDescription.
any - (optional) Specifies the field:value pairs for search criteria AT LEAST ONE of which must be present to return a hit in the result set. The format is fieldName:value. If the field's name is not present, it is assumed to be name and shortDescription.
none - (optional) Specifies the field:value pairs for search criteria that MUST NOT be present to return a hit in the result set. The format is fieldName:value. If the field's name is not present, it is assumed to be name and shortDescription.
exact - (optional) Boolean If true, disables fuzzy search and requires an exact match of search terms. A fuzzy search does not require an exact match of the indexed terms, but will return a hit for terms that are closely related based on language-specific criteria. The fuzzy search is available only if your account is based in the United States.
sortBy - Sets the field to sort the videos on before cutting up the pages
sortOrderType - Sets the order to sort the videos in before cutting up the pages
pageSize - (optional) Integer Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100.
pageNumber - (optional) Integer The zero-indexed number of the page to return.
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindVideosByText

public com.brightcove.commons.catalog.objects.Videos FindVideosByText(java.lang.String readToken,
                                                                      java.lang.String text,
                                                                      java.lang.Integer pageSize,
                                                                      java.lang.Integer pageNumber,
                                                                      java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                      java.util.Set<java.lang.String> customFields)
                                                               throws BrightcoveException

Searches through all the videos in this account, and returns a collection of videos whose name, short description, or long description contain a match for the specified text

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
text - The text we're searching for
pageSize - Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100. Optional (pass null to omit)
pageNumber - The zero-indexed number of the page to return. Optional (pass null to omit)
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindVideosByTags

public com.brightcove.commons.catalog.objects.Videos FindVideosByTags(java.lang.String readToken,
                                                                      java.util.Set<java.lang.String> andTags,
                                                                      java.util.Set<java.lang.String> orTags,
                                                                      java.lang.Integer pageSize,
                                                                      java.lang.Integer pageNumber,
                                                                      com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy,
                                                                      com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType,
                                                                      java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                      java.util.Set<java.lang.String> customFields)
                                                               throws BrightcoveException

Performs a search on all the tags of the videos in this account, and returns a collection of videos that contain the specified tags. Note that tags are not case-sensitive

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
andTags - Limit the results to those that contain all of these tags
orTags - Limit the results to those that contain at least one of these tags
pageSize - Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100. Optional (pass null to omit)
pageNumber - The zero-indexed number of the page to return. Optional (pass null to omit)
videoFields - Set of video fields to populate on the returned Video object
customFields - Set of custom fields to populate on the returned Video object
Returns:
List of Video objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many videos per page
  • Response from the Media API couldn't be parsed

FindAllPlaylists

public com.brightcove.commons.catalog.objects.Playlists FindAllPlaylists(java.lang.String readToken,
                                                                         java.lang.Integer pageSize,
                                                                         java.lang.Integer pageNumber,
                                                                         com.brightcove.commons.catalog.objects.enumerations.SortByTypeEnum sortBy,
                                                                         com.brightcove.commons.catalog.objects.enumerations.SortOrderTypeEnum sortOrderType,
                                                                         java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                         java.util.Set<java.lang.String> customFields,
                                                                         java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.PlaylistFieldEnum> playlistFields)
                                                                  throws BrightcoveException

Looks in the specified account for all playlists

Note that the Media API will only return at most 100 playlists per request. So to truly "find all videos", the caller must request "pages" of 1-100 playlists at a time.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
pageSize - Number of playlists per page (affects the number of playlists returned by this call and the offset dictated by the pageNumber parameter)
pageNumber - Number of page to request (page size 100 and page number 1 returns playlists 100-199)
sortBy - Sets the field to sort the playlists on before cutting up the pages
sortOrderType - Sets the order to sort the playlists in before cutting up the pages
videoFields - Set of video fields to populate on the returned Video objects
customFields - Set of custom fields to populate on the returned Video objects
playlistFields - A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields.
Returns:
List of Playlist objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many playlists per page
  • Response from the Media API couldn't be parsed

FindPlaylistById

public com.brightcove.commons.catalog.objects.Playlist FindPlaylistById(java.lang.String readToken,
                                                                        java.lang.Long playlistId,
                                                                        java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                        java.util.Set<java.lang.String> customFields,
                                                                        java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.PlaylistFieldEnum> playlistFields)
                                                                 throws BrightcoveException

Looks in the specified account for the specified playlist

Finds a particular playlist based on its id.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
playlistId - The id of the playlist requested.
videoFields - Set of video fields to populate on the returned Video objects
customFields - Set of custom fields to populate on the returned Video objects
playlistFields - A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields.
Returns:
Playlist requested
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Playlist requested does not exist
  • Response from the Media API couldn't be parsed

FindPlaylistByReferenceId

public com.brightcove.commons.catalog.objects.Playlist FindPlaylistByReferenceId(java.lang.String readToken,
                                                                                 java.lang.String referenceId,
                                                                                 java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                                 java.util.Set<java.lang.String> customFields,
                                                                                 java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.PlaylistFieldEnum> playlistFields)
                                                                          throws BrightcoveException

Looks in the specified account for the specified playlist

Finds a particular playlist based on its reference id.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
referenceId - The reference id of the playlist requested.
videoFields - Set of video fields to populate on the returned Video objects
customFields - Set of custom fields to populate on the returned Video objects
playlistFields - A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields.
Returns:
Playlist requested
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Playlist requested does not exist
  • Response from the Media API couldn't be parsed

FindPlaylistsByIds

public com.brightcove.commons.catalog.objects.Playlists FindPlaylistsByIds(java.lang.String readToken,
                                                                           java.util.Set<java.lang.Long> playlistIds,
                                                                           java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                           java.util.Set<java.lang.String> customFields,
                                                                           java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.PlaylistFieldEnum> playlistFields)
                                                                    throws BrightcoveException

Looks in the specified account for the specified playlists

Finds particular playlists based on ids.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
playlistIds - The ids of the playlists requested.
videoFields - Set of video fields to populate on the returned Video objects
customFields - Set of custom fields to populate on the returned Video objects
playlistFields - A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields.
Returns:
List of Playlist objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many playlists per page
  • Response from the Media API couldn't be parsed

FindPlaylistsByReferenceIds

public com.brightcove.commons.catalog.objects.Playlists FindPlaylistsByReferenceIds(java.lang.String readToken,
                                                                                    java.util.Set<java.lang.String> referenceIds,
                                                                                    java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                                    java.util.Set<java.lang.String> customFields,
                                                                                    java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.PlaylistFieldEnum> playlistFields)
                                                                             throws BrightcoveException

Looks in the specified account for the specified playlists

Finds particular playlists based on reference ids.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
referenceIds - The reference ids of the playlists requested.
videoFields - Set of video fields to populate on the returned Video objects
customFields - Set of custom fields to populate on the returned Video objects
playlistFields - A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields.
Returns:
List of Playlist objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • Response from the Media API couldn't be parsed

FindPlaylistsForPlayerId

public com.brightcove.commons.catalog.objects.Playlists FindPlaylistsForPlayerId(java.lang.String readToken,
                                                                                 java.lang.String playerId,
                                                                                 java.lang.Integer pageSize,
                                                                                 java.lang.Integer pageNumber,
                                                                                 java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.VideoFieldEnum> videoFields,
                                                                                 java.util.Set<java.lang.String> customFields,
                                                                                 java.util.EnumSet<com.brightcove.commons.catalog.objects.enumerations.PlaylistFieldEnum> playlistFields)
                                                                          throws BrightcoveException

Looks in the specified account for the specified playlists

Finds particular playlists based on player id.

Parameters:
readToken - Read Media API token for the account. Note that the privileges of the token can change the fields populated in the returned Video object.
playerId - The player id whose playlists we want to return.
pageSize - Number of playlists per page (affects the number of playlists returned by this call and the offset dictated by the pageNumber parameter)
pageNumber - Number of page to request (page size 100 and page number 1 returns playlists 100-199)
videoFields - Set of video fields to populate on the returned Video objects
customFields - Set of custom fields to populate on the returned Video objects
playlistFields - A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields.
Returns:
List of Playlist objects matching criteria
Throws:
BrightcoveException - If any of the following are true:
  • Request to the Media API fails
  • Media API reports an error with the request
  • User requests too many playlists per page
  • Response from the Media API couldn't be parsed

setEnableUds

@Deprecated
public void setEnableUds(java.lang.Boolean enableUds)
Deprecated. 

For advanced users...

If true, forces the returned URLs in Renditions to be Progressive Download instead of streaming. Note that in order for this to work, your account must be enabled for Universal Delivery - something that can only be done by Brightcove Support.

Deprecated:Use the DeliveryProtocol instead.


getEnableUds

@Deprecated
public java.lang.Boolean getEnableUds()
Deprecated. 

For advanced users...

If true, forces the returned URLs in Renditions to be Progressive Download instead of streaming. Note that in order for this to work, your account must be enabled for Universal Delivery - something that can only be done by Brightcove Support.

Deprecated:Use the DeliveryProtocol instead.

Returns:
Whether or not UDS URLs should be returned by the Media API

setDeliveryProtocol

public void setDeliveryProtocol(java.lang.String deliveryProtocol)

For advanced users...

Sets delivery protocal for UDS/PD delivery ("http") or iOS delivery ("http_ios"). Note that in order for UDS/PD to work, your account must be enabled for Universal Delivery - something that can only be done by Brightcove Support.


getDeliveryProtocol

public java.lang.String getDeliveryProtocol()

For advanced users...

Gets delivery protocal for UDS/PD delivery ("http") or iOS delivery ("http_ios"). Note that in order for UDS/PD to work, your account must be enabled for Universal Delivery - something that can only be done by Brightcove Support.

Returns:
Whether or not UDS URLs should be returned by the Media API

setBrightcoveExceptionHandler

public void setBrightcoveExceptionHandler(BrightcoveExceptionHandler exceptionHandler)


http://opensource.brightcove.com/.