|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BasicItem<HardwareTypeData> net.sf.basedb.core.HardwareType
public class HardwareType
This class is used to represent the type of
Hardware
items in BASE. It is
not possible for client applications to create
new hardware types or modify existing ones.
Hardware
Field Summary | |
---|---|
static String |
FREEZER
The id for the HardwareType object representing a
freezer. |
static String |
HYBRIDIZATION_STATION
The id for the HardwareType object representing a
hybridization station. |
static String |
OTHER
The id for the HardwareType object representing something
else. |
static String |
PRINT_ROBOT
The id for the HardwareType object representing a
print robot. |
static String |
SCANNER
The id for the HardwareType object representing a
scanner. |
static Item |
TYPE
The type of item represented by this class. |
Fields inherited from interface net.sf.basedb.core.Nameable |
---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
Fields inherited from interface net.sf.basedb.core.SystemItem |
---|
MAX_SYSTEM_ID_LENGTH |
Constructor Summary | |
---|---|
HardwareType(HardwareTypeData data)
Creates a hardwaretype item. |
Method Summary | |
---|---|
static HardwareType |
getById(DbControl dc,
int id)
Get a HardwareType 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. |
ItemQuery<Hardware> |
getHardware()
Get a query that returns all hardware of this type |
String |
getName()
Get the name of the item. |
static HardwareType |
getNew(DbControl dc)
Create a new HardwareType item. |
static ItemQuery<HardwareType> |
getQuery()
Get a query configured to retrieve hardware types. |
String |
getSystemId()
Get the system id for the item. |
Item |
getType()
Get the type of item represented by the object. |
Set<ItemProxy> |
getUsingItems()
Get all: Hardware :s if this type
|
(package private) void |
initPermissions(int granted,
int denied)
If this is a system hardware type, delete and create permissions are revoked. |
boolean |
isRemoved()
Check if the removed flag is set for this item. |
boolean |
isSystemItem()
Check if the item is a system item or not. |
boolean |
isUsed()
Check if: A Hardware of this type exists |
Hardware |
newHardware()
Create a new Hardware item of this type. |
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.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.basedb.core.Identifiable |
---|
getId, getVersion |
Methods inherited from interface net.sf.basedb.core.AccessControlled |
---|
checkPermission, getPermissions, hasPermission |
Field Detail |
---|
public static final Item TYPE
ITEM.FILETYPE
,
getType()
public static final String SCANNER
HardwareType
object representing a
scanner.
public static final String PRINT_ROBOT
HardwareType
object representing a
print robot.
public static final String HYBRIDIZATION_STATION
HardwareType
object representing a
hybridization station.
public static final String FREEZER
HardwareType
object representing a
freezer.
public static final String OTHER
HardwareType
object representing something
else.
Constructor Detail |
---|
HardwareType(HardwareTypeData data)
data
- the dataMethod Detail |
---|
public static HardwareType getNew(DbControl dc) throws BaseException
HardwareType
item.
dc
- The DbControl
which will be used for
permission checking and database access
HardwareType
item
BaseException
- If there is an errorpublic static HardwareType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
HardwareType
object when you know the ID.
dc
- The DbControl
which will be used for
permission checking and database access.id
- The system ID of the item to load.
HardwareType
item
ItemNotFoundException
- This exception is thrown if an
item with the specified ID is not found
PermissionDeniedException
- This exception is thrown if
the logged in user doesn't have READ
permission to the item
BaseException
- This exception is thrown if there is another
errorpublic static ItemQuery<HardwareType> getQuery()
ItemQuery
objectpublic Date getEntryDate()
Registered
getEntryDate
in interface Registered
public boolean isUsed() throws BaseException
isUsed
in class BasicItem<HardwareTypeData>
BaseException
- If there is an error.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
Hardware
:s if this type
getUsingItems
in class BasicItem<HardwareTypeData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
void initPermissions(int granted, int denied) throws BaseException
initPermissions
in class BasicItem<HardwareTypeData>
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclass
BaseException
- If the permissions couldn't be initialisedpublic Item getType()
Identifiable
Item
enumeration.
getType
in interface Identifiable
public boolean isRemoved()
Removable
isRemoved
in interface Removable
public void setRemoved(boolean removed) throws PermissionDeniedException
Removable
setRemoved
in interface Removable
removed
- TRUE if the item should be flagged as removed,
FALSE otherwise
PermissionDeniedException
- If the logged in user doesn't
have Permission.DELETE
permission for setting the flag
to TRUE or Permission.WRITE
permission for setting the
flag to FALSEpublic String getSystemId()
SystemItem
getSystemId
in interface SystemItem
public boolean isSystemItem()
SystemItem
isSystemItem
in interface SystemItem
public String getName()
Nameable
getName
in interface Nameable
String
with the name of the itempublic void setName(String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.
setName
in interface Nameable
name
- The new name for the item
PermissionDeniedException
- If the logged in user doesn't
have write permission
InvalidDataException
- 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 item
PermissionDeniedException
- If the logged in user doesn't
have write permission
InvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantpublic Hardware newHardware() throws PermissionDeniedException, BaseException
Hardware
item of this type.
Hardware
item
DetachedItemException
- If this HardwareType is detached from DbControl.
PermissionDeniedException
- This exception is thrown if
the logged in user doesn't have CREATE
permission for hardware items or USE
permission for this hardware type
BaseException
- This exception is thrown if there is another
errorpublic ItemQuery<Hardware> getHardware()
ItemQuery
object
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |