Package net.sf.basedb.core
Class CommonItem
- java.lang.Object
-
- net.sf.basedb.core.BasicItem
-
- net.sf.basedb.core.OwnedItem
-
- net.sf.basedb.core.SharedItem
-
- net.sf.basedb.core.CommonItem
-
- All Implemented Interfaces:
AccessControlled
,Identifiable
,Nameable
,Ownable
,Removable
,Shareable
- Direct Known Subclasses:
AnnotatedItem
,AnnotationType
,AnnotationTypeCategory
,BioPlateEvent
,Client
,FileServer
,Formula
,Job
,JobAgent
,PermissionTemplate
,PlateMapping
,PlateType
,PluginDefinition
,ReporterCloneTemplate
,ReporterList
public abstract class CommonItem extends SharedItem implements Nameable, Removable
- Version:
- 2.0
- Author:
- Nicklas
-
-
Field Summary
-
Fields inherited from interface net.sf.basedb.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
-
-
Constructor Summary
Constructors Constructor Description CommonItem(CommonData commonData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) CommonData
getData()
Get theBasicData
object that holds all data for this item.String
getDescription()
Get the description for the item.String
getName()
Get the name of the item.User
getRemovedBy()
Get the user that flagged this item for removal.boolean
isRemoved()
Check if the removed flag is set for this item.void
setDescription(String description)
Set the description for the item.void
setName(String name)
Set the name of the item.void
setRemoved(boolean removed)
Set the removed flag for this item.-
Methods inherited from class net.sf.basedb.core.SharedItem
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey
-
Methods inherited from class net.sf.basedb.core.OwnedItem
getOwner, isOwner, setOwner, takeOwnership
-
Methods inherited from class net.sf.basedb.core.BasicItem
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
-
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getType, getVersion
-
Methods inherited from interface net.sf.basedb.core.Ownable
getOwner, isOwner, setOwner, takeOwnership
-
-
-
-
Constructor Detail
-
CommonItem
CommonItem(CommonData commonData)
-
-
Method Detail
-
getData
CommonData getData()
Description copied from class:BasicItem
Get theBasicData
object that holds all data for this item.- Overrides:
getData
in classSharedItem
-
getName
public String getName()
Description copied from interface:Nameable
Get the name of the item.
-
setName
public void setName(String name) throws PermissionDeniedException, InvalidDataException
Description copied from interface:Nameable
Set the name of the item. The name cannot be null and mustn't be longer than the value specified by theNameable.MAX_NAME_LENGTH
constant.- Specified by:
setName
in interfaceNameable
- Parameters:
name
- The new name for the item- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionInvalidDataException
- If the name is null or longer than specified by theNameable.MAX_NAME_LENGTH
constant
-
getDescription
public String getDescription()
Description copied from interface:Nameable
Get the description for the item.- Specified by:
getDescription
in interfaceNameable
- Returns:
- A
String
with a description of the item
-
setDescription
public void setDescription(String description) throws PermissionDeniedException, InvalidDataException
Description copied from interface:Nameable
Set the description for the item. The description can be null but mustn't be longer than the value specified by theNameable.MAX_DESCRIPTION_LENGTH
constant.- Specified by:
setDescription
in interfaceNameable
- Parameters:
description
- The new description for the item- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionInvalidDataException
- If the description longer than specified by theNameable.MAX_DESCRIPTION_LENGTH
constant
-
isRemoved
public boolean isRemoved()
Description copied from interface:Removable
Check if the removed flag is set for this item.
-
setRemoved
public void setRemoved(boolean removed) throws PermissionDeniedException
Description copied from interface:Removable
Set the removed flag for this item.- Specified by:
setRemoved
in interfaceRemovable
- Parameters:
removed
- TRUE if the item should be flagged as removed, FALSE otherwise- Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.DELETE
permission for setting the flag to TRUE orPermission.WRITE
permission for setting the flag to FALSE
-
getRemovedBy
public User getRemovedBy() throws PermissionDeniedException, ItemNotFoundException
Description copied from interface:Removable
Get the user that flagged this item for removal.- Specified by:
getRemovedBy
in interfaceRemovable
- Returns:
- A User object, or null if this item has not been flagged
- Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission for the userItemNotFoundException
- If the user that removed this item can't be found
-
-