Class AssetApi

java.lang.Object
com.mayam.wf.ws.client.AssetApi

public class AssetApi extends Object
Gives access to assets using the API. Please see examples under TasksClient. This class is accessed using TasksClient.assetApi().
  • Constructor Details

    • AssetApi

      public AssetApi(com.mayam.wf.ws.client.internal.AssetsRestClient client)
  • Method Details

    • createAsset

      public AttributeMap createAsset(AttributeMap asset) throws RemoteException
      Creates a new asset. The resulting AttributeMap will contain all attributes of the newly created asset, most notably including the Attribute.TASK_ID.
      Parameters:
      asset - a partial asset definition used as primer.
      Returns:
      asset the full newly created asset as an AttributeMap.
      Throws:
      RemoteException - if an error occurred on the server side.
    • getAsset

      public AttributeMap getAsset(AssetType assetType, String assetId) throws RemoteException
      Retrieves an asset by its type and identifier.
      Parameters:
      assetType - asset type.
      assetId - asset identifier.
      Returns:
      asset as an AttributeMap.
      Throws:
      RemoteException - if an error occurred on the server side.
    • getAssetBySiteId

      public AttributeMap getAssetBySiteId(AssetType assetType, String siteId) throws RemoteException
      Retrieves an asset by its type and site identifier.
      Parameters:
      assetType - asset type.
      siteId - asset site identifier.
      Returns:
      asset as an AttributeMap.
      Throws:
      RemoteException - if an error occurred on the server side.
    • getAssetChildren

      public List<AttributeMap> getAssetChildren(AssetType assetType, String assetId, AssetType... childTypes) throws RemoteException
      Retrieves child assets by the type and identifier of a given parent asset; results are limited to a set of child asset types.
      Parameters:
      assetType - asset type.
      assetId - asset identifier.
      childTypes - set of asset types valid for returned children.
      Returns:
      assets as a list of AttributeMap.
      Throws:
      RemoteException - if an error occurred on the server side.
    • updateAsset

      public AttributeMap updateAsset(AttributeMap asset) throws RemoteException
      Updates an asset. Any modified (dirty) value of the AttributeMap will be used to update the asset identified by Attribute.ASSET_TYPE and Attribute.ASSET_ID. Returned is an AttributeMap with the changes as reported by the server.
      Parameters:
      asset - unique identifiers and attributes to modify.
      Returns:
      asset the full updated asset as an AttributeMap.
      Throws:
      RemoteException - if an error occurred on the server side.
    • deleteAsset

      public AttributeMap deleteAsset(AssetType assetType, String assetId) throws RemoteException
      Deletes an asset by its type and identifier. This call performs asset deletion with the system default grace time, which is typically immediate
      Parameters:
      assetType - asset type.
      assetId - asset identifier.
      Returns:
      last known asset data.
      Throws:
      RemoteException - if an error occurred on the server side.
    • deleteAsset

      public AttributeMap deleteAsset(AssetType assetType, String assetId, int gracePeriod) throws RemoteException
      Deletes an asset by its type and identifier.
      Parameters:
      assetType - asset type.
      assetId - asset identifier.
      gracePeriod - grace period in seconds.
      Returns:
      last known asset data.
      Throws:
      RemoteException - if an error occurred on the server side.
    • importFile

      public String importFile(AssetType assetType, String assetId, ImportRequestBuilder requestBuilder) throws RemoteException
      Imports a file on a specified storage/service with a specified file path.
      Parameters:
      assetType - asset type.
      assetId - asset identifier.
      requestBuilder - import details
      Returns:
      job id that can be used to monitor the job progress.
      Throws:
      RemoteException - if an error occurred on the server side.
    • moveMediaEssence

      public void moveMediaEssence(AssetType srcType, String srcId, AssetType destType, String destId) throws RemoteException
      Moves media essence from the source asset to the destination asset
      Parameters:
      srcType - source asset type.
      srcId - source asset identifier
      destType - destination asset type.
      destId - destination asset id.
      Throws:
      RemoteException - if an error occurred on the server side.
    • deleteAssetMedia

      public void deleteAssetMedia(AssetType assetType, String assetId) throws RemoteException
      Deletes the media from given asset. This is sometimes termed 'uningest'.
      Parameters:
      assetType - asset type.
      assetId - asset identifier.
      Throws:
      RemoteException - if an error occurred on the server side.
    • getMarkers

      public MarkerList getMarkers(AssetType assetType, String assetId, String revisionId) throws RemoteException
      Gets a list of markers for given asset revision.
      Parameters:
      assetType - asset type.
      assetId - asset identifier.
      revisionId - revision identifier.
      Returns:
      list of markers.
      Throws:
      RemoteException - if an error occurred on the server side.
    • getFormatInfo

      public FileFormatInfo getFormatInfo(AssetType assetType, String assetId) throws RemoteException
      Gets file format information about a given asset.
      Parameters:
      assetType - asset type.
      assetId - asset identifier.
      Returns:
      FileFormatInfo file format information.
      Throws:
      RemoteException - if an error occurred on the server side.
    • requestConform

      public String requestConform(AssetType assetType, String assetId, ConformRequestBuilder request) throws RemoteException
      Requests a conform using a MAM specific subset of available request details.
      Parameters:
      assetType - asset type.
      assetId - asset identifier.
      request - conform details.
      Returns:
      MAM specific job descriptor.
      Throws:
      RemoteException - if an error occurred on the server side.
    • requestTransfer

      public String requestTransfer(AssetType assetType, String assetId, TransferRequestBuilder request) throws RemoteException
      Requests a transfer of asset file(s) using a MAM specific subset of available request details.
      Parameters:
      assetType - asset type.
      assetId - asset identifier.
      request - transfer details.
      Returns:
      MAM specific job descriptor.
      Throws:
      RemoteException - if an error occurred on the server side.
    • requestTranscode

      public String requestTranscode(AssetType assetType, String assetId, TranscodeRequestBuilder request) throws RemoteException
      Requests transcode of asset video.
      Parameters:
      assetType - asset type.
      assetId - asset identifier.
      request - transcode details.
      Returns:
      MAM specific job descriptor.
      Throws:
      RemoteException - if an error occurred on the server side.
    • getTechReport

      public Map<String,Integer> getTechReport(AssetType assetType, String assetId) throws RemoteException
      Fetches a technical report with QC events for an asset.
      Parameters:
      assetType - asset type; only AssetType.ITEM supported for now.
      assetId - asset identifier.
      Returns:
      A map of QC events and the number of occurrences. Example: {Timecode / VITC discontinuity=1}
      Throws:
      RemoteException - if an error occurred on the server side.
    • getQcMessages

      public List<String> getQcMessages(AssetType assetType, String assetId) throws RemoteException
      Fetches a list of qc messages
      Parameters:
      assetType - asset type; only AssetType.ITEM supported for now.
      assetId - asset identifier.
      Returns:
      list of qc messages
      Throws:
      RemoteException - - if an error occurred on the server side.
    • getUnmanagedMetadata

      public UnmanagedMetadata getUnmanagedMetadata(AssetType assetType, String assetId) throws RemoteException
      Retrieve metadata directly from the MAM. Bypassing all attribute management.
        Example usage:
           UnmanagedMetadata md = client.assetApi().getUnmanagedMetadata(AssetType.ITEM, assetId);
           assertEquals("ebtest6565", md.get("asset.title"));
       
      Parameters:
      assetType - asset type
      assetId - asset identifier.
      Returns:
      metadata from the MAM
      Throws:
      RemoteException - - if an error occurred on the server side.
    • updateUnmanagedMetadata

      public UnmanagedMetadata updateUnmanagedMetadata(AssetType assetType, String assetId, UnmanagedMetadata metadata) throws RemoteException
      Sets metadata directly in the MAM. Bypassing all attribute management
        Example usage:
           UnmanagedMetadata md = client.assetApi().updateUnmanagedMetadata(AssetType.ITEM, assetId, UnmanagedMetadata.of("asset.title", "ebtest6565"));
       
        Example usage:
           final Date now = new Date();
           UnmanagedMetadata md = UnmanagedMetadata.builder()
             .set("asset.title", "foobar")
                   .set("ts", now)
                   .set("nullthis", null)
                   .subs("people",
                     UnmanagedMetadata.builder()
                 .set("name", "Erik"),
               UnmanagedMetadata.builder()
                 .set("name", "Markus")
                 .set("ts", now))
             .subs("stuff",
               UnmanagedMetadata.builder()
                 .set("laptop", "MacBook Pro"))
             .build();
      
           md = client.assetApi().updateUnmanagedMetadata(AssetType.ITEM, assetId, md);
       
        Example usage:
          UnmanagedMetadata md = client.assetApi().getUnmanagedMetadata(AssetType.ITEM, assetId);
          Listinvalid input: '<'UnmanagedMetadata.Builder> builders = md.subBuilders("asset.contributor");
          builders.add(UnmanagedMetadata.builder()
            .set("person.role", "master")
            .set("person.firstName", "Erik")
            .set("person.lastName", "Bågfors"));
            
          md = client.assetApi().updateUnmanagedMetadata(AssetType.ITEM, assetId, UnmanagedMetadata.builder().subs("asset.contributor", builders).build());
       
      Parameters:
      assetType - asset type
      assetId - asset identifier.
      metadata - metadata to set
      Returns:
      updated metadata from the MAM
      Throws:
      RemoteException - - if an error occurred on the server side.