|
1 | 1 | package com.apicatalog.did.resolver; |
2 | 2 |
|
| 3 | +import java.time.Instant; |
| 4 | +import java.util.Collections; |
| 5 | +import java.util.Set; |
| 6 | + |
| 7 | +import com.apicatalog.did.Did; |
| 8 | + |
| 9 | +/** |
| 10 | + * Metadata associated with a resolved DID Document, as defined in |
| 11 | + * <a href="https://www.w3.org/TR/did-core/#did-document-metadata">DID Core — |
| 12 | + * DID Document Metadata</a>. |
| 13 | + */ |
3 | 14 | public interface DidDocumentMetadata { |
4 | 15 |
|
| 16 | + /** |
| 17 | + * The timestamp when the DID Document was created. |
| 18 | + * |
| 19 | + * @return creation time, or {@code null} if not provided |
| 20 | + */ |
| 21 | + default Instant created() { |
| 22 | + return null; |
| 23 | + } |
| 24 | + |
| 25 | + /** |
| 26 | + * The timestamp when the DID Document was last updated. |
| 27 | + * |
| 28 | + * @return last update time, or {@code null} if not provided |
| 29 | + */ |
| 30 | + default Instant updated() { |
| 31 | + return null; |
| 32 | + } |
| 33 | + |
| 34 | + /** |
| 35 | + * Indicates whether the DID has been deactivated. |
| 36 | + * |
| 37 | + * @return {@code true} if deactivated, otherwise {@code false} |
| 38 | + */ |
| 39 | + default boolean deactivated() { |
| 40 | + return false; |
| 41 | + } |
| 42 | + |
| 43 | + /** |
| 44 | + * A timestamp after which the DID Document should be refreshed. |
| 45 | + * |
| 46 | + * @return refresh time, or {@code null} if not specified |
| 47 | + */ |
| 48 | + default Instant refresh() { |
| 49 | + return null; |
| 50 | + } |
| 51 | + |
| 52 | + /** |
| 53 | + * The identifier for the current version of the DID Document. |
| 54 | + * |
| 55 | + * @return version identifier, or {@code null} if not provided |
| 56 | + */ |
| 57 | + default String versionId() { |
| 58 | + return null; |
| 59 | + } |
| 60 | + |
| 61 | + /** |
| 62 | + * The identifier of the next version of the DID Document. |
| 63 | + * |
| 64 | + * @return next version identifier, or {@code null} if not provided |
| 65 | + */ |
| 66 | + default String nextVersionId() { |
| 67 | + return null; |
| 68 | + } |
| 69 | + |
| 70 | + /** |
| 71 | + * Equivalent identifiers for the DID, if any. |
| 72 | + * |
| 73 | + * @return a set of equivalent DIDs, never {@code null} |
| 74 | + */ |
| 75 | + default Set<Did> equivalentId() { |
| 76 | + return Collections.emptySet(); |
| 77 | + } |
| 78 | + |
| 79 | + /** |
| 80 | + * The canonical identifier for the DID. |
| 81 | + * |
| 82 | + * @return canonical DID, or {@code null} if not provided |
| 83 | + */ |
| 84 | + default Did canonicalId() { |
| 85 | + return null; |
| 86 | + } |
5 | 87 | } |
0 commit comments