Class ProvenanceImpl

    • Constructor Detail

      • ProvenanceImpl

        public ProvenanceImpl​(NeverminedManager neverminedManager,
                              ProvenanceManager provenanceManager)
        Constructor
        Parameters:
        neverminedManager - the neverminedManager
        provenanceManager - the provenanceManager
    • Method Detail

      • used

        public boolean used​(String provenanceId,
                            DID did,
                            String agentId,
                            String activityId,
                            String signature,
                            String attributes)
                     throws ProvenanceException
        Description copied from interface: ProvenanceAPI
        Implements the W3C PROV Usage action
        Specified by:
        used in interface ProvenanceAPI
        Parameters:
        provenanceId - Provenance ID
        did - Identifier of the entity created
        agentId - Agent Identifier
        activityId - Identifier of the activity creating the new entity
        signature - Signature (optional) provided by the agent involved
        attributes - Attributes associated with the action
        Returns:
        true if the provenance event was registered correctly
        Throws:
        ProvenanceException - Error registering the event
      • wasDerivedFrom

        public boolean wasDerivedFrom​(String provenanceId,
                                      DID newEntityDid,
                                      DID usedEntityDid,
                                      String agentId,
                                      String activityId,
                                      String attributes)
                               throws ProvenanceException
        Description copied from interface: ProvenanceAPI
        Implements the W3C PROV Derivation action
        Specified by:
        wasDerivedFrom in interface ProvenanceAPI
        Parameters:
        provenanceId - Provenance ID
        newEntityDid - Identifier of the new entity derived
        usedEntityDid - Identifier of the entity used to derive the new entity
        agentId - Agent Identifier
        activityId - Identifier of the activity creating the new entity
        attributes - Attributes associated with the action
        Returns:
        true if the provenance event was registered correctly
        Throws:
        ProvenanceException - Error registering the event
      • wasAssociatedWith

        public boolean wasAssociatedWith​(String provenanceId,
                                         DID did,
                                         String agentId,
                                         String activityId,
                                         String attributes)
                                  throws ProvenanceException
        Description copied from interface: ProvenanceAPI
        Implements the W3C PROV Association action
        Specified by:
        wasAssociatedWith in interface ProvenanceAPI
        Parameters:
        provenanceId - Provenance ID
        did - Identifier of the entity created
        agentId - Agent Identifier
        activityId - Identifier of the activity creating the new entity
        attributes - Attributes associated with the action
        Returns:
        true if the provenance event was registered correctly
        Throws:
        ProvenanceException - Error registering the event
      • actedOnBehalf

        public boolean actedOnBehalf​(String provenanceId,
                                     DID did,
                                     String delegateAgentId,
                                     String responsibleAgentId,
                                     String activityId,
                                     String signature,
                                     String attributes)
                              throws ProvenanceException
        Description copied from interface: ProvenanceAPI
        Implements the W3C PROV Delegation action
        Specified by:
        actedOnBehalf in interface ProvenanceAPI
        Parameters:
        provenanceId - Provenance ID
        did - Identifier of the entity created
        delegateAgentId - Delegate Agent Identifier
        responsibleAgentId - Responsible Agent Identifier
        activityId - Identifier of the activity creating the new entity
        signature - Signature provided by the delegated agent
        attributes - Attributes associated with the action
        Returns:
        true if the provenance event was registered correctly
        Throws:
        ProvenanceException - Error registering the event
      • getProvenanceEntry

        public ProvenanceEntry getProvenanceEntry​(String provenanceId)
                                           throws ProvenanceException
        Description copied from interface: ProvenanceAPI
        Fetch from the on-chain Provenance registry the information about one provenance event, given a provenance id
        Specified by:
        getProvenanceEntry in interface ProvenanceAPI
        Parameters:
        provenanceId - unique identifier of the provenance entry
        Returns:
        ProvenanceEntry object with all the information stored on-chain
        Throws:
        ProvenanceException - Error fetching the data
      • isProvenanceDelegate

        public boolean isProvenanceDelegate​(DID did,
                                            String delegate)
                                     throws ProvenanceException
        Description copied from interface: ProvenanceAPI
        Indicates if an address is a provenance delegate for a given DID
        Specified by:
        isProvenanceDelegate in interface ProvenanceAPI
        Parameters:
        did - Identifier of the asset
        delegate - address of the delegate
        Returns:
        true if the address is a provenance delegate
        Throws:
        ProvenanceException - Error fetching the data
      • addDIDProvenanceDelegate

        public boolean addDIDProvenanceDelegate​(DID did,
                                                String delegate)
                                         throws ProvenanceException
        Description copied from interface: ProvenanceAPI
        Adds an address as delegate for a given DID
        Specified by:
        addDIDProvenanceDelegate in interface ProvenanceAPI
        Parameters:
        did - Identifier of the asset
        delegate - address of the delegate
        Returns:
        true if the address was added as a delegate for the DID given
        Throws:
        ProvenanceException - Error fetching the data
      • removeDIDProvenanceDelegate

        public boolean removeDIDProvenanceDelegate​(DID did,
                                                   String delegate)
                                            throws ProvenanceException
        Description copied from interface: ProvenanceAPI
        Remove an address as delegate for a given DID
        Specified by:
        removeDIDProvenanceDelegate in interface ProvenanceAPI
        Parameters:
        did - Identifier of the asset
        delegate - address of the delegate
        Returns:
        true if the address was removed as a delegate for the DID given
        Throws:
        ProvenanceException - Error fetching the data