com.softlayer.api.service.network.media.transcode.Account Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of softlayer-api-client Show documentation
Show all versions of softlayer-api-client Show documentation
API client for accessing the SoftLayer API
The newest version!
package com.softlayer.api.service.network.media.transcode;
import com.softlayer.api.ApiClient;
import com.softlayer.api.ResponseHandler;
import com.softlayer.api.annotation.ApiMethod;
import com.softlayer.api.annotation.ApiProperty;
import com.softlayer.api.annotation.ApiType;
import com.softlayer.api.service.Entity;
import com.softlayer.api.service.container.network.authentication.Data;
import com.softlayer.api.service.container.network.directory.Listing;
import com.softlayer.api.service.container.network.media.Information;
import com.softlayer.api.service.container.network.media.transcode.Preset;
import com.softlayer.api.service.container.network.media.transcode.preset.Element;
import com.softlayer.api.service.network.media.transcode.Job;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.concurrent.Future;
/**
* The SoftLayer_Network_Media_Transcode_Account contains information regarding a transcode account.
*
* @see SoftLayer_Network_Media_Transcode_Account
*/
@ApiType("SoftLayer_Network_Media_Transcode_Account")
public class Account extends Entity {
/**
* The SoftLayer account information
*/
@ApiProperty
protected com.softlayer.api.service.Account account;
public com.softlayer.api.service.Account getAccount() {
return account;
}
public void setAccount(com.softlayer.api.service.Account account) {
this.account = account;
}
/**
* Transcode jobs
*/
@ApiProperty
protected List transcodeJobs;
public List getTranscodeJobs() {
if (transcodeJobs == null) {
transcodeJobs = new ArrayList();
}
return transcodeJobs;
}
/**
* The internal identifier of a SoftLayer account
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long accountId;
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
accountIdSpecified = true;
this.accountId = accountId;
}
protected boolean accountIdSpecified;
public boolean isAccountIdSpecified() {
return accountIdSpecified;
}
public void unsetAccountId() {
accountId = null;
accountIdSpecified = false;
}
/**
* The created date
*/
@ApiProperty(canBeNullOrNotSet = true)
protected GregorianCalendar createDate;
public GregorianCalendar getCreateDate() {
return createDate;
}
public void setCreateDate(GregorianCalendar createDate) {
createDateSpecified = true;
this.createDate = createDate;
}
protected boolean createDateSpecified;
public boolean isCreateDateSpecified() {
return createDateSpecified;
}
public void unsetCreateDate() {
createDate = null;
createDateSpecified = false;
}
/**
* The internal identifier of a transcode account
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
idSpecified = true;
this.id = id;
}
protected boolean idSpecified;
public boolean isIdSpecified() {
return idSpecified;
}
public void unsetId() {
id = null;
idSpecified = false;
}
/**
* The last modified date
*/
@ApiProperty(canBeNullOrNotSet = true)
protected GregorianCalendar modifyDate;
public GregorianCalendar getModifyDate() {
return modifyDate;
}
public void setModifyDate(GregorianCalendar modifyDate) {
modifyDateSpecified = true;
this.modifyDate = modifyDate;
}
protected boolean modifyDateSpecified;
public boolean isModifyDateSpecified() {
return modifyDateSpecified;
}
public void unsetModifyDate() {
modifyDate = null;
modifyDateSpecified = false;
}
/**
* A count of transcode jobs
*/
@ApiProperty
protected Long transcodeJobCount;
public Long getTranscodeJobCount() {
return transcodeJobCount;
}
public void setTranscodeJobCount(Long transcodeJobCount) {
this.transcodeJobCount = transcodeJobCount;
}
public Service asService(ApiClient client) {
return service(client, id);
}
public static Service service(ApiClient client) {
return client.createService(Service.class, null);
}
public static Service service(ApiClient client, Long id) {
return client.createService(Service.class, id == null ? null : id.toString());
}
/**
* Transcoding is a service which allows you to transcode media files to different formats. For example, if you have a Windows Media Video file you wish to stream in Flash Video format, transcoding would be the process to make this change. Individual SoftLayer customer can have a single Transcode account and you need to create a Transcode account to use the service. To create a Transcode account, go to the "Private Network" -> "Transcoding" page in the SoftLayer [https://manage.softlayer.com customer portal] or invoke [[SoftLayer_Network_Media_Transcode_Account::createTranscodeAccount|createTranscodeAccount]] method.
*
* SoftLayer Transcoding service supports a large number of video and audio codecs. This means you can transcode many different types of movies. Refer to [http://knowledgelayer.softlayer.com/questions/409/SoftLayer+Transcoding+FAQ Transcode FAQ] for supported codes and media containers. Transcode server also has hundreds of pre-defined output formats that you can choose from.
*
* A Transcode account object allows you to communicate with the Transcode FTP (transcode.service.softlayer.com server) server and Transcode server. You can retrieve a directory listing, details on a media file, Transcode output presets, and Transcode FTP login credentials. Most importantly, you can create transcode jobs through your Transcode account.
*
* When a Transcode account is created, it creates an FTP account on the Transcode FTP. You can upload your media files to the /in directory and you can download transcoded media files from the /out directory. You can keep the files 3 days from the creation date. They will be automatically deleted after this point. For more details on the Transcode FTP server, refer to [[SoftLayer_Network_Media_Transcode_Account::getFtpAttributes|getFtpAttributes]] method.
*
* @see SoftLayer_Network_Media_Transcode_Account
*/
@com.softlayer.api.annotation.ApiService("SoftLayer_Network_Media_Transcode_Account")
public static interface Service extends com.softlayer.api.Service {
public ServiceAsync asAsync();
public Mask withNewMask();
public Mask withMask();
public void setMask(Mask mask);
/**
* With this method, you can create a transcode account. Individual SoftLayer account can have a single Transcode account. You have to pass your SoftLayer account id as a parameter.
*
* @see SoftLayer_Network_Media_Transcode_Account::createTranscodeAccount
*/
@ApiMethod
public Boolean createTranscodeAccount();
/**
* '''Note'''. This method is obsolete. Please use the [[SoftLayer_Network_Media_Transcode_Job::createObject|createObject]] method on SoftLayer_Network_Media_Transcode_Job object instead. SoftLayer_Network_Media_Transcode_Job::createObject returns an object of a newly created Transcode Job.
*
* With this method, you can create a transcode job.
*
* The very first step of creating a transcode job is to upload your media files to the /in directory on your Transcode FTP space. Then, you have to pass a [[SoftLayer_Network_Media_Transcode_Job|Transcode job]] object as a parameter for this method.
*
* There are 4 required properties of SoftLayer_Network_Media_Transcode_Job object: transcodePresetName, transcodePresetGuid, inputFile, and outputFile. A transcode preset is a configuration that defines a certain media output. You can retrieve all the supported presets with the [[SoftLayer_Network_Media_Transcode_Account::getPresets|getPresets]] method. You can also use [[SoftLayer_Network_Media_Transcode_Account::getPresetDetail|getPresetDetail]] method to get more information on a preset. Use these two methods to determine appropriate values for "transcodePresetName" and "transcodePresetGuid" properties. For an "inputFile", you must specify a file that exists in the /in directory of your Transcode FTP space. An "outputFile" name will be used by the Transcode server for naming a transcoded file. An output file name must be in /out directory. If your outputFile name already exists in the /out directory, the Transcode server will append a file name with _n (an underscore and the total number of files with the identical name plus 1).
*
* The "name" property is optional and it can help you keep track of transcode jobs easily. "autoDeleteDuration" is another optional property that you can specify. It determines how soon your input file will be deleted. If autoDeleteDuration is set to zero, your input file will be removed immediately after the last transcode job running on it is completed. A value for autoDeleteDuration property is in seconds and the maximum value is 259200 which is 3 days.
*
* An example SoftLayer_Network_Media_Transcode_Job parameter looks like this:
*
*
* * name: My transcoding
* * transcodePresetName: F4V 896kbps 640x352 16x9 29.97fps
* * transcodePresetGuid: {87E01268-C3E3-4A85-9701-052C9AC42BD4}
* * inputFile: /in/my_birthday.wmv
* * outputFile: /out/my_birthday_flash
*
*
* Notice that an output file does not have a file extension. The Transcode server will append a file extension based on an output format. A newly created transcode job will be in "Pending" status and it will be added to the Transcoding queue. You will receive a notification email whenever there is a status change on your transcode job. For example, the Transcode server starts to process your transcode job, you will be notified via an email.
*
* You can add up to 3 pending jobs at a time. Transcode jobs with any other status such as "Complete" or "Error" will not be counted toward your pending jobs.
*
* Once a job is complete, the Transcode server will place the output file into the /out directory along with a notification email. The files in the /out directory will be removed 3 days after they were created. You will need to use an FTP client to download transcoded files.
*
*
*
* @see SoftLayer_Network_Media_Transcode_Account::createTranscodeJob
*/
@ApiMethod(instanceRequired = true)
public Boolean createTranscodeJob(Job newJob);
/**
* This method returns a collection of SoftLayer_Container_Network_Ftp_Directory objects. You can retrieve directory information for /in and /out directories. A [[SoftLayer_Container_Network_Directory_Listing|Directory Listing]] object contains a type (indicating whether it is a file or a directory), name and file count if it is a directory.
*
* @see SoftLayer_Network_Media_Transcode_Account::getDirectoryInformation
*/
@ApiMethod(instanceRequired = true)
public List getDirectoryInformation(String directoryName, String extensionFilter);
/**
* This method returns detailed information of a media file that resides in the Transcode FTP server. A [[SoftLayer_Container_Network_Media_Information|media information]] object contains media details such as file size, media format, frame rate, aspect ratio and so on. This information is merely for reference purposes. You should not rely on this data. Our library grabs small pieces of data from a media file to gather media details. This information may not be available for some files.
*
* @see SoftLayer_Network_Media_Transcode_Account::getFileDetail
*/
@ApiMethod(instanceRequired = true)
public Information getFileDetail(String source);
/**
* This method returns your Transcode FTP login credentials to the transcode.service.softlayer.com server.
*
* The Transcode FTP server is available via the SoftLayer private network. There is no API method that you can upload a file to Transcode server so you need to use an FTP client. You will have /in and /out directories on the Transcode FTP server. You will have read-write privileges for /in directory and read-only privilege for /out directory. All the files in both /in and /out directories will be deleted after 72 hours from the creation date.
*
* @see SoftLayer_Network_Media_Transcode_Account::getFtpAttributes
*/
@ApiMethod(instanceRequired = true)
public Data getFtpAttributes();
/**
* getObject method retrieves the SoftLayer_Network_Media_Transcode_Account object whose ID number corresponds to the ID number of the initial parameter passed to the SoftLayer_Network_Media_Transcode_Account service. You can only retrieve a Transcode account assigned to your SoftLayer customer account.
*
* @see SoftLayer_Network_Media_Transcode_Account::getObject
*/
@ApiMethod(instanceRequired = true)
public Account getObject();
/**
* This method returns an array of [[SoftLayer_Container_Network_Media_Transcode_Preset_Element|preset element]] objects. Each preset has its own collection of preset elements such as encoder, frame rate, aspect ratio and so on. Each element object has a default value for itself and an array of [[SoftLayer_Container_Network_Media_Transcode_Preset_Element_Option|element option]] objects. For example, "Frame Rate" element for "Windows Media 9 - Download - 1 Mbps - NTSC - Constrained VBR" preset has 19 element options. 15.0 frame rate is selected by default. Currently, you are not able to change the default value. Customizing these values may be possible in the future.
*
* @see SoftLayer_Network_Media_Transcode_Account::getPresetDetail
*/
@ApiMethod(instanceRequired = true)
public List getPresetDetail(String guid);
/**
* A transcode preset is a configuration that defines a certain media output. This method returns an array of transcoding preset objects supported by SoftLayer's Transcode server. Each [[SoftLayer_Container_Network_Media_Transcode_Preset|preset object]] contains a GUID property. You will need a GUID string when you create a new transcode job.
*
* @see SoftLayer_Network_Media_Transcode_Account::getPresets
*/
@ApiMethod(instanceRequired = true)
public List getPresets();
/**
* The SoftLayer account information
*
* @see SoftLayer_Network_Media_Transcode_Account::getAccount
*/
@ApiMethod(instanceRequired = true)
public com.softlayer.api.service.Account getAccount();
/**
* Transcode jobs
*
* @see SoftLayer_Network_Media_Transcode_Account::getTranscodeJobs
*/
@ApiMethod(instanceRequired = true)
public List getTranscodeJobs();
}
public static interface ServiceAsync extends com.softlayer.api.ServiceAsync {
public Mask withNewMask();
public Mask withMask();
public void setMask(Mask mask);
/**
* Async version of {@link Service#createTranscodeAccount}
*/
public Future createTranscodeAccount();
public Future> createTranscodeAccount(ResponseHandler callback);
/**
* Async version of {@link Service#createTranscodeJob}
*/
public Future createTranscodeJob(Job newJob);
public Future> createTranscodeJob(Job newJob, ResponseHandler callback);
/**
* Async version of {@link Service#getDirectoryInformation}
*/
public Future> getDirectoryInformation(String directoryName, String extensionFilter);
public Future> getDirectoryInformation(String directoryName, String extensionFilter, ResponseHandler> callback);
/**
* Async version of {@link Service#getFileDetail}
*/
public Future getFileDetail(String source);
public Future> getFileDetail(String source, ResponseHandler callback);
/**
* Async version of {@link Service#getFtpAttributes}
*/
public Future getFtpAttributes();
public Future> getFtpAttributes(ResponseHandler callback);
/**
* Async version of {@link Service#getObject}
*/
public Future getObject();
public Future> getObject(ResponseHandler callback);
/**
* Async version of {@link Service#getPresetDetail}
*/
public Future> getPresetDetail(String guid);
public Future> getPresetDetail(String guid, ResponseHandler> callback);
/**
* Async version of {@link Service#getPresets}
*/
public Future> getPresets();
public Future> getPresets(ResponseHandler> callback);
/**
* Async version of {@link Service#getAccount}
*/
public Future getAccount();
/**
* Async callback version of {@link Service#getAccount}
*/
public Future> getAccount(ResponseHandler callback);
/**
* Async version of {@link Service#getTranscodeJobs}
*/
public Future> getTranscodeJobs();
/**
* Async callback version of {@link Service#getTranscodeJobs}
*/
public Future> getTranscodeJobs(ResponseHandler> callback);
}
public static class Mask extends com.softlayer.api.service.Entity.Mask {
public com.softlayer.api.service.Account.Mask account() {
return withSubMask("account", com.softlayer.api.service.Account.Mask.class);
}
public Job.Mask transcodeJobs() {
return withSubMask("transcodeJobs", Job.Mask.class);
}
public Mask accountId() {
withLocalProperty("accountId");
return this;
}
public Mask createDate() {
withLocalProperty("createDate");
return this;
}
public Mask id() {
withLocalProperty("id");
return this;
}
public Mask modifyDate() {
withLocalProperty("modifyDate");
return this;
}
public Mask transcodeJobCount() {
withLocalProperty("transcodeJobCount");
return this;
}
}
}