gov.nih.nci.caarray.domain.file
Class CaArrayFile

java.lang.Object
  extended by gov.nih.nci.caarray.domain.AbstractCaArrayObject
      extended by gov.nih.nci.caarray.domain.AbstractCaArrayEntity
          extended by gov.nih.nci.caarray.domain.file.CaArrayFile
All Implemented Interfaces:
com.fiveamsolutions.nci.commons.data.persistent.PersistentObject, gov.nih.nci.caarray.security.ProtectableDescendent, java.io.Serializable, java.lang.Comparable<CaArrayFile>

@UniqueConstraint(fields={@UniqueConstraintField(name="name"),@UniqueConstraintField(name="project"),@UniqueConstraintField(name="uniqueNameProject")},
                  message="{caarrayfile.uniqueConstraint}")
public class CaArrayFile
extends AbstractCaArrayEntity
implements java.lang.Comparable<CaArrayFile>, gov.nih.nci.caarray.security.ProtectableDescendent

This class represents metadata about a file managed by caArray.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayEntity
CAARRAY_LSID_AUTHORITY, CAARRAY_LSID_NAMESPACE
 
Fields inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayObject
DEFAULT_BATCH_SIZE, DEFAULT_STRING_COLUMN_SIZE, LARGE_TEXT_FIELD_LENGTH
 
Constructor Summary
CaArrayFile()
          Default blank constructor.
CaArrayFile(CaArrayFile parent)
          Creates a CaArrayFile with a parent.
 
