Last update: 2011-06-23

org.proteios.core
Class HardwareType

java.lang.Object
  extended by org.proteios.core.BasicItem<HardwareTypeData>
      extended by org.proteios.core.HardwareType
All Implemented Interfaces:
AccessControlled, Identifiable, Nameable, SystemItem

public class HardwareType
extends BasicItem<HardwareTypeData>
implements Nameable, SystemItem

This class is used to represent the type of Hardware items in Proteios. It is not possible for client applications to create new hardware types or modify existing ones.

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

Field Summary
static String MASS_SPECTROMETER
          The id for the HardwareType object representing a robot.
static String ROBOT
          The id for the HardwareType object representing a 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 org.proteios.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Method Summary
 String getDescription()
          Get the description for the item.
 String getName()
          Get the name of the 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.
 boolean isSystemItem()
          Check if the item is a system item or not.
 boolean isUsed()
          Check if: A Hardware of this type exists
 void setDescription(String description)
          Set the description for the item.
 void setName(String name)
          Set the name of the item.
 
Methods inherited from class org.proteios.core.BasicItem
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, 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, getVersion
 
Methods inherited from interface org.proteios.core.AccessControlled
checkPermission, hasPermission
 

Field Detail

TYPE

public static final Item TYPE
The type of item represented by this class.

See Also:
ITEM.FILETYPE, getType()

SCANNER

public static final String SCANNER
The id for the HardwareType object representing a scanner.

See Also:
Constant Field Values

ROBOT

public static final String ROBOT
The id for the HardwareType object representing a robot.

See Also:
Constant Field Values

MASS_SPECTROMETER

public static final String MASS_SPECTROMETER
The id for the HardwareType object representing a robot.

See Also:
Constant Field Values
Method Detail

getQuery

public static ItemQuery<HardwareType> getQuery()
Get a query configured to retrieve hardware types.

Returns:
An ItemQuery object

isUsed

public boolean isUsed()
               throws BaseException
Check if:

Specified by:
isUsed in class BasicItem<HardwareTypeData>
Returns:
TRUE if the hardwaretype is used.
Throws:
BaseException - If there is an error.

getType

public Item getType()
Description copied from interface: Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in the Item enumeration.

Specified by:
getType in interface Identifiable
Returns:
A value indicating the type of item

getSystemId

public String getSystemId()
Description copied from interface: SystemItem
Get the system id for the item.

Specified by:
getSystemId in interface SystemItem
Returns:
The id of the item or null if it is not a system item

isSystemItem

public boolean isSystemItem()
Description copied from interface: SystemItem
Check if the item is a system item or not. A system item have a non-null value for the system id.

Specified by:
isSystemItem in interface SystemItem
Returns:
TRUE if this item is a system item, FALSE otherwise

getName

public String getName()
Description copied from interface: Nameable
Get the name of the item.

Specified by:
getName in interface Nameable
Returns:
A String with 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 the Nameable.MAX_NAME_LENGTH constant.

Specified by:
setName in interface Nameable
Parameters:
name - The new name for the item
Throws:
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 constant

getDescription

public String getDescription()
Description copied from interface: Nameable
Get the description for the item.

Specified by:
getDescription in interface Nameable
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 the Nameable.MAX_DESCRIPTION_LENGTH constant.

Specified by:
setDescription in interface Nameable
Parameters:
description - The new description for the item
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission
InvalidDataException - If the description longer than specified by the Nameable.MAX_DESCRIPTION_LENGTH constant

Last update: 2011-06-23