Package com.brightcove.zencoder.client
Class ZencoderClient
java.lang.Object
com.brightcove.zencoder.client.ZencoderClient
public class ZencoderClient extends Object
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ZencoderClient(String api_key)
-
Method Summary
Modifier and Type Method Description void
cancelJob(String id)
If you wish to cancel a job that has not yet finished processing.ZencoderAccount
createAccount(ZencoderAccount account)
Creates a Zencoder Account.protected org.codehaus.jackson.map.ObjectMapper
createObjectMapper()
Abstracted out for easier testing.ZencoderCreateJobResponse
createZencoderJob(ZencoderCreateJobRequest job)
Creates a VOD transcode job.void
finishLiveJob(String id)
Finishes the input on a Live streaming job.ZencoderAccountDetails
getAccountDetails()
Retrieve your Zencoder Account DetailsString
getApiKey()
String
getApiUrl()
ZencoderMediaFile
getInputDetails(String id)
Gets the details of a given input.ZencoderInputOutputProgress
getInputProgress(String id)
Gets progress information about an existing VOD transcode input.ZencoderJobProgress
getJobProgress(String id)
Gets progress information about an existing VOD transcode job.ZencoderMediaFile
getOutputDetails(String id)
Gets the details of a given output.ZencoderInputOutputProgress
getOutputProgress(String id)
Gets progress information about an existing VOD transcode output.org.springframework.web.client.RestTemplate
getRestTemplate()
ZencoderLiveUsage
getUsageForLive(Date from, Date to, String grouping)
The Live usage for the specified time period.ZencoderVodUsage
getUsageForVod(Date from, Date to, String grouping)
The VOD usage for the specified time period.ZencoderAllUsage
getUsageForVodAndLive(Date from, Date to, String grouping)
The VOD+Live usage for the specified time period.ZencoderJobDetail
getZencoderJob(String id)
Gets details about an existing VOD transcode job.List<ZencoderJobDetail>
listJobs()
Lists the most recent jobs created (up to 50)List<ZencoderJobDetail>
listJobs(Integer page, Integer per_page)
Lists jobs with pagination.ZencoderJobFinishedNotificationResponse
parseJobFinishedNotificationResponse(org.springframework.http.HttpEntity<String> entity)
Parses payload from Zencoder notification.void
resubmitJob(String id)
If a job has failed processing you may request that it be attempted again.void
setAccountIntegrationMode(boolean integration_mode)
Sets whether or not your account should be in the limited integration mode.void
setApiKey(String api_key)
void
setApiUrl(String api_url)
void
setRestTemplate(org.springframework.web.client.RestTemplate rt)
-
Field Details
-
API_URL
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
createObjectMapper
protected org.codehaus.jackson.map.ObjectMapper createObjectMapper()Abstracted out for easier testing. -
getApiKey
-
setApiKey
-
getApiUrl
-
setApiUrl
-
getRestTemplate
public org.springframework.web.client.RestTemplate getRestTemplate() -
setRestTemplate
public void setRestTemplate(org.springframework.web.client.RestTemplate rt) -
createZencoderJob
public ZencoderCreateJobResponse createZencoderJob(ZencoderCreateJobRequest job) throws ZencoderClientExceptionCreates a VOD transcode job.- Parameters:
job
-- Returns:
- ZencoderJobResponse
- Throws:
ZencoderClientException
-
listJobs
Lists the most recent jobs created (up to 50)- Returns:
- A list of jobs.
- Throws:
ZencoderClientException
-
listJobs
public List<ZencoderJobDetail> listJobs(Integer page, Integer per_page) throws ZencoderClientExceptionLists jobs with pagination.- Parameters:
page
- Which page to returnper_page
- How many jobs per page to return- Returns:
- A list of jobs.
- Throws:
ZencoderClientException
-
getZencoderJob
Gets details about an existing VOD transcode job.- Parameters:
id
-- Returns:
- Throws:
ZencoderClientException
-
getJobProgress
Gets progress information about an existing VOD transcode job.- Parameters:
id
-- Returns:
- Throws:
ZencoderClientException
-
getInputProgress
Gets progress information about an existing VOD transcode input.- Parameters:
id
-- Returns:
- Throws:
ZencoderClientException
-
getOutputProgress
Gets progress information about an existing VOD transcode output.- Parameters:
id
-- Returns:
- Throws:
ZencoderClientException
-
getInputDetails
Gets the details of a given input.- Parameters:
id
-- Returns:
- Throws:
ZencoderClientException
-
parseJobFinishedNotificationResponse
public ZencoderJobFinishedNotificationResponse parseJobFinishedNotificationResponse(org.springframework.http.HttpEntity<String> entity) throws ZencoderClientExceptionParses payload from Zencoder notification.- Parameters:
HttpEntity
-- Returns:
- ZencoderJobFinishedNotificationResponse
- Throws:
ZencoderClientException
-
getOutputDetails
Gets the details of a given output.- Parameters:
id
-- Returns:
- Throws:
ZencoderClientException
-
resubmitJob
If a job has failed processing you may request that it be attempted again.- Parameters:
id
-- Throws:
ZencoderClientException
-
cancelJob
If you wish to cancel a job that has not yet finished processing.- Parameters:
id
-- Throws:
ZencoderClientException
-
finishLiveJob
Finishes the input on a Live streaming job. Has no effect on non-Live jobs.- Parameters:
id
-- Throws:
ZencoderClientException
-
createAccount
Creates a Zencoder Account. New accounts will be created under the Test (Free) plan. NOTE: A password will be generated and returned if not specified.- Parameters:
account
- The account to create.- Returns:
- The created account with it's API key and password.
- Throws:
ZencoderClientException
-
getAccountDetails
Retrieve your Zencoder Account Details- Returns:
- The status and billing details for this account.
- Throws:
ZencoderClientException
-
setAccountIntegrationMode
Sets whether or not your account should be in the limited integration mode. Use 'true' to make your account limited to integration mode. Use 'false' to make your account a regular account.- Parameters:
integration_mode
- Integration Mode setting.- Throws:
ZencoderClientException
-
getUsageForVod
public ZencoderVodUsage getUsageForVod(Date from, Date to, String grouping) throws ZencoderClientExceptionThe VOD usage for the specified time period. NOTE: It's important to note that our service operates in the UTC time zone (including billing periods). All dates and times reported will be in UTC.- Parameters:
from
- (optional) Start date (default: 30 days ago).to
- (optional) End date (default: yesterday).grouping
- (optional) Minute usage for only one report grouping (default: none).- Returns:
- The VOD usage for the specified time period.
- Throws:
ZencoderClientException
-
getUsageForLive
public ZencoderLiveUsage getUsageForLive(Date from, Date to, String grouping) throws ZencoderClientExceptionThe Live usage for the specified time period. NOTE: It's important to note that our service operates in the UTC time zone (including billing periods). All dates and times reported will be in UTC.- Parameters:
from
- (optional) Start date (default: 30 days ago).to
- (optional) End date (default: yesterday).grouping
- (optional) Minute usage for only one report grouping (default: none).- Returns:
- The Live usage for the specified time period.
- Throws:
ZencoderClientException
-
getUsageForVodAndLive
public ZencoderAllUsage getUsageForVodAndLive(Date from, Date to, String grouping) throws ZencoderClientExceptionThe VOD+Live usage for the specified time period. NOTE: It's important to note that our service operates in the UTC time zone (including billing periods). All dates and times reported will be in UTC.- Parameters:
from
- (optional) Start date (default: 30 days ago).to
- (optional) End date (default: yesterday).grouping
- (optional) Minute usage for only one report grouping (default: none).- Returns:
- The VOD+Live usage for the specified time period.
- Throws:
ZencoderClientException
-