gov.nih.nci.caarray.domain.project
Class Project

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.project.Project
All Implemented Interfaces:
com.fiveamsolutions.nci.commons.data.persistent.PersistentObject, gov.nih.nci.caarray.security.Protectable, java.io.Serializable, java.lang.Comparable<Project>

public class Project
extends AbstractCaArrayEntity
implements java.lang.Comparable<Project>, gov.nih.nci.caarray.security.Protectable

A microarray project.

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
Project()
          Hibernate and caster constructor.
 
Method Summary
 AccessProfile addGroupProfile(CollaboratorGroup group)
          Add a new AccessProfile for a collaborator group unless the project already has a profile for this group.
 boolean canModifyPermissions(gov.nih.nci.security.authorization.domainobjects.User user)
          Returns whether the given user has permission to modify permissions for this project.
 int compareTo(Project o)
          
 java.util.Collection<AccessProfile> getAllAccessProfiles()
           
 Experiment getExperiment()
          Gets the experiment.
 java.util.Set<java.lang.String> getFileNames()
           
 java.util.SortedSet<CaArrayFile> getFiles()
          Gets all the files.
 CaArrayFileSet getFileSet()
           
 java.util.Map<CollaboratorGroup,AccessProfile> getGroupProfiles()
           
 java.lang.String getImportDescription()
           
 java.util.SortedSet<CaArrayFile> getImportedFiles()
          Get the files.
 java.util.SortedSet<CaArrayFile> getImportingFiles()
          Get the files.
 java.util.Date getLastUpdated()
          Gets the last updated date.
 java.util.Set<gov.nih.nci.security.authorization.domainobjects.User> getOwners()
           
 AccessProfile getPublicProfile()
           
 java.util.Set<gov.nih.nci.caarray.security.SecurityPolicy> getRemoteApiSecurityPolicies(gov.nih.nci.security.authorization.domainobjects.User user)
          Return the set of security policies that should be applied to this object prior to it being returned as part of a return value for a remote API call.
 java.util.SortedSet<CaArrayFile> getUnImportedFiles()
          Get the files.
 java.util.SortedSet<CaArrayFile> getUserVisibleFiles()
          Get user visible imported files.
 java.util.SortedSet<CaArrayFile> getUserVisibleImportedFiles()
          Get user visible imported files.
 java.util.SortedSet<CaArrayFile> getUserVisibleSupplementalFiles()
          Get user visible supplemental files.
 java.util.SortedSet<CaArrayFile> getUserVisibleUnImportedFiles()
          Get user visible unimported files.
 boolean hasReadPermission(gov.nih.nci.security.authorization.domainobjects.User user)
          Returns whether the given user has read permissions to this project.
 boolean hasWritePermission(gov.nih.nci.security.authorization.domainobjects.User user)
          Returns whether the given user has write permissions to this project.
 boolean isCollaborator(gov.nih.nci.security.authorization.domainobjects.User user)
          Returns whether the given user is a collaborator on this project, ie whether he is in any of the collaborator groups that have an access profile with a security level greater than "None" configured for this project.
 boolean isImportingData()
           
 boolean isLocked()
          Gets the workflow status of this project.
 boolean isOwner(gov.nih.nci.security.authorization.domainobjects.User user)
          Checks whether a given user is an owner of this project.
 boolean isUnparsedAndReimportable()
          Check whether this is a experiment that was previously imported but not parsed, but now can be imported and parsed (due to a parsing FileHandler being implemented for it).
 AccessProfile removeGroupProfile(CollaboratorGroup group)
          remove the access profile for given collaborator group from this project.
 void setExperiment(Experiment experimentVal)
          Sets the experiment.
 void setFiles(java.util.SortedSet<CaArrayFile> filesVal)
          Sets the files.
 void setImportDescription(java.lang.String importDescription)
           
 void setLastUpdated(java.util.Date lastUpdated)
          Sets the last updated date.
 void setLocked(boolean locked)
          Sets the workflow status of this project.
 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, 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

Project

public Project()
Hibernate and caster constructor.

Method Detail

isLocked

@NotNull
@AttributePolicy(allow="Browse")
public boolean isLocked()
Gets the workflow status of this project. Hibernate use only

Returns:
the true if this project is in a lock box.

setLocked

public void setLocked(boolean locked)
Sets the workflow status of this project. Hibernate use only

Parameters:
locked - the locked status to set.

isImportingData

public boolean isImportingData()
Returns:
whether this project currently has any files that are being actively imported.

getExperiment

@AttributePolicy(allow="Browse")
@Valid
public Experiment getExperiment()
Gets the experiment.

Returns:
the experiment

setExperiment

public void setExperiment(Experiment experimentVal)
Sets the experiment.

Parameters:
experimentVal - the experiment

getFiles

public java.util.SortedSet<CaArrayFile> getFiles()
Gets all the files.

Returns:
the files

getUserVisibleFiles

public java.util.SortedSet<CaArrayFile> getUserVisibleFiles()
Get user visible imported files.

Returns:
the files.

setFiles

public void setFiles(java.util.SortedSet<CaArrayFile> filesVal)
Sets the files.

Parameters:
filesVal - the files to set

