Last update: 2011-06-23

org.proteios.core
Class SoftwareType

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

public class SoftwareType
extends BasicItem<SoftwareTypeData>
implements Nameable, SystemItem

This class is used to represent the type of Software items in Proteios. Currently, the only type of software we keep information about is feature extraction software. It is not possible for client applications to create new software types or modify existing ones.

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

Field Summary
static String FEATURE_EXTRACTION
          The id for the SoftwareType item representing the softwaretype "feature extraction software".
static String PROTEIN_IDENTIFICATION
           
 
Fields inherited from interface org.proteios.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Method Summary
static SoftwareType getById(DbControl dc, int id)
          Get a SoftwareType object when you know the ID.
 String getDescription()
          Get the description for the item.
 String getName()
          Get the name of the item.
static ItemQuery<SoftwareType> getQuery()
          Get a query configured to retrieve software 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: there are any Software using this type
 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

FEATURE_EXTRACTION

public static final String FEATURE_EXTRACTION
The id for the SoftwareType item representing the softwaretype "feature extraction software".

See Also:
Constant Field Values

PROTEIN_IDENTIFICATION

public static final String PROTEIN_IDENTIFICATION
See Also:
Constant Field Values
Method Detail

getById

public static SoftwareType getById(DbControl dc,
                                   int id)
                            throws ItemNotFoundException,
                                   PermissionDeniedException,
                                   BaseException
Get a SoftwareType object when you know the ID.

Parameters:
dc - The DbControl which will be used for permission checking and database access.
id - The ID of the item to load
Returns:
The SoftwareType item
Throws:
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 items
BaseException - This exception is thrown if there is another error

getQuery

public static ItemQuery<SoftwareType> getQuery()
                                        throws BaseException
Get a query configured to retrieve software types.

Returns:
An ItemQuery object
Throws:
BaseException

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

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

isUsed

public boolean isUsed()
               throws BaseException
Check if:

Specified by:
isUsed in class BasicItem<SoftwareTypeData>
Returns:
TRUE if this item is used, FALSE otherwise
Throws:
BaseException

Last update: 2011-06-23