Class AssetsManager


  • public class AssetsManager
    extends BaseManager
    Manages the functionality related with Assets
    • Method Detail

      • getInstance

        public static AssetsManager getInstance​(KeeperService keeperService,
                                                AquariusService aquariusService)
        Gets an instance of AssetManager
        Parameters:
        keeperService - instance of keeperService
        aquariusService - instance of aquariusService
        Returns:
        an initialized instance of AssetManager
      • publishMetadata

        public DDO publishMetadata​(DDO ddo)
                            throws Exception
        Publishes in Aquarius the metadata of a DDO
        Parameters:
        ddo - the DDO to publish
        Returns:
        the published DDO
        Throws:
        Exception - if Aquarius service fails publishing the DDO
      • publishMetadata

        public DDO publishMetadata​(AssetMetadata metadata,
                                   String serviceEndpoint)
                            throws Exception
        Publishes in Aquarius the metadata of a DDO
        Parameters:
        metadata - the metadata of the DDO
        serviceEndpoint - the endpoint of the service
        Returns:
        the published DDO
        Throws:
        Exception - if Aquarius service fails publishing the metadata
      • getByDID

        public DDO getByDID​(String id)
                     throws Exception
        Gets a DDO from the DID
        Parameters:
        id - the did of the DDO
        Returns:
        an instance of the DDO represented by the DID
        Throws:
        Exception - if Aquarius service fails publishing the metadata
      • updateMetadata

        public boolean updateMetadata​(String id,
                                      DDO ddo)
                               throws Exception
        Updates the metadata of a DDO
        Parameters:
        id - the did of the DDO
        ddo - the DDO
        Returns:
        A flag that indicates if the update was executed correctly
        Throws:
        Exception - if Aquarius service fails updating the metadata
      • searchAssets

        public SearchResult searchAssets​(String text,
                                         int offset,
                                         int page)
                                  throws DDOException
        Gets all the DDOs that match the search criteria
        Parameters:
        text - contains the criteria
        offset - parameter to paginate the results
        page - parameter to paginate the results
        Returns:
        SearchResult including the list of DDOs
        Throws:
        DDOException - if Aquairus fails searching the assets
      • searchAssets

        public SearchResult searchAssets​(Map<String,​Object> params,
                                         int offset,
                                         int page,
                                         int sort)
                                  throws DDOException
        Gets all the DDOs that match the parameters of the query
        Parameters:
        params - contains the criteria
        offset - parameter to paginate the results
        page - parameter to paginate the results
        sort - parameter to sort the results
        Returns:
        a List with all the DDOs found
        Throws:
        DDOException - if Aquairus fails searching the assets
      • deleteAsset

        public Boolean deleteAsset​(DID did)
                            throws DDOException
        Retire the asset ddo from Aquarius.
        Parameters:
        did - the did
        Returns:
        a flag that indicates if the retire operation was executed correctly
        Throws:
        DDOException - DDOException
      • validateMetadata

        public Boolean validateMetadata​(AssetMetadata metadata)
                                 throws DDOException
        Check that the metadata has a valid format.
        Parameters:
        metadata - the metadata of the DDO
        Returns:
        a flag that indicates if the metadata is valid
        Throws:
        DDOException - DDOException