Interface Agent

    • Method Detail

      • getDDO

        Map<String,​Object> getDDO()
        Gets the DDO for the agent
        Returns:
        The DDO of the agent as a metadata Map
      • getDID

        DID getDID()
        Gets the DID for an Agent
        Returns:
        DID The DID that can be used to address this agent in the Ocean Ecosystem
      • registerAsset

        <R extends Asset> R registerAsset​(Asset asset)
        Registers an asset with this agent. The agent must support metadata storage.
        Parameters:
        asset - The asset to register
        Returns:
        Asset
        Throws:
        AuthorizationException - if requester does not have register permission
        UnsupportedOperationException - if the agent does not support metadata storage
      • registerAsset

        <R extends Asset> R registerAsset​(String metaString)
        Registers asset metadata with this agent. The agent must support metadata storage.
        Parameters:
        asset - The asset to register
        Returns:
        Asset
        Throws:
        AuthorizationException - if requester does not have register permission
        UnsupportedOperationException - if the agent does not support metadata storage
      • getAsset

        <R extends Asset> R getAsset​(String id)
        Gets an asset for the given asset ID from this agent. Returns null if the asset ID does not exist in the context of the agent
        Parameters:
        id - The ID of the asset to get from this agent
        Returns:
        Asset The asset found, or null if the agent does not have the specified asset
      • getAsset

        <R extends Asset> R getAsset​(DID did)
        Gets an asset for the given asset DID from this agent. Returns null if the asset not exist.
        Parameters:
        did - The DID of the asset to get from this agent
        Returns:
        Asset The asset found, or null if not found
        Throws:
        AuthorizationException - if requester does not have access permission
        StorageException - if there is an error in retrieving the Asset
      • uploadAsset

        <R extends Asset> R uploadAsset​(Asset a)
        Uploads an asset to this agent. Registers the asset with the agent if required.

        Throws an exception if upload is not possible, with the following likely causes: - The agent does not support uploads of this asset type / size - The data for the asset cannot be accessed by the agent

        Parameters:
        a - Asset to upload
        Returns:
        Asset An asset stored on the agent if the upload is successful
        Throws:
        AuthorizationException - if requester does not have upload permission
        StorageException - if there is an error in uploading the Asset