gov.nih.nci.caarray.domain.permissions
Class AccessProfile

java.lang.Object
  extended by gov.nih.nci.caarray.domain.permissions.AccessProfile
All Implemented Interfaces:
com.fiveamsolutions.nci.commons.data.persistent.PersistentObject, java.io.Serializable, java.lang.Comparable<AccessProfile>

public class AccessProfile
extends java.lang.Object
implements com.fiveamsolutions.nci.commons.data.persistent.PersistentObject, java.io.Serializable, java.lang.Comparable<AccessProfile>

Container class that models the read and write permissions to samples.

See Also:
Serialized Form

Constructor Summary
AccessProfile()
          Hibernate-only constructor.
AccessProfile(SecurityLevel securityLevel)
          Creates a new profile with given initial security level.
 
Method Summary
 int compareTo(AccessProfile profile)
          Compares Access Profiles by group name, putting "The Public" after Collaboration groups.
 CollaboratorGroup getGroup()
           
 java.lang.Long getId()
           
 Project getProject()
           
 java.util.Map<Sample,SampleSecurityLevel> getSampleSecurityLevels()
           
 SecurityLevel getSecurityLevel()
           
 boolean isGroupProfile()
           
 boolean isPublicProfile()
           
 void setGroup(CollaboratorGroup group)
           
 void setId(java.lang.Long id)
          Deprecated. should only be used by castor, hibernate and struts
 void setProjectForGroupProfile(Project projectForGroupProfile)
           
 void setProjectForPublicProfile(Project projectForPublicProfile)
           
 void setSampleSecurityLevels(java.util.Map<Sample,SampleSecurityLevel> sampleSecurityLevels)
           
 void setSecurityLevel(SecurityLevel securityLevel)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessProfile

public AccessProfile()
Hibernate-only constructor.


AccessProfile

public AccessProfile(SecurityLevel securityLevel)
Creates a new profile with given initial security level.

Parameters:
securityLevel - initial security level
Method Detail

getId

public java.lang.Long getId()
Specified by:
getId in interface com.fiveamsolutions.nci.commons.data.persistent.PersistentObject
Returns:
database identifier

setId

@Deprecated
public void setId(java.lang.Long id)
Deprecated. should only be used by castor, hibernate and struts

Sets the id.

Parameters:
id - the id to set

getSecurityLevel

public SecurityLevel getSecurityLevel()
Returns:
the securityLevel

setSecurityLevel

public void setSecurityLevel(SecurityLevel securityLevel)
Parameters:
securityLevel - the securityLevel to set

getSampleSecurityLevels

public java.util.Map<Sample,SampleSecurityLevel> getSampleSecurityLevels()
Returns:
Mapping of samples to the security level for each sample

setSampleSecurityLevels

public void setSampleSecurityLevels(java.util.Map<Sample,SampleSecurityLevel> sampleSecurityLevels)
Parameters:
sampleSecurityLevels - the sampleSecurityLevels to set

setProjectForPublicProfile

public void setProjectForPublicProfile(Project projectForPublicProfile)
Parameters:
projectForPublicProfile - the projectForPublicProfile to set DEVELOPER NOTE: This method should not generally never be called. It needs to remain public as it must be called by Project to establish the symmetric link

setProjectForGroupProfile

public void setProjectForGroupProfile(Project projectForGroupProfile)
Parameters:
projectForGroupProfile - the projectForGroupProfile to set DEVELOPER NOTE: This method should not generally never be called. It needs to remain public as it must be called by Project to establish the symmetric link

isPublicProfile

public boolean isPublicProfile()
Returns:
whether this is a public profile

isGroupProfile

public boolean isGroupProfile()
Returns:
whether this is a group profile

getProject

public Project getProject()
Returns:
the project to which this access profile belongs

getGroup

public CollaboratorGroup getGroup()
Returns:
the group

setGroup

public void setGroup(CollaboratorGroup group)
Parameters:
group - for group access profiles only, the group to which this profile corresponds This method should not generally never be called. It needs to remain public as it must be called by Project.addProfile to establish the symmetric link

compareTo

public int compareTo(AccessProfile profile)
Compares Access Profiles by group name, putting "The Public" after Collaboration groups.

Specified by:
compareTo in interface java.lang.Comparable<AccessProfile>
Parameters:
profile - other Access Profile to compare to
Returns:
result of comparison