Package com.oceanprotocol.squid.external
Class AquariusService
- java.lang.Object
-
- com.oceanprotocol.squid.external.AquariusService
-
public class AquariusService extends Object
Service for Aquarius's Integration
-
-
Field Summary
Fields Modifier and Type Field Description private static String
DDO_URI
private String
ddoEndpoint
private static org.apache.logging.log4j.Logger
log
-
Constructor Summary
Constructors Modifier Constructor Description private
AquariusService(String url)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DDO
createDDO(DDO ddo)
Registers a new DDO in AquariusDDO
getDDO(String url)
Gets a DDO from an URLString
getDdoEndpoint()
DDO
getDDOUsingId(String id)
Gets a DDO from the DIDstatic AquariusService
getInstance(String url)
Builds an instance of AquariusServiceboolean
retireAssetDDO(String id)
Retire the asset ddo from Aquarius.SearchResult
searchDDO(SearchQuery searchQuery)
Search all the DDOs that match the query passed as a parameterSearchResult
searchDDO(String param, int offset, int page)
Search all the DDOs that match the text passed as a parameterboolean
updateDDO(String id, DDO ddo)
Updates the metadata of a DDOboolean
validateMetadata(AssetMetadata metadata)
Check that the metadata has a valid format.
-
-
-
Field Detail
-
log
private static final org.apache.logging.log4j.Logger log
-
DDO_URI
private static final String DDO_URI
- See Also:
- Constant Field Values
-
ddoEndpoint
private String ddoEndpoint
-
-
Constructor Detail
-
AquariusService
private AquariusService(String url)
Constructor- Parameters:
url
- the url of aquarius
-
-
Method Detail
-
getInstance
public static AquariusService getInstance(String url)
Builds an instance of AquariusService- Parameters:
url
- url of aquarius- Returns:
- AquariusService instance
-
getDdoEndpoint
public String getDdoEndpoint()
-
createDDO
public DDO createDDO(DDO ddo) throws DDOException
Registers a new DDO in Aquarius- Parameters:
ddo
- the ddo- Returns:
- the created DDO
- Throws:
DDOException
- DDOException
-
getDDO
public DDO getDDO(String url) throws DDOException
Gets a DDO from an URL- Parameters:
url
- the url- Returns:
- the DDO
- Throws:
DDOException
- DDOException
-
getDDOUsingId
public DDO getDDOUsingId(String id) throws Exception
Gets a DDO from the DID- Parameters:
id
- the DID- Returns:
- the DDO
- Throws:
Exception
- Exception
-
updateDDO
public boolean updateDDO(String id, DDO ddo) throws Exception
Updates the metadata of a DDO- Parameters:
id
- the didddo
- the DDO- Returns:
- a flag that indicates if the update operation was executed correctly
- Throws:
Exception
- Exception
-
searchDDO
public SearchResult searchDDO(String param, int offset, int page) throws DDOException
Search all the DDOs that match the text passed as a parameter- Parameters:
param
- the criteriaoffset
- parameter to paginatepage
- parameter to paginate- Returns:
- a List of all the DDOs found
- Throws:
DDOException
- DDOException
-
searchDDO
public SearchResult searchDDO(SearchQuery searchQuery) throws DDOException
Search all the DDOs that match the query passed as a parameter- Parameters:
searchQuery
- the query- Returns:
- a List of all the DDOs found
- Throws:
DDOException
- DDOException
-
retireAssetDDO
public boolean retireAssetDDO(String id) throws DDOException
Retire the asset ddo from Aquarius.- Parameters:
id
- 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
-
-