getImportedFiles

public java.util.SortedSet<CaArrayFile> getImportedFiles()
Get the files.

Returns:
the files.

getUserVisibleImportedFiles

public java.util.SortedSet<CaArrayFile> getUserVisibleImportedFiles()
Get user visible imported files.

Returns:
the files.

getImportingFiles

public java.util.SortedSet<CaArrayFile> getImportingFiles()
Get the files.

Returns:
the files.

getUserVisibleSupplementalFiles

public java.util.SortedSet<CaArrayFile> getUserVisibleSupplementalFiles()
Get user visible supplemental files.

Returns:
the files.

getUnImportedFiles

public java.util.SortedSet<CaArrayFile> getUnImportedFiles()
Get the files.

Returns:
the files.

getUserVisibleUnImportedFiles

public java.util.SortedSet<CaArrayFile> getUserVisibleUnImportedFiles()
Get user visible unimported files.

Returns:
the files.

getFileSet

public CaArrayFileSet getFileSet()
Returns:
the files contained in the project as a set.

getFileNames

public java.util.Set<java.lang.String> getFileNames()
Returns:
the names of the files contained in this project.

getPublicProfile

@AttributePolicy(allow="Browse")
public AccessProfile getPublicProfile()
Returns:
public access profile

getGroupProfiles

public java.util.Map<CollaboratorGroup,AccessProfile> getGroupProfiles()
Returns:
collaborator access profiles

addGroupProfile

public AccessProfile addGroupProfile(CollaboratorGroup group)
Add a new AccessProfile for a collaborator group unless the project already has a profile for this group.

Parameters:
group - to add profile for
Returns:
if there already existed a profile for that group, then it is returned, otherwise a new profile is added and returned

removeGroupProfile

public AccessProfile removeGroupProfile(CollaboratorGroup group)
remove the access profile for given collaborator group from this project.

Parameters:
group - to remove profile for
Returns:
the profile previously associated with given group, or null if there weren't any

getAllAccessProfiles

public java.util.Collection<AccessProfile> getAllAccessProfiles()
Returns:
all the access profiles associated with this project (public, host, and the various group ones)

getOwners

public java.util.Set<gov.nih.nci.security.authorization.domainobjects.User> getOwners()
Returns:
the data owner of this project

isOwner

public boolean isOwner(gov.nih.nci.security.authorization.domainobjects.User user)
Checks whether a given user is an owner of this project.

Parameters:
user - user to check
Returns:
whether the given user is an owner of this project

hasReadPermission

public boolean hasReadPermission(gov.nih.nci.security.authorization.domainobjects.User user)
Returns whether the given user has read permissions to this project.

Parameters:
user - the user (can be the synthetic "anonymous" permission)
Returns:
whether the user has read permissions to this project

hasWritePermission

public boolean hasWritePermission(gov.nih.nci.security.authorization.domainobjects.User user)
Returns whether the given user has write permissions to this project.

Parameters:
user - the user (can be the synthetic "anonymous" permission)
Returns:
whether the user has write permissions to this project

canModifyPermissions

public boolean canModifyPermissions(gov.nih.nci.security.authorization.domainobjects.User user)
Returns whether the given user has permission to modify permissions for this project.

Parameters:
user - the user (can be the synthetic "anonymous" permission)
Returns:
whether the user has permissions to modify permissions for this project

isCollaborator

public boolean isCollaborator(gov.nih.nci.security.authorization.domainobjects.User user)
Returns whether the given user is a collaborator on this project, ie whether he is in any of the collaborator groups that have an access profile with a security level greater than "None" configured for this project.

Parameters:
user - the user (can be the synthetic "anonymous" user)
Returns:
whether the user is a collaborator for this project

getLastUpdated

@AttributePolicy(allow="Browse")
public java.util.Date getLastUpdated()
Gets the last updated date.

Returns:
the last date this experiment was updated

setLastUpdated

public void setLastUpdated(java.util.Date lastUpdated)
Sets the last updated date.

Parameters:
lastUpdated - the last date this experiment was updated

getRemoteApiSecurityPolicies

public java.util.Set<gov.nih.nci.caarray.security.SecurityPolicy> getRemoteApiSecurityPolicies(gov.nih.nci.security.authorization.domainobjects.User user)
Return the set of security policies that should be applied to this object prior to it being returned as part of a return value for a remote API call.

Overrides:
getRemoteApiSecurityPolicies in class AbstractCaArrayObject
Parameters:
user - the current user.
Returns:
the set of policies to apply to this object, given the current user.

compareTo

public int compareTo(Project o)

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

toString

public java.lang.String toString()

Overrides:
toString in class AbstractCaArrayObject

isUnparsedAndReimportable

public boolean isUnparsedAndReimportable()
Check whether this is a experiment that was previously imported but not parsed, but now can be imported and parsed (due to a parsing FileHandler being implemented for it). This will be the case if all of the imported data files associated with the experiment meet this condition.

Returns:
true if the experiment has repasable data files.

getImportDescription

public java.lang.String getImportDescription()
Returns:
the importDescription

setImportDescription

public void setImportDescription(java.lang.String importDescription)
Parameters:
importDescription - the importDescription to set