Class EntityArchive

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ISubmission>, ISubmission

    @Entity(name="Archive")
    public class EntityArchive
    extends java.lang.Object
    implements ISubmission, java.io.Serializable
    ISubmission object for base storage implementation
    See Also:
    Serialized Form
    • Constructor Detail

      • EntityArchive

        public EntityArchive()
      • EntityArchive

        public EntityArchive​(java.lang.String name)
    • Method Detail

      • compareTo

        public int compareTo​(@NotNull
                             @NotNull ISubmission o)
        Specified by:
        compareTo in interface java.lang.Comparable<ISubmission>
      • equals

        public boolean equals​(ISubmission o)
        Description copied from interface: ISubmission
        submission equality check
        Specified by:
        equals in interface ISubmission
        Parameters:
        o - submission to check against
        Returns:
        is submission equal
      • getAllFiles

        public java.util.List<ISourceFile> getAllFiles()
        Description copied from interface: ISubmission
        Returns a list of all files, across all levels of this submission
        Specified by:
        getAllFiles in interface ISubmission
        Returns:
        total list of files
      • getContainedDirectories

        public java.util.List<ISubmission> getContainedDirectories()
        Description copied from interface: ISubmission
        Returns a list of sub-directories on this level of the submission structure
        Specified by:
        getContainedDirectories in interface ISubmission
        Returns:
        the list of immediate sub-directories
      • getContainedFiles

        public java.util.List<ISourceFile> getContainedFiles()
        Description copied from interface: ISubmission
        Returns a list of files on this level of the submission structure
        Specified by:
        getContainedFiles in interface ISubmission
        Returns:
        the list of files in this directory
      • getFileCount

        public int getFileCount()
        Description copied from interface: ISubmission
        Calculates the file count of this directory and all subdirectories
        Specified by:
        getFileCount in interface ISubmission
        Returns:
        count
      • getId

        public long getId()
        Description copied from interface: ISubmission
        Fetches the submission unique id
        Specified by:
        getId in interface ISubmission
        Returns:
        the unique id
      • getName

        public java.lang.String getName()
        Description copied from interface: ISubmission
        The name of the submission, should uniquely identify the submission content
        Specified by:
        getName in interface ISubmission
        Returns:
        String containing the name
      • getParent

        public ISubmission getParent()
        Description copied from interface: ISubmission
        Get the parent, return null if no parent exists
        Specified by:
        getParent in interface ISubmission
        Returns:
        parent or null if there isn't one
      • getTotalFileCount

        public int getTotalFileCount()
        Description copied from interface: ISubmission
        Returns the total count of all files in this submission
        Specified by:
        getTotalFileCount in interface ISubmission
        Returns:
        the total file count
      • hasParent

        public boolean hasParent()
        Description copied from interface: ISubmission
        Does this instance have a parent submission. If true this instance is a containedDirectory of the parent
        Specified by:
        hasParent in interface ISubmission
        Returns:
        has a parent
      • remove

        public void remove()
        Description copied from interface: ISubmission
        Remove the submission from the database, cannot be recovered.
        Specified by:
        remove in interface ISubmission
      • setSubmissionArchive

        public void setSubmissionArchive​(EntityWorkspace workspace)