类 VodClient


  • public class VodClient
    extends AbstractBceClient
    Provides the client for accessing the Baidu MediaResource-On-Demand Service.
    • 构造器详细资料

      • VodClient

        public VodClient​(BceClientConfiguration vodConfig)
        Constructs a new client using the client configuration.
        参数:
        vodConfig - The client configuration options controlling how this client connects to Vod services (e.g. proxy settings, retry counts, etc).
      • VodClient

        public VodClient​(BceClientConfiguration vodConfig,
                         BosClientConfiguration bosConfig)
        Constructs a new client using the client configuration. Used for test only
        参数:
        vodConfig - The client configuration options controlling how this client connects to Vod services (e.g. proxy settings, retry counts, etc).
    • 方法详细资料

      • createMediaResource

        public CreateMediaResourceResponse createMediaResource​(String title,
                                                               String description,
                                                               File file,
                                                               String transcodingPresetGroupName,
                                                               int priority)
                                                        throws FileNotFoundException
        Uploads the specified file to Bos under the specified bucket and key name.
        参数:
        title - media title.
        description - media description.
        file - The file containing the data to be uploaded to VOD.
        transcodingPresetGroupName - set transcoding presetgroup name, if NULL, use default
        priority - set transcoding priority[0,9], lowest priority is 0. Only effect your own task
        返回:
        A PutObjectResponse object containing the information returned by Bos for the newly created object.
        抛出:
        FileNotFoundException
      • createMediaResource

        public CreateMediaResourceResponse createMediaResource​(String title,
                                                               String description,
                                                               File file,
                                                               String transcodingPresetGroupName,
                                                               int priority,
                                                               String mode)
                                                        throws FileNotFoundException
        Uploads the specified file to Bos under the specified bucket and key name.
        参数:
        title - media title.
        description - media description.
        file - The file containing the data to be uploaded to VOD.
        transcodingPresetGroupName - set transcoding presetgroup name, if NULL, use default
        priority - set transcoding priority[0,9], lowest priority is 0. Only effect your own task
        mode - the mode of the media resource
        返回:
        A PutObjectResponse object containing the information returned by Bos for the newly created object.
        抛出:
        FileNotFoundException
      • createMediaResource

        public CreateMediaResourceResponse createMediaResource​(String title,
                                                               String description,
                                                               File file,
                                                               String transcodingPresetGroupName,
                                                               int priority,
                                                               String mode,
                                                               ActionAttributes actionAttributes)
                                                        throws FileNotFoundException
        Uploads the specified file to Bos under the specified bucket and key name.
        参数:
        title - media title.
        description - media description.
        file - The file containing the data to be uploaded to VOD.
        transcodingPresetGroupName - set transcoding presetgroup name, if NULL, use default
        priority - set transcoding priority[0,9], lowest priority is 0. Only effect your own task
        mode - the mode of the media resource
        actionAttributes - the action attributes
        返回:
        A PutObjectResponse object containing the information returned by Bos for the newly created object.
        抛出:
        FileNotFoundException
      • createMediaResource

        public CreateMediaResourceResponse createMediaResource​(String sourceBucket,
                                                               String sourceKey,
                                                               String title,
                                                               String description,
                                                               String transcodingPresetGroupName,
                                                               int priority)
        Load a media resource from BOS to VOD.
        参数:
        sourceBucket - The bucket name of the media resource in BOS
        sourceKey - The key name of the media resource in BOS
        title - The title string of the media resource
        description - The description string of the media resource
        transcodingPresetGroupName - set transcoding presetgroup name, if NULL, use default
        priority - set transcoding priority[0,9], lowest priority is 0. Only effect your own jobs
        返回:
        A PutObjectResponse object containing the information returned by Bos for the newly created object.
      • createMediaResource

        public CreateMediaResourceResponse createMediaResource​(String sourceBucket,
                                                               String sourceKey,
                                                               String title,
                                                               String description,
                                                               String transcodingPresetGroupName,
                                                               int priority,
                                                               String mode)
        Load a media resource from BOS to VOD.
        参数:
        sourceBucket - The bucket name of the media resource in BOS
        sourceKey - The key name of the media resource in BOS
        title - The title string of the media resource
        description - The description string of the media resource
        transcodingPresetGroupName - set transcoding presetgroup name, if NULL, use default
        priority - set transcoding priority[0,9], lowest priority is 0. Only effect your own jobs
        mode - the mode of the media resource
        返回:
        A PutObjectResponse object containing the information returned by Bos for the newly created object.
      • createMediaResource

        public CreateMediaResourceResponse createMediaResource​(String sourceBucket,
                                                               String sourceKey,
                                                               String title,
                                                               String description,
                                                               String transcodingPresetGroupName,
                                                               int priority,
                                                               String mode,
                                                               ActionAttributes actionAttributes)
        Load a media resource from BOS to VOD.
        参数:
        sourceBucket - The bucket name of the media resource in BOS
        sourceKey - The key name of the media resource in BOS
        title - The title string of the media resource
        description - The description string of the media resource
        transcodingPresetGroupName - set transcoding presetgroup name, if NULL, use default
        priority - set transcoding priority[0,9], lowest priority is 0. Only effect your own jobs
        mode - the mode of the media resource
        actionAttributes - the action attributes
        返回:
        A PutObjectResponse object containing the information returned by Bos for the newly created object.
      • createMediaResource

        public CreateMediaResourceResponse createMediaResource​(String sourceUrl,
                                                               String title,
                                                               String description,
                                                               String transcodingPresetGroupName,
                                                               int priority)
        Load a media resource from URL to VOD.
        参数:
        sourceUrl - The source url of the media resource
        title - The title string of the media resource
        description - The description string of the media resource
        transcodingPresetGroupName - set transcoding presetgroup name, if NULL, use default
        priority - set transcoding priority[0,9], lowest priority is 0. Only effect your own jobs
        返回:
        A PutObjectResponse object containing the information returned by Bos for the newly created object.
      • createMediaResource

        public CreateMediaResourceResponse createMediaResource​(String sourceUrl,
                                                               String title,
                                                               String description,
                                                               String transcodingPresetGroupName,
                                                               int priority,
                                                               String mode)
        Load a media resource from URL to VOD.
        参数:
        sourceUrl - The source url of the media resource
        title - The title string of the media resource
        description - The description string of the media resource
        transcodingPresetGroupName - set transcoding presetgroup name, if NULL, use default
        priority - set transcoding priority[0,9], lowest priority is 0. Only effect your own jobs
        mode - the mode of the media resource
        返回:
        A PutObjectResponse object containing the information returned by Bos for the newly created object.
      • createMediaResource

        public CreateMediaResourceResponse createMediaResource​(String sourceUrl,
                                                               String title,
                                                               String description,
                                                               String transcodingPresetGroupName,
                                                               int priority,
                                                               String mode,
                                                               ActionAttributes actionAttributes)
        Load a media resource from URL to VOD.
        参数:
        sourceUrl - The source url of the media resource
        title - The title string of the media resource
        description - The description string of the media resource
        transcodingPresetGroupName - set transcoding presetgroup name, if NULL, use default
        priority - set transcoding priority[0,9], lowest priority is 0. Only effect your own jobs
        mode - the mode of the media resource
        actionAttributes - the action attributes
        返回:
        A PutObjectResponse object containing the information returned by Bos for the newly created object.
      • getMediaResource

        public GetMediaResourceResponse getMediaResource​(String mediaId)
        Gets the properties of specific media resource managed by VOD service.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        mediaId - The unique ID for each media resource
        返回:
        The properties of the specific media resource
      • getMediaResource

        public GetMediaResourceResponse getMediaResource​(GetMediaResourceRequest request)
        Gets the properties of specific media resource managed by VOD service.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        request - The request wrapper object containing all options.
        返回:
        The properties of the specific media resource
      • getPartMediaResource

        public GetPartMediaResourceResponse getPartMediaResource​(String mediaId,
                                                                 String scope,
                                                                 String taskId)
        Gets a part of properties of specific media resource managed by VOD service.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        mediaId - The unique ID for each media resource
        scope - The scope of query, such as 'thumbnail'
        taskId - The sign of scope, when scope is thumbnail, taskId can be: default second wonderful
        返回:
        A part of the properties of the specific media resource
      • getPartMediaResource

        public GetPartMediaResourceResponse getPartMediaResource​(GetPartMediaResourceRequest request)
        Gets the properties of specific media resource managed by VOD service.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        request - The request wrapper object containing all options.
        返回:
        A part of the properties of the specific media resource
      • listMediaResources

        public ListMediaResourceResponse listMediaResources​(int pageNo,
                                                            int pageSize,
                                                            String status,
                                                            Date begin,
                                                            Date end,
                                                            String title)
        List the properties of all media resource managed by VOD service. recommend use marker mode to get high performance

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        pageNo - The pageNo need to list, must be greater than 0
        pageSize - The pageSize ,must in range [LIST_MIN_PAGESIZE,LIST_MAX_PAGESIZE]
        status - The media status, can be null
        begin - The media create date after begin
        end - The media create date before end
        title - The media title, use prefix search
        返回:
        The properties of all specific media resources
      • listMediaResources

        public ListMediaResourceResponse listMediaResources​(ListMediaResourceRequest request)
        List the properties of all media resource managed by VOD service.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        request - The request wrapper object containing all options.
        返回:
        The properties of all specific media resources
      • listMediaResourcesByMarker

        public ListMediaResourceByMarkerResponse listMediaResourcesByMarker​(String marker,
                                                                            int maxSize,
                                                                            String status,
                                                                            Date begin,
                                                                            Date end,
                                                                            String title)
        Use marker mode to List the properties of all media resource managed by VOD service. If media size beyond 1000, strongly recommend to use marker mode

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        marker - The marker labels the query begining; first query use NULL.
        maxSize - The maxSize returned ,must in range [LIST_MIN_PAGESIZE,LIST_MAX_PAGESIZE]
        status - The media status, can be null
        begin - The media create date after begin
        end - The media create date before end
        title - The media title, use prefix search
        返回:
        The properties of all specific media resources
      • listMediaResourcesByMarker

        public ListMediaResourceByMarkerResponse listMediaResourcesByMarker​(ListMediaResourceByMarkerRequest request)
        List the properties of all media resource managed by VOD service.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        request - The request wrapper object containing all options.
        返回:
        The properties of all specific media resources
      • updateMediaResource

        public UpdateMediaResourceResponse updateMediaResource​(String mediaId,
                                                               String title,
                                                               String description)
        Update the title and description for the specific media resource managed by VOD service.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        mediaId - The unique ID for each media resource
        title - New title string
        description - New description string
        返回:
        empty response will be returned
      • updateMediaResource

        public UpdateMediaResourceResponse updateMediaResource​(UpdateMediaResourceRequest request)
        Update the title and description for the specific media resource managed by VOD service.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        request - The request wrapper object containing all options.
        返回:
        empty response will be returned
      • stopMediaResource

        public StopMediaResourceResponse stopMediaResource​(String mediaId)
        Stop the specific media resource managed by VOD service, so that it can not be access and played. Disabled media resource can be recovered by method publishMediaResource() later.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        mediaId - The unique ID for each media resource
        返回:
        empty response will be returned
      • stopMediaResource

        public StopMediaResourceResponse stopMediaResource​(StopMediaResourceRequest request)
        Stop the specific media resource managed by VOD service, so that it can not be access and played. Disabled media resource can be recovered by method publishMediaResource() later.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        request - The request object containing all the options on how to
        返回:
        empty response will be returned
      • publishMediaResource

        public PublishMediaResourceResponse publishMediaResource​(String mediaId)
        Publish the specific media resource managed by VOD service, so that it can be access and played.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        mediaId - The unique ID for each media resource
        返回:
        empty response will be returned
      • publishMediaResource

        public PublishMediaResourceResponse publishMediaResource​(PublishMediaResourceRequest request)
        Publish the specific media resource managed by VOD service, so that it can be access and played.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        request - The request object containing all the options on how to
        返回:
        empty response will be returned
      • deleteMediaResource

        public DeleteMediaResourceResponse deleteMediaResource​(String mediaId)
        Delete the specific media resource managed by VOD service.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        mediaId - The unique ID for each media resource
        返回:
        empty response will be returned
      • deleteMediaResource

        public DeleteMediaResourceResponse deleteMediaResource​(DeleteMediaResourceRequest request)
        Delete the specific media resource managed by VOD service.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        request - The request object containing all the options on how to
        返回:
        empty response will be returned
      • generateMediaDeliveryInfo

        public GenerateMediaDeliveryInfoResponse generateMediaDeliveryInfo​(String mediaId,
                                                                           String transcodingPresetName)
        Generate media delivery info by media ID.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        mediaId - The unique ID for each media resource
        返回:
        media delivery info
      • generateMediaDeliveryInfo

        public GenerateMediaDeliveryInfoResponse generateMediaDeliveryInfo​(GenerateMediaDeliveryInfoRequest request)
        Delete the specific media resource managed by VOD service.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        request - The request object containing all the options on how to
        返回:
        empty response will be returned
      • generateMediaPlayerCode

        public GenerateMediaPlayerCodeResponse generateMediaPlayerCode​(String mediaId,
                                                                       int width,
                                                                       int height,
                                                                       boolean autoStart,
                                                                       String transcodingPresetName)
        Get the HTML5 code snippet (encoded in Base64) to play the specific media resource.
        参数:
        mediaId - The unique ID for each media resource
        width - The width of player view
        height - The height of player view
        autoStart - Indicate whether or not play the media resource automatically when web page is loaded.
        返回:
        The Flash and HTML5 code snippet
      • generateMediaPlayerCode

        public GenerateMediaPlayerCodeResponse generateMediaPlayerCode​(GenerateMediaPlayerCodeRequest request)
        Get the HTML5 code snippet (encoded in Base64) to play the specific media resource.
        参数:
        request - The request object containing all the options on how to
        返回:
        The Flash and HTML5 code snippet
      • getMediaStatistic

        public GetMediaStatisticResponse getMediaStatistic​(String mediaId,
                                                           Date startTime,
                                                           Date endTime,
                                                           boolean aggregate)
        get media statistic info.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        startTime - , query media start time, default:2016-04-30T16:00:00Z
        endTime - , query media end time, default:now
        aggregate - , if need aggregate, default: true
        返回:
        The media statistic info
      • getMediaStatistic

        public GetMediaStatisticResponse getMediaStatistic​(GetMediaStatisticRequest request)
        get media statistic info.

        The caller must authenticate with a valid BCE Access Key / Private Key pair.

        参数:
        request - The request wrapper object containing all options.
        返回:
        The media statistic info
      • reTranscode

        public ReTranscodeResponse reTranscode​(String mediaId)
        Transcode the media again. Only status is FAILED or PUBLISHED media can use.
        参数:
        mediaId - The unique ID for each media resource
        返回:
      • reTranscode

        public ReTranscodeResponse reTranscode​(ReTranscodeRequest request)
        Transcode the media again. Only status is FAILED or PUBLISHED media can use.
        参数:
        request - The request object containing mediaid
        返回:
      • getMediaSourceDownload

        public GetMediaSourceDownloadResponse getMediaSourceDownload​(String mediaId,
                                                                     long expiredInSeconds)
        get media source download url.
        参数:
        mediaId - The unique ID for each media resource
        expiredInSeconds - The expire time
        返回:
      • listNotifications

        public ListNotificationsResponse listNotifications()
        List all your doc notifications.
        返回:
        The list of all your doc notifications
      • deleteNotification

        public DeleteNotificationResponse deleteNotification​(String name)
        Delete your doc notification by doc notification name.
        参数:
        name - doc notification name.
      • deleteNotification

        public DeleteNotificationResponse deleteNotification​(DeleteNotificationRequest request)
        Delete your doc notification by doc notification name.
        参数:
        request - The request object containing all parameters for deleting dco notification.
      • getNotification

        public GetNotificationResponse getNotification​(String name)
        Get your doc notification by doc notification name.
        参数:
        name - doc notification name.
        返回:
        Your doc notification.
      • getNotification

        public GetNotificationResponse getNotification​(GetNotificationRequest request)
        Get your doc notification by doc notification name.
        参数:
        request - The request object containing all parameters for getting doc notification.
        返回:
        Your doc notification.
      • createNotification

        public CreateNotificationResponse createNotification​(String name,
                                                             String endpoint)
        Create a doc notification in the doc stream service.
        参数:
        name - The name of notification.
        endpoint - The address to receive notification message.
      • createNotification

        public CreateNotificationResponse createNotification​(CreateNotificationRequest request)
        Create a doc notification in the doc stream service.
        参数:
        request - The request object containing all options for creating doc notification.
      • isRegionSupported

        public boolean isRegionSupported()
        从类复制的说明: AbstractBceClient
        Returns true if the target service supports regions.

        The result will impact the construction of default service endpoint.

        覆盖:
        isRegionSupported 在类中 AbstractBceClient
        返回:
        true if the target service supports regions.