Package io.keyko.nevermined.api
Interface ProvenanceAPI
-
- All Known Implementing Classes:
ProvenanceImpl
public interface ProvenanceAPIExposes the Public API related with Provenance
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanactedOnBehalf(String provenanceId, DID did, String delegateAgentId, String responsibleAgentId, String activityId, String signature, String attributes)Implements the W3C PROV Delegation actionbooleanaddDIDProvenanceDelegate(DID did, String delegate)Adds an address as delegate for a given DIDList<ProvenanceEvent>getDIDProvenanceEvents(DID did)Search for ProvenanceAttributeRegistered events related with a specific DIDProvenanceEntrygetProvenanceEntry(String provenanceId)Fetch from the on-chain Provenance registry the information about one provenance event, given a provenance idList<ProvenanceEvent>getProvenanceMethodEvents(ProvenanceEntry.ProvenanceMethod method, DID did)Search for provenance methods (used, wasGeneratedBy, etc.) given a DIDStringgetProvenanceOwner(String provenanceId)Adds an address as delegate for a given DIDbooleanisProvenanceDelegate(DID did, String delegate)Indicates if an address is a provenance delegate for a given DIDbooleanremoveDIDProvenanceDelegate(DID did, String delegate)Remove an address as delegate for a given DIDbooleanused(String provenanceId, DID did, String agentId, String activityId, String signature, String attributes)Implements the W3C PROV Usage actionbooleanwasAssociatedWith(String provenanceId, DID did, String agentId, String activityId, String attributes)Implements the W3C PROV Association actionbooleanwasDerivedFrom(String provenanceId, DID newEntityDid, DID usedEntityDid, String agentId, String activityId, String attributes)Implements the W3C PROV Derivation action
-
-
-
Method Detail
-
used
boolean used(String provenanceId, DID did, String agentId, String activityId, String signature, String attributes) throws ProvenanceException
Implements the W3C PROV Usage action- Parameters:
provenanceId- Provenance IDdid- Identifier of the entity createdagentId- Agent IdentifieractivityId- Identifier of the activity creating the new entitysignature- Signature (optional) provided by the agent involvedattributes- Attributes associated with the action- Returns:
- true if the provenance event was registered correctly
- Throws:
ProvenanceException- Error registering the event
-
wasDerivedFrom
boolean wasDerivedFrom(String provenanceId, DID newEntityDid, DID usedEntityDid, String agentId, String activityId, String attributes) throws ProvenanceException
Implements the W3C PROV Derivation action- Parameters:
provenanceId- Provenance IDnewEntityDid- Identifier of the new entity derivedusedEntityDid- Identifier of the entity used to derive the new entityagentId- Agent IdentifieractivityId- Identifier of the activity creating the new entityattributes- Attributes associated with the action- Returns:
- true if the provenance event was registered correctly
- Throws:
ProvenanceException- Error registering the event
-
wasAssociatedWith
boolean wasAssociatedWith(String provenanceId, DID did, String agentId, String activityId, String attributes) throws ProvenanceException
Implements the W3C PROV Association action- Parameters:
provenanceId- Provenance IDdid- Identifier of the entity createdagentId- Agent IdentifieractivityId- Identifier of the activity creating the new entityattributes- Attributes associated with the action- Returns:
- true if the provenance event was registered correctly
- Throws:
ProvenanceException- Error registering the event
-
actedOnBehalf
boolean actedOnBehalf(String provenanceId, DID did, String delegateAgentId, String responsibleAgentId, String activityId, String signature, String attributes) throws ProvenanceException
Implements the W3C PROV Delegation action- Parameters:
provenanceId- Provenance IDdid- Identifier of the entity createddelegateAgentId- Delegate Agent IdentifierresponsibleAgentId- Responsible Agent IdentifieractivityId- Identifier of the activity creating the new entitysignature- Signature provided by the delegated agentattributes- Attributes associated with the action- Returns:
- true if the provenance event was registered correctly
- Throws:
ProvenanceException- Error registering the event
-
getProvenanceEntry
ProvenanceEntry getProvenanceEntry(String provenanceId) throws ProvenanceException
Fetch from the on-chain Provenance registry the information about one provenance event, given a provenance id- 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
boolean isProvenanceDelegate(DID did, String delegate) throws ProvenanceException
Indicates if an address is a provenance delegate for a given DID- Parameters:
did- Identifier of the assetdelegate- address of the delegate- Returns:
- true if the address is a provenance delegate
- Throws:
ProvenanceException- Error fetching the data
-
addDIDProvenanceDelegate
boolean addDIDProvenanceDelegate(DID did, String delegate) throws ProvenanceException
Adds an address as delegate for a given DID- Parameters:
did- Identifier of the assetdelegate- 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
boolean removeDIDProvenanceDelegate(DID did, String delegate) throws ProvenanceException
Remove an address as delegate for a given DID- Parameters:
did- Identifier of the assetdelegate- address of the delegate- Returns:
- true if the address was removed as a delegate for the DID given
- Throws:
ProvenanceException- Error fetching the data
-
getProvenanceOwner
String getProvenanceOwner(String provenanceId) throws ProvenanceException
Adds an address as delegate for a given DID- Parameters:
provenanceId- unique identifier of the provenance entry- Returns:
- String with the address owning the provenance entry
- Throws:
ProvenanceException- Error fetching the data
-
getDIDProvenanceEvents
List<ProvenanceEvent> getDIDProvenanceEvents(DID did) throws ProvenanceException
Search for ProvenanceAttributeRegistered events related with a specific DID- Parameters:
did- Identifier of the entity we are looking provenance events- Returns:
- List of ProvenanceEvents found
- Throws:
ProvenanceException- DDOException
-
getProvenanceMethodEvents
List<ProvenanceEvent> getProvenanceMethodEvents(ProvenanceEntry.ProvenanceMethod method, DID did) throws ProvenanceException
Search for provenance methods (used, wasGeneratedBy, etc.) given a DID- Parameters:
did- Identifier of the entity we are looking provenance eventsmethod- Provenance methods to fetch- Returns:
- List of ProvenanceEvents found
- Throws:
ProvenanceException- DDOException
-
-