io.clarify.api
Class Bundle

java.lang.Object
  extended by io.clarify.api.ClarifyModel
      extended by io.clarify.api.Bundle

public class Bundle
extends ClarifyModel


Field Summary
 
Fields inherited from class io.clarify.api.ClarifyModel
client, response
 
Constructor Summary
Bundle(ClarifyClient client, ClarifyResponse response)
           
 
Method Summary
 BundleTrack addTrack(URI uri)
          Adds a new Track to the Bundle with the given media URI
 boolean delete()
          Deletes this bundle and all of its related Metadata and Tracks, along with media stored on Clarify systems.
 boolean deleteTrack(String trackId)
          Deletes a track from this bundle.
 BundleTrack findTrack(String trackId)
          Returns a specific Track by track number for this media Bundle
 String getId()
          Attempts to navigate the parsed JSON and return the field "id" in the payload
 BundleMetadata getMetadata()
          Returns this media Bundle's Metadata class, with details on the bundle and any attached user data (if available)
 BundleTrackList listTracks()
          Returns the list of Tracks associated to this media Bundle
 
Methods inherited from class io.clarify.api.ClarifyModel
getClarifyClient, getClarifyResponse, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Bundle

public Bundle(ClarifyClient client,
              ClarifyResponse response)
Method Detail

getId

public String getId()
Attempts to navigate the parsed JSON and return the field "id" in the payload

Returns:
return the Bundle ID
Throws:
RuntimeException - containing the nested exception if the lookup failed

delete

public boolean delete()
               throws IOException
Deletes this bundle and all of its related Metadata and Tracks, along with media stored on Clarify systems. Does not delete any media stored on remote systems. USE CAUTION AS THIS CALL CANNOT BE UNDONE

Returns:
boolean
Throws:
IOException - if an error occurred during the delete bundle API call

addTrack

public BundleTrack addTrack(URI uri)
                     throws IOException
Adds a new Track to the Bundle with the given media URI

Parameters:
uri - the URI of the remote media file to add to the Bundle
Returns:
a new Track instance containing the details about the new Track
Throws:
IOException - if a failure occurred during the API, typically a 4xx HTTP error code + JSON payload with the error message and details

listTracks

public BundleTrackList listTracks()
                           throws IOException
Returns the list of Tracks associated to this media Bundle

Returns:
a BundleTrackList with the list of tracks and related details
Throws:
IOException - if a failure occurred during the API, typically a 4xx HTTP error code + JSON payload with the error message and details

findTrack

public BundleTrack findTrack(String trackId)
                      throws IOException
Returns a specific Track by track number for this media Bundle

Parameters:
trackId - the GUID of the Track
Returns:
the requested Track (throws an IOException if a 404 NOT FOUND is returned)
Throws:
IOException - if a failure occurred during the API, typically a 4xx HTTP error code + JSON payload with the error message and details

deleteTrack

public boolean deleteTrack(String trackId)
                    throws IOException
Deletes a track from this bundle. This will only delete media stored on Clarify systems and not delete the source media on remote systems. USE CAUTION AS THIS CALL CANNOT BE UNDONE

Parameters:
trackId - the GUID of the Track to delete
Returns:
boolean
Throws:
IOException - if a failure occurred during the API, typically a 4xx HTTP error code + JSON payload with the error message and details

getMetadata

public BundleMetadata getMetadata()
                           throws IOException
Returns this media Bundle's Metadata class, with details on the bundle and any attached user data (if available)

Returns:
a Metadata instance for the media bundle
Throws:
IOException - if a failure occurred during the API, typically a 4xx HTTP error code + JSON payload with the error message and details


Copyright © 2015 Clarify Inc. All Rights Reserved.