bali.notary.Document Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-bali-digital-notary Show documentation
Show all versions of java-bali-digital-notary Show documentation
This project defines the Java interfaces and classes for a digital notary.
/************************************************************************
* Copyright (c) Crater Dog Technologies(TM). All Rights Reserved. *
************************************************************************
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. *
* *
* This code is free software; you can redistribute it and/or modify it *
* under the terms of The MIT License (MIT), as published by the Open *
* Source Initiative. (See http://opensource.org/licenses/MIT) *
************************************************************************/
package bali.notary;
import bali.language.BaliComponent;
import bali.language.handlers.VersionStringHandler;
import craterdog.primitives.Tag;
import craterdog.primitives.VersionString;
import java.net.URI;
import org.joda.time.DateTime;
/**
* This class defines a digital citation that references a document in a way
* that ensures the document cannot be modified without detection.
*
* @author Derk Norton
*/
public abstract class Document extends BaliComponent {
/**
* The type of this component.
*/
public URI documentType;
/**
* The unique tag for this document.
*/
public Tag documentTag;
/**
* The version number of this document.
*/
public VersionString documentVersion;
/**
* The unique tag for the account that owns the document.
*/
public Tag accountTag;
/**
* The date and time when the document was created.
*/
public DateTime timestamp;
/**
* A citation of the previous version of the document, or null if this is the first.
*/
public Citation previousVersionCitation;
/**
* A citation of the public document for the notary that will notarize the document.
*/
public Citation notaryCertificateCitation;
/**
* This default constructor adds in specialized serialization handlers.
*/
public Document() {
addHandler(VersionString.class, new VersionStringHandler());
}
public URI getDocumentType() {
String typeString = "https://balicloud.net/" + this.getClass().getCanonicalName();
return URI.create(typeString);
}
}