Package io.keyko.nevermined.models
Class DDO
- java.lang.Object
-
- io.keyko.nevermined.models.AbstractModel
-
- io.keyko.nevermined.models.DDO
-
- All Implemented Interfaces:
FromJsonToModel
public class DDO extends AbstractModel implements FromJsonToModel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classDDO.Authenticationstatic classDDO.Proof(package private) static classDDO.PublicKey
-
Field Summary
Fields Modifier and Type Field Description List<DDO.Authentication>authenticationprivate static StringAUTHENTICATION_TYPEStringcontextDatecreatedprivate DIDdidStringidprivate static org.apache.logging.log4j.LoggerlogDDO.ProofproofList<DDO.PublicKey>publicKeysList<Service>servicesDateupdatedprivate static StringUUID_PROOF_TYPE-
Fields inherited from class io.keyko.nevermined.models.AbstractModel
DATE_FORMAT, DATE_PATTERN, logger
-
-
Constructor Summary
Constructors Constructor Description DDO()DDO(MetadataService metadataService, String publicKey, String signature)
-
Method Summary
-
Methods inherited from class io.keyko.nevermined.models.AbstractModel
checksum, convertToModel, fromJSON, getDateNowFormatted, getMapperInstance, toJson, toJson
-
-
-
-
Field Detail
-
log
private static final org.apache.logging.log4j.Logger log
-
UUID_PROOF_TYPE
private static final String UUID_PROOF_TYPE
- See Also:
- Constant Field Values
-
AUTHENTICATION_TYPE
private static final String AUTHENTICATION_TYPE
- See Also:
- Constant Field Values
-
context
public String context
-
id
public String id
-
did
private DID did
-
publicKeys
public List<DDO.PublicKey> publicKeys
-
authentication
public List<DDO.Authentication> authentication
-
proof
public DDO.Proof proof
-
created
public Date created
-
updated
public Date updated
-
-
Constructor Detail
-
DDO
public DDO()
-
DDO
public DDO(MetadataService metadataService, String publicKey, String signature) throws DIDFormatException
- Throws:
DIDFormatException
-
-
Method Detail
-
didSetter
public void didSetter(String id) throws DIDFormatException
- Throws:
DIDFormatException
-
sortServices
private void sortServices()
-
servicesSetter
public void servicesSetter(ArrayList<LinkedHashMap> services)
-
integrityBuilder
public DDO integrityBuilder(org.web3j.crypto.Credentials credentials) throws DDOException
Given a user credentials this method do the following: - Calculate the individual DDO.services checksums - Calculate the DID using the hash of the DDO.services checksums - Generate the DDO.proof entry signing the DID generated and adding the credentials information- Parameters:
credentials- account credentials- Returns:
- DDO
- Throws:
DDOException- if there is an error calculating anything
-
secretStoreLocalEncryptFiles
public DDO secretStoreLocalEncryptFiles(SecretStoreManager secretStoreManager, AuthConfig authConfig) throws DDOException
- Throws:
DDOException
-
gatewayEncryptFiles
public DDO gatewayEncryptFiles(AuthConfig authConfig) throws DDOException
- Throws:
DDOException
-
generateChecksums
public SortedMap<String,String> generateChecksums() throws DDOException
- Throws:
DDOException
-
generateDID
public static DID generateDID() throws DIDFormatException
- Throws:
DIDFormatException
-
getDid
public DID getDid()
-
getAccessService
public AccessService getAccessService(int index) throws ServiceException
- Throws:
ServiceException
-
getService
public Service getService(int index) throws ServiceException
- Throws:
ServiceException
-
getServiceByTemplate
public Service getServiceByTemplate(String templateId) throws ServiceException
- Throws:
ServiceException
-
getAuthorizationService
public AuthorizationService getAuthorizationService(int serviceDefinitionId)
-
getAuthorizationService
public AuthorizationService getAuthorizationService()
-
getMetadataService
public Service getMetadataService()
-
getAccessService
public AccessService getAccessService()
-
getComputeService
public ComputingService getComputeService()
-
-