Last update: 2011-06-23

org.proteios.core
Class BioMaterial<D extends BioMaterialData>

java.lang.Object
  extended by org.proteios.core.BasicItem<D>
      extended by org.proteios.core.OwnedItem<D>
          extended by org.proteios.core.SharedItem<D>
              extended by org.proteios.core.CommonItem<D>
                  extended by org.proteios.core.AnnotatedItem<D>
                      extended by org.proteios.core.BioMaterial<D>
All Implemented Interfaces:
AccessControlled, Annotatable, Identifiable, Nameable, Ownable, Removable, Shareable
Direct Known Subclasses:
BioSource, MeasuredBioMaterial

public abstract class BioMaterial<D extends BioMaterialData>
extends AnnotatedItem<D>

This is the base class for for the four types of biomaterials: BioSource, Sample, Extract and LabeledExtract.

Version:
2.0
Author:
Nicklas
Last modified
$Date: 2009-04-09 08:48:11 +0200 (Thu, 09 Apr 2009) $

Field Summary
static int MAX_EXTERNAL_ID_LENGTH
          The maximum length of the external id that can be stored in the database.
static int MAX_STORAGE_LOCATION_LENGTH
          The maximum length of the storage location info that can be stored in the database.
 
Fields inherited from interface org.proteios.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Method Summary
 void addFile(File file)
          Add a File
 String getExternalId()
          Get the external id of the biomaterial.
 Set<File> getFiles()
           
 String getStorageLocation()
          Get the storage location of the biomaterial.
 void setExternalId(String externalId)
          Set the external id of the biomaterial.
 void setFiles(Set<File> files)
          Set the File files set.
 void setStorageLocation(String storageLocation)
          Set the storage location of the biomaterial.
 
Methods inherited from class org.proteios.core.CommonItem
getDescription, getName, isRemoved, setDescription, setName, setRemoved
 
Methods inherited from class org.proteios.core.SharedItem
getItemKey, getProjectKey, isShared, setItemKey, setProjectKey
 
Methods inherited from class org.proteios.core.OwnedItem
getOwner, setOwner
 
Methods inherited from class org.proteios.core.BasicItem
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.proteios.core.Identifiable
getId, getType, getVersion
 
Methods inherited from interface org.proteios.core.AccessControlled
checkPermission, hasPermission
 
Methods inherited from interface org.proteios.core.Ownable
getOwner, setOwner
 

Field Detail

MAX_EXTERNAL_ID_LENGTH

public static final int MAX_EXTERNAL_ID_LENGTH
The maximum length of the external id that can be stored in the database.

See Also:
setExternalId(String), Constant Field Values

MAX_STORAGE_LOCATION_LENGTH

public static final int MAX_STORAGE_LOCATION_LENGTH
The maximum length of the storage location info that can be stored in the database.

See Also:
setStorageLocation(String), Constant Field Values
Method Detail

getExternalId

public String getExternalId()
Get the external id of the biomaterial. This value can be used to link with information in external databases. It is not used by the Proteios core and it doesn't have to be unique.

Returns:
The external id for the biomaterial

setExternalId

public void setExternalId(String externalId)
                   throws PermissionDeniedException,
                          InvalidDataException
Set the external id of the biomaterial. The value may be null but must not be longer than the value specified by the MAX_EXTERNAL_ID_LENGTH constant.

Parameters:
externalId - The new value for the external id
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission
InvalidDataException - If the string is too long

addFile

public void addFile(File file)
Add a File

Parameters:
file - The File to add to the Set

getFiles

public Set<File> getFiles()
                   throws ItemNotFoundException,
                          BaseException
Returns:
Returns the files.
Throws:
ItemNotFoundException
BaseException

setFiles

public void setFiles(Set<File> files)
Set the File files set.

Parameters:
files - The new Set item.

getStorageLocation

public String getStorageLocation()
Get the storage location of the biomaterial.

Returns:
The storage location for the biomaterial

setStorageLocation

public void setStorageLocation(String storageLocation)
                        throws PermissionDeniedException,
                               InvalidDataException
Set the storage location of the biomaterial. The value may be null but must not be longer than the value specified by the MAX_STORAGE_LOCATION_LENGTH constant.

Parameters:
storageLocation - The new value for the storage location.
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission
InvalidDataException - If the string is too long

Last update: 2011-06-23