Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Jira Epic: 

Jira Legacy
serverSystem JIRA
serverIdba6fb084-9827-3160-8067-8ac7470f78b2
keyBRIDGE-2564

...

publicinterface File {

    String getName();

    void setName(String name);

  

    String getGuid();

    void setGuid(String guid);

    

    String getDescription();

    void setDescription(String description);

    

    /** Probably optional since S3 autodetects, but some files (e.g. without extensions) may need it. */

    String getMimeType();

    void setMimeType(String mimeType);

    

    /** Files support logical deletion. Revisions remain accessible on S3 for released clients and configurations. */

    boolean isDeleted();

    void setDeleted(boolean deleted);

}

...

public interface FileRevision {

    String getFileGuid();

    void setFileGuid(String fileGuid);

    

    /** To handle upload fails and upload URL expiration, we use the creation time of this record, not any timestamp of the S3 file itself. */

    DateTime getCreatedOn();

    void setCreatedOn(DateTime createdOn);

    

    String getDescription();

    void setDescription(String description);

    

    /** This is the presigned S3 URL to upload contents. Will be cleared when revision is moved to "available." */

    String getUploadURL();

    void setUploadURL(String uploadURL);

    

    FileStatus getFileStatus();

    void setFileStatus(FileStatus status);

    

    /** Synthetically derived from other data as: http://docs.sagebridge.org/<studyId>/<guid>/<createdOn> */

    String getDownloadURL();

    void setDownloadURL(String downloadURL);

}

...

public enum FileStatus {

    PENDING,

    AVAILABLE

...

There's currently a bucket for all documents in each environment. Treating that as root, documents would be filed in the following directory structure:/<study-id>

     /<file-guid>.<createdOn>/<study-id-2>

     /<file-guid>.<createdOn>

For other files we've used the long value for createdOn, the DateTime as a UTC ISO 8601 string might be easier to find when debugging so I would prefer to use that.

Note that these files will be served to clients through the CDN, so not all requests will require S3 (this help to keep download times acceptable regardless of where the client is located).