com.brightcove.player.edge

## Class GetVideoTask

- java.lang.Object
- - android.os.AsyncTask<java.net.URI,java.lang.Void,com.brightcove.player.edge.EdgeTaskResult<T>>
  - - com.brightcove.player.edge.GetVideoTask

- All Implemented Interfaces:
    Component

      @Emits(events={})
       @ListensFor(events={})
      public class GetVideoTask
      extends android.os.AsyncTask<java.net.URI,java.lang.Void,com.brightcove.player.edge.EdgeTaskResult<T>>
      implements Component

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class android.os.AsyncTask

      `android.os.AsyncTask.Status`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `account`
    `static java.lang.String` | `AD_SUPPORTED`
    `protected java.lang.String` | `baseURL`
    `static java.lang.String` | `ECONOMICS`
    `protected java.util.List<java.lang.String>` | `errors`
    `protected EventEmitter` | `eventEmitter`
    `static java.lang.String` | `FREE`
    `protected HttpRequestConfig` | `httpRequestConfig`
    `protected HttpService` | `httpService`
    `protected java.net.URI` | `uri`

    - ### Fields inherited from class android.os.AsyncTask

      `SERIAL_EXECUTOR, THREAD_POOL_EXECUTOR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GetVideoTask(EventEmitter eventEmitter, java.lang.String baseURL, HttpRequestConfig httpRequestConfig, java.lang.String account)`
    `GetVideoTask(EventEmitter eventEmitter, java.lang.String baseURL, HttpRequestConfig httpRequestConfig, java.lang.String account, java.lang.String policy)`
    `GetVideoTask(EventEmitter eventEmitter, java.lang.String baseURL, java.util.Map<java.lang.String,java.lang.String> headers, java.util.Map<java.lang.String,java.lang.String> queryParameters, java.lang.String account, java.lang.String policy)` Deprecated. Please use `GetVideoTask(EventEmitter, String, HttpRequestConfig, String, String)` instead.
    `GetVideoTask(EventEmitter eventEmitter, java.lang.String baseURL, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String account, java.lang.String policy)` Deprecated. Please use `GetVideoTask(EventEmitter, String, HttpRequestConfig, String, String)` instead.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.net.URI` | `createURI(java.lang.String... params)` Creates a `URI` object with the `baseURL` passed in the constructor and appends the String params to the Url.
    `protected com.brightcove.player.edge.EdgeTaskResult<T>` | `doInBackground(java.net.URI... params)`
    `void` | `getById(java.lang.String videoId, VideoListener videoListener)`
    `void` | `getByReferenceId(java.lang.String referenceId, VideoListener videoListener)`
    `protected void` | `onPostExecute(com.brightcove.player.edge.EdgeTaskResult<Video> result)`
    `protected Video` | `processData(org.json.JSONObject data)` Parses the JSON object to return the typed Object.

    - ### Methods inherited from class android.os.AsyncTask

      `cancel, execute, execute, executeOnExecutor, get, get, getStatus, isCancelled, onCancelled, onCancelled, onPreExecute, onProgressUpdate, publishProgress`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ECONOMICS

          public static final java.lang.String ECONOMICS

      See Also:
        Constant Field Values

    - #### AD_SUPPORTED

          public static final java.lang.String AD_SUPPORTED

      See Also:
        Constant Field Values

    - #### FREE

          public static final java.lang.String FREE

      See Also:
        Constant Field Values

    - #### eventEmitter

          protected EventEmitter eventEmitter

    - #### baseURL

          @NonNull
          protected java.lang.String baseURL

    - #### account

          @NonNull
          protected java.lang.String account

    - #### uri

          protected java.net.URI uri

    - #### httpService

          protected HttpService httpService

    - #### errors

          protected java.util.List<java.lang.String> errors

    - #### httpRequestConfig

          protected final HttpRequestConfig httpRequestConfig

  - ### Constructor Detail

    - #### GetVideoTask

          @Deprecated
          public GetVideoTask(@NonNull
                                          EventEmitter eventEmitter,
                                          @NonNull
                                          java.lang.String baseURL,
                                          @Nullable
                                          java.util.Map<java.lang.String,java.lang.String> headers,
                                          @NonNull
                                          java.lang.String account,
                                          @NonNull
                                          java.lang.String policy)

      Deprecated. Please use `GetVideoTask(EventEmitter, String, HttpRequestConfig, String, String)` instead.

    - #### GetVideoTask

          @Deprecated
          public GetVideoTask(@NonNull
                                          EventEmitter eventEmitter,
                                          @NonNull
                                          java.lang.String baseURL,
                                          @Nullable
                                          java.util.Map<java.lang.String,java.lang.String> headers,
                                          @Nullable
                                          java.util.Map<java.lang.String,java.lang.String> queryParameters,
                                          @NonNull
                                          java.lang.String account,
                                          @NonNull
                                          java.lang.String policy)

      Deprecated. Please use `GetVideoTask(EventEmitter, String, HttpRequestConfig, String, String)` instead.

    - #### GetVideoTask

          public GetVideoTask(@NonNull
                              EventEmitter eventEmitter,
                              @NonNull
                              java.lang.String baseURL,
                              @NonNull
                              HttpRequestConfig httpRequestConfig,
                              @NonNull
                              java.lang.String account,
                              @NonNull
                              java.lang.String policy)

    - #### GetVideoTask

          public GetVideoTask(@NonNull
                              EventEmitter eventEmitter,
                              @NonNull
                              java.lang.String baseURL,
                              @NonNull
                              HttpRequestConfig httpRequestConfig,
                              @NonNull
                              java.lang.String account)

  - ### Method Detail

    - #### getById

          public void getById(java.lang.String videoId,
                              VideoListener videoListener)

    - #### getByReferenceId

          public void getByReferenceId(java.lang.String referenceId,
                                       VideoListener videoListener)

    - #### onPostExecute

          protected void onPostExecute(com.brightcove.player.edge.EdgeTaskResult<Video> result)

      Overrides:
        `onPostExecute` in class `android.os.AsyncTask<java.net.URI,java.lang.Void,com.brightcove.player.edge.EdgeTaskResult<Video>>`

    - #### processData

          protected Video processData(@NonNull
                                      org.json.JSONObject data)
                               throws org.json.JSONException,
                                      VideoParseException

      Parses the JSON object to return the typed Object. This method is called in the `doInBackground(URI...)` method.
      Parameters:
        `data` - the Json object returned from the response
      Returns:
        the typed object
      Throws:
        `org.json.JSONException`
        `VideoParseException`

    - #### doInBackground

          @NonNull
          protected com.brightcove.player.edge.EdgeTaskResult<T> doInBackground(java.net.URI... params)

      Specified by:
        `doInBackground` in class `android.os.AsyncTask<java.net.URI,java.lang.Void,com.brightcove.player.edge.EdgeTaskResult<T>>`

    - #### createURI

          protected java.net.URI createURI(java.lang.String... params)
                                    throws java.net.URISyntaxException

      Creates a `URI` object with the `baseURL` passed in the constructor and appends the String params to the Url. For example: baseURL/param1/param2.../paramN

      If the `HttpRequestConfig.getQueryParameters()` map is not empty, it will also append its values to the url. For example: baseUrl?key1=value1&key2=value2&...&keyN=valueN baseUrl/param1/param2.../paramN?key1=value1&key2=value2&...&keyN=valueN

      Parameters:
        `params` - the params
      Returns:
        the uri
      Throws:
        `java.net.URISyntaxException` - the uri syntax exception