Method Summary
 void addChild(CaArrayFile child)
          Adds a new child CaArrayFile.
 int compareTo(CaArrayFile o)
          
 java.util.Set<CaArrayFile> getChildren()
           
 long getCompressedSize()
           
 java.net.URI getDataHandle()
           
 FileStatus getFileStatus()
           
 FileType getFileType()
           
 java.lang.String getName()
          Gets the name.
 CaArrayFile getParent()
           
 long getPartialSize()
           
 Project getProject()
           
 java.lang.String getStatus()
           
 java.lang.String getType()
           
 long getUncompressedSize()
           
 gov.nih.nci.caarray.validation.FileValidationResult getValidationResult()
           
 boolean hasChildren()
          Indicates if the CaArrayFile has children (child CaArrayFile's) or not.
 boolean isImportable()
          Check whether this file is eligible to be imported.
 boolean isPartial()
           
 boolean isUnparsedAndReimportable()
          Check whether this is a file that was previously imported but not parsed, but now can be imported and parsed (due to a parsing FileHandler being implemented for it).
 boolean isValidatable()
          Check whether this file is eligible to be validated.
 java.util.Collection<? extends gov.nih.nci.caarray.security.Protectable> relatedProtectables()
          
 void removeChild(CaArrayFile child)
          Removes a child CaArrayFile.
 void setCompressedSize(long compressedSize)
          This method should generally not be called directly, as file size is calculated when data is written to the file.
 void setDataHandle(java.net.URI dataHandle)
           
 void setFileStatus(FileStatus fileStatus)
           
 void setFileType(FileType fileType)
           
 void setName(java.lang.String name)
          Sets the name.
 void setPartialSize(long partialSize)
           
 void setProject(Project project)
           
 void setType(java.lang.String type)
           
 void setUncompressedSize(long uncompressedSize)
          This method should generally not be called directly, as file size is calculated when data is written to the file.
 void setValidationResult(gov.nih.nci.caarray.validation.FileValidationResult validationResult)
           
 java.lang.String toString()
          
 
Methods inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayEntity
getLsid, getLsidAuthority, getLsidNamespace, getLsidObjectId, setLsid, setLsid, setLsidForEntity
 
Methods inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayObject
equals, getCaBigId, getId, getPostLoadSecurityPolicies, getRemoteApiSecurityPolicies, hashCode, setCaBigId, setId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.fiveamsolutions.nci.commons.data.persistent.PersistentObject
getId
 

Constructor Detail

CaArrayFile

public CaArrayFile()
Default blank constructor.


CaArrayFile

public CaArrayFile(CaArrayFile parent)
Creates a CaArrayFile with a parent.

Parameters:
parent - the parent file.
Method Detail

getName

public java.lang.String getName()
Gets the name.

Returns:
the name

setName

public void setName(java.lang.String name)
Sets the name.

Parameters:
name - the name

getFileStatus

public FileStatus getFileStatus()
Returns:
the fileStatus

setFileStatus

public void setFileStatus(FileStatus fileStatus)
Parameters:
fileStatus - the fileStatus to set

getFileType

public FileType getFileType()
Returns:
the fileType

setFileType

public void setFileType(FileType fileType)
Parameters:
fileType - the fileType to set

hasChildren

public boolean hasChildren()
Indicates if the CaArrayFile has children (child CaArrayFile's) or not.

Returns:
a boolean flag that indicates if the CaArrayFile has children or not.

getProject

public Project getProject()
Returns:
the project

setProject

public void setProject(Project project)
Parameters:
project - the project to set

getParent

public CaArrayFile getParent()
Returns:
the parent

isPartial

public boolean isPartial()
Returns:
whether or not this is a partial file. This is indicated by the record containing a parent or not.

getChildren

public java.util.Set<CaArrayFile> getChildren()
Returns:
the children

getUncompressedSize

public long getUncompressedSize()
Returns:
the uncompressed size, in bytes

setUncompressedSize

public void setUncompressedSize(long uncompressedSize)
This method should generally not be called directly, as file size is calculated when data is written to the file. It is left public to support use in query by example and tooling relying on JavaBean property conventions

Parameters:
uncompressedSize - the uncompressed size of the file, in bytes

getCompressedSize

public long getCompressedSize()
Returns:
the compressed size, in bytes

setCompressedSize

public void setCompressedSize(long compressedSize)
This method should generally not be called directly, as file size is calculated when data is written to the file. It is left public to support use in query by example and tooling relying on JavaBean property conventions

Parameters:
compressedSize - the compressed size of the file, in bytes

getPartialSize

public long getPartialSize()
Returns:
the partialSize

setPartialSize

public void setPartialSize(long partialSize)
Parameters:
partialSize - the partialSize to set

compareTo

public int compareTo(CaArrayFile o)

Specified by:
compareTo in interface java.lang.Comparable<CaArrayFile>

toString

public java.lang.String toString()

Overrides:
toString in class AbstractCaArrayObject

getStatus

@NotNull
public java.lang.String getStatus()
Returns:
the status

getType

public java.lang.String getType()
Returns:
the type

setType

public void setType(java.lang.String type)
Parameters:
type - the type to set

getValidationResult

public gov.nih.nci.caarray.validation.FileValidationResult getValidationResult()
Returns:
the validationResult

setValidationResult

public void setValidationResult(gov.nih.nci.caarray.validation.FileValidationResult validationResult)
Parameters:
validationResult - the validationResult to set

relatedProtectables

public java.util.Collection<? extends gov.nih.nci.caarray.security.Protectable> relatedProtectables()

Specified by:
relatedProtectables in interface gov.nih.nci.caarray.security.ProtectableDescendent

isImportable

public boolean isImportable()
Check whether this file is eligible to be imported.

Returns:
boolean

isValidatable

public boolean isValidatable()
Check whether this file is eligible to be validated.

Returns:
boolean

isUnparsedAndReimportable

public boolean isUnparsedAndReimportable()
Check whether this is a file that was previously imported but not parsed, but now can be imported and parsed (due to a parsing FileHandler being implemented for it).

Returns:
true if the file can be re-imported and parsed, false otherwise.

getDataHandle

@NotNull
public java.net.URI getDataHandle()
Returns:
the dataHandle

setDataHandle

public void setDataHandle(java.net.URI dataHandle)
Parameters:
dataHandle - the dataHandle to set

addChild

public void addChild(CaArrayFile child)
Adds a new child CaArrayFile.

Parameters:
child - the child CaArrayFile to add.

removeChild

public void removeChild(CaArrayFile child)
Removes a child CaArrayFile.

Parameters:
child - the child CaArrayFile to remove.