public class QuotaType extends BasicItem<QuotaTypeData> implements Nameable, SystemItem, Registered
Modifier and Type | Field and Description |
---|---|
static String |
EXPERIMENT
The ID for experiments.
|
static String |
FILE
The ID for the file.
|
static String |
RAW_DATA
The ID for the raw data.
|
static String |
TOTAL
The ID for the total quota.
|
static Item |
TYPE
The type of item represented by this class.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
MAX_SYSTEM_ID_LENGTH
Constructor and Description |
---|
QuotaType(QuotaTypeData data)
Creates a new
QuotaType item. |
Modifier and Type | Method and Description |
---|---|
static QuotaType |
getById(DbControl dc,
int id)
Get a
QuotaType object when you know the id. |
String |
getDescription()
Get the description for the item.
|
Date |
getEntryDate()
Get the date that the item was registered in the database.
|
String |
getName()
Get the name of the item.
|
static ItemQuery<QuotaType> |
getQuery()
Get a query configured to retrieve
QuotaType . |
String |
getSystemId()
Get the system id for the item.
|
Item |
getType()
Get the type of item represented by the object.
|
boolean |
hasSecondaryLocation()
Check if items using quota from this quota type can be stored
in the secondary location or not.
|
(package private) void |
initPermissions(int granted,
int denied)
The logged in user has read permission to the quota
assigned to him/her.
|
boolean |
isSystemItem()
Check if the item is a system item or not.
|
boolean |
isUsed()
Check if this item is used by some other item.
|
void |
setDescription(String description)
Set the description for the item.
|
void |
setName(String name)
Set the name of the item.
|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
public static final Item TYPE
Item.QUOTATYPE
,
getType()
public static final String TOTAL
public static final String FILE
public static final String RAW_DATA
public static final String EXPERIMENT
QuotaType(QuotaTypeData data)
QuotaType
item.data
- The data class for this item.public static QuotaType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
QuotaType
object when you know the id.dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to loadQuotaType
itemItemNotFoundException
- This exception is thrown if an
item with the specified ID is not foundPermissionDeniedException
- This exception is thrown if
the logged in user doesn't have READ
permission to the itemsBaseException
- This exception is thrown if there is another
errorpublic static ItemQuery<QuotaType> getQuery()
QuotaType
. All logged
in users have READ permission to all QuotaType items.ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public String getName()
Nameable
public void setName(String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.setName
in interface Nameable
name
- The new name for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH
constantpublic String getDescription()
Nameable
getDescription
in interface Nameable
String
with a description of the itempublic void setDescription(String description) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_DESCRIPTION_LENGTH
constant.setDescription
in interface Nameable
description
- The new description for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantpublic String getSystemId()
SystemItem
getSystemId
in interface SystemItem
public boolean isSystemItem()
SystemItem
isSystemItem
in interface SystemItem
public Date getEntryDate()
Registered
getEntryDate
in interface Registered
public boolean isUsed()
BasicItem
super.isUsed()
, unless it has decided
that the item is used by some other means.isUsed
in class BasicItem<QuotaTypeData>
BasicItem.getUsingItems()
void initPermissions(int granted, int denied) throws BaseException
initPermissions
in class BasicItem<QuotaTypeData>
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclassBaseException
- This exception is thrown if there is any errorpublic boolean hasSecondaryLocation()
true
if the secondary location can be used, false
otherwise