public class PlatformVariant extends BasicChildItem implements Nameable, Removable
Platform
.Modifier and Type | Field and Description |
---|---|
static int |
MAX_EXTERNAL_ID_LENGTH
The maximum length of the external ID that can be stored in the database.
|
private static QueryRuntimeFilter |
RUNTIME_FILTER
This filter will only return items if the logged in user has
generic read permission to platforms.
|
static String |
SEQUENCING_EXPRESSION
The external id for the expression-like sequencing data.
|
static Item |
TYPE
The type of item represented by this class.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
PlatformVariant(PlatformVariantData data)
Creates a new filetype item from the given data.
|
Modifier and Type | Method and Description |
---|---|
static PlatformVariant |
getByExternalId(DbControl dc,
String externalId)
Get a
PlatformVariant item when you know the external ID. |
static PlatformVariant |
getById(DbControl dc,
int id)
Get a
PlatformVariant object when you know the ID. |
(package private) PlatformVariantData |
getData()
Get the
BasicData object that holds all data for this item. |
String |
getDescription()
Get the description for the item.
|
String |
getExternalId()
Get the external id for the platform variant.
|
ItemQuery<PlatformFileType> |
getFileTypes(boolean restrict)
Get a query returning file types registered with this platform
variant.
|
String |
getName()
Get the name of the item.
|
static PlatformVariant |
getNew(DbControl dc,
Platform platform,
String externalId)
Create a new variant of a platform.
|
static PlatformVariant |
getNew(DbControl dc,
Platform platform,
String externalId,
int channels)
Create a new file-only variant of a platform.
|
static PlatformVariant |
getNew(DbControl dc,
Platform platform,
String externalId,
RawDataType rawDataType)
Create a new platform variant which may optionally import data
into the database.
|
(package private) Item |
getParentType()
Get the type of item that is the parent of this item.
|
Platform |
getPlatform()
Get that platform this is a variant of.
|
static ItemQuery<PlatformVariant> |
getQuery()
Get a query configured to retrieve
PlatformVariant items. |
RawDataType |
getRawDataType()
Get the raw data type this platform variant is locked to.
|
Item |
getType()
Get the type of item represented by the object.
|
Set<ItemProxy> |
getUsingItems()
Get all:
ArrayDesign :s and RawBioAssay :s using
this platform variant
|
boolean |
isFileOnly()
Check if the platform variant is a file-only variant or if it allows data
to be imported into the database.
|
boolean |
isRemoved()
Check if the removed flag is set for this item.
|
boolean |
isUsed()
Check if:
any raw bioassays or array design are using this platform variant
|
(package private) void |
onAfterCommit(Transactional.Action action)
Register file-only platforms as raw data type after insert and unregister
after delete.
|
private void |
setChannels(int channels)
Set the number of channels for a file-only platform variant.
|
void |
setDescription(String description)
Set the description for the item.
|
private void |
setExternalId(String externalId) |
void |
setName(String name)
Set the name of the item.
|
private void |
setPlatform(Platform platform) |
private void |
setRawDataType(RawDataType rawDataType)
Set the raw data type.
|
void |
setRemoved(boolean removed)
Set the removed flag for this item.
|
getPermissionForWriteDeleteAndCreate, getPluginPermissions, initPermissions
addUsingItems, addUsingItems, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
public static final String SEQUENCING_EXPRESSION
public static final Item TYPE
Item.PLATFORM
,
getType()
private static final QueryRuntimeFilter RUNTIME_FILTER
public static final int MAX_EXTERNAL_ID_LENGTH
setExternalId(String)
,
Constant Field ValuesPlatformVariant(PlatformVariantData data)
data
- the data.public static PlatformVariant getNew(DbControl dc, Platform platform, String externalId)
dc
- The DbControl to use for database accessplatform
- The platform to create a variant forexternalId
- The external ID of the variant, it must be
unique for all variantspublic static PlatformVariant getNew(DbControl dc, Platform platform, String externalId, int channels)
dc
- The DbControl to use for database accessplatform
- The platform to create a variant forexternalId
- The external ID of the variant, it must be
unique for all variantschannels
- Number of channels in this variantpublic static PlatformVariant getNew(DbControl dc, Platform platform, String externalId, RawDataType rawDataType)
dc
- The DbControl to use for database accessplatform
- The platform to create a variant forexternalId
- The external ID of the platform variant, must be
unique for all variants (including those for other platforms)rawDataType
- A specific raw data type this platform will be locked
to or null if it is not locked to any specific raw data typepublic static PlatformVariant getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
PlatformVariant
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 loadPlatformVariant
itemItemNotFoundException
- If an item with the specified ID is not foundPermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission to the itemsBaseException
- If there is another errorpublic static PlatformVariant getByExternalId(DbControl dc, String externalId) throws ItemNotFoundException, PermissionDeniedException, BaseException
PlatformVariant
item when you know the external ID.dc
- The DbControl
which will be used for
permission checking and database access.externalId
- The external ID of the item to loadPlatformVariant
item.ItemNotFoundException
- If an item with the specified ID is not foundPermissionDeniedException
- If the logged in user doesn't have
read permission for the itemBaseException
- If there is another errorpublic static ItemQuery<PlatformVariant> getQuery() throws BaseException
PlatformVariant
items.ItemQuery
objectBaseException
- If the query could not be created.PlatformVariantData getData()
BasicItem
BasicData
object that holds all data for this item.public 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 boolean isRemoved()
Removable
public void setRemoved(boolean removed) throws PermissionDeniedException
Removable
setRemoved
in interface Removable
removed
- TRUE if the item should be flagged as removed,
FALSE otherwisePermissionDeniedException
- 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 boolean isUsed() throws BaseException
isUsed
in class BasicItem
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
ArrayDesign
:s and RawBioAssay
:s using
this platform variant
getUsingItems
in class BasicItem
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
void onAfterCommit(Transactional.Action action)
onAfterCommit
in class BasicItem
Transactional
,
Developer documentation: Transactions,
Developer documentation: Coding rules and guidelines for item classesItem getParentType()
BasicChildItem
getParentType
in class BasicChildItem
public Platform getPlatform()
Platform
itemPermissionDeniedException
- If the logged in user doesn't
have read permission to the itemprivate void setPlatform(Platform platform)
public String getExternalId()
private void setExternalId(String externalId) throws PermissionDeniedException, InvalidDataException, BaseException
public boolean isFileOnly()
private void setChannels(int channels)
private void setRawDataType(RawDataType rawDataType)
rawDataType
- The raw data type, null is allowedpublic RawDataType getRawDataType()
RawDataType
is returned for each call to this
method.public ItemQuery<PlatformFileType> getFileTypes(boolean restrict)
restrict
- If TRUE the query will only return file types that
has been directly registered with this variant, if FALSE the
query will also return file types that have been registered
with the platformPlatformFileType.getQuery(Platform, PlatformVariant, boolean)