|
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<DataFileTypeData> net.sf.basedb.core.DataFileType
public class DataFileType
This class is used to represent types of files that are used to hold data instead of importing the data into into the database.
This class can define a DataFileValidator
and a
DataFileMetadataReader
that can be used to validate the if a
file is actually of the correct type and, if it is, extract metadata from it.
Field Summary | |
---|---|
static String |
AFFYMETRIX_CDF
The external ID for the file type representing Affymetrix CDF files. |
static String |
AFFYMETRIX_CEL
The external ID for the file type representing Affymetrix CEL files. |
static String |
BASEFILE_MATRIX
The external ID for the file type representing a matrix BASEFile. |
static String |
BASEFILE_SERIAL
The external ID for the file type representing a serial BASEFile. |
static String |
BFS_METADATA
The external ID for the file type representing a BFS metadata file. |
static String |
GENERIC_EXTRAVALUE_DATA
The external ID for the file type representing generic analysed extra value data. |
static String |
GENERIC_PRINT_MAP
The external ID for the file type representing a generic print map (array design layout) of any type. |
static String |
GENERIC_RAW_DATA
The external ID for the file type representing a generic raw data file of any type. |
static String |
GENERIC_REPORTER_MAP
The external ID for the file type representing a generic reporter map (array design layout) of any type. |
static String |
GENERIC_SPOT_DATA
The external ID for the file type representing generic analysed spot data. |
static int |
MAX_CLASSNAME_LENGTH
The maximum length of the class names that can be stored in the database. |
static int |
MAX_EXTENSION_LENGTH
The maximum length of the file extension that can be stored in the database. |
static int |
MAX_EXTERNAL_ID_LENGTH
The maximum length of the external ID that can be stored in the database. |
static int |
MAX_JARPATH_LENGTH
The maximum length of the jar paths that can be stored in the database. |
static String |
MEV_TDMS
The external ID for the file type representing a MeV TDMS (Tab-Delimited Multiple Sample) file. |
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 |
Constructor Summary | |
---|---|
DataFileType(DataFileTypeData data)
Creates a new filetype item from the given data. |
Method Summary | |
---|---|
static DataFileType |
getByExternalId(DbControl dc,
String externalId)
Get a DataFileType item when you know the external ID. |
static DataFileType |
getById(DbControl dc,
int id)
Get a DataFileType object when you know the ID. |
String |
getDescription()
Get the description for the item. |
String |
getExtension()
Get the common file extension for data files of this type. |
String |
getExternalId()
Get the external id for the data file type. |
FileType |
getGenericType()
Get the generic file type for this data file type. |
Item |
getItemType()
Get the type of item files of this type can be used on. |
DataFileMetadataReader |
getMetadataReader()
Create a new instance of the DataFileMetadataReader class specified
by getMetadataReaderClass() . |
String |
getMetadataReaderClass()
Get the class name of the Java class that is used to extract metadata from files of this type. |
String |
getMetadataReaderJarPath()
Get the path to the JAR file where the meta data reader class is located. |
String |
getName()
Get the name of the item. |
static DataFileType |
getNew(DbControl dc,
String externalId,
Item itemType)
Create a new data file type. |
ItemQuery<PlatformFileType> |
getPlatforms()
Get a query that returns all platforms/variants that are using this file type. |
static ItemQuery<DataFileType> |
getQuery()
Get a query configured to retrieve DataFileType items. |
static ItemQuery<DataFileType> |
getQuery(FileStoreEnabled item)
Get a query configured to retrieve DataFileType :s
that can be used on a given item. |
static ItemQuery<DataFileType> |
getQuery(Platform platform,
PlatformVariant variant,
Item itemType,
FileType genericType)
Get a query to retrieve DataFileType :s that can be used
on specific platform/variant for a given item and/or generic file type. |
Item |
getType()
Get the type of item represented by the object. |
Set<ItemProxy> |
getUsingItems()
Get all: FileSetMember :s using this file type
PlatformFileType :s using this file type
|
DataFileValidator |
getValidator()
Create a new instance of the DataFileValidator class specified
by getValidatorClass() . |
String |
getValidatorClass()
Get the class name of the Java class that is used to validate the files of this type. |
String |
getValidatorJarPath()
Get the path to the JAR file where the validator class is located. |
boolean |
isRemoved()
Check if the removed flag is set for this item. |
boolean |
isUsed()
Check if: A file has been tagged with this type in a file set A platform is using this file type |
void |
setDescription(String description)
Set the description for the item. |
void |
setExtension(String extension)
Set the most common gile extension for data file of this type. |
private void |
setExternalId(String externalId)
|
void |
setGenericType(FileType genericType)
Set the generic file type of this item. |
private void |
setItemType(Item itemType)
|
void |
setMetadataReaderClass(String metadataReaderClass)
Set the class name of the Java class that is used to extract metadata from files of this type. |
void |
setMetadataReaderJarPath(String metadataReaderJarPath)
Set the path to the JAR file where the meta data reader class is located. |
void |
setName(String name)
Set the name of the item. |
void |
setRemoved(boolean removed)
Set the removed flag for this item. |
void |
setValidatorClass(String validatorClass)
Set the class name of the Java class that is used to validate the files of this type. |
void |
setValidatorJarPath(String validatorJarPath)
Set the path to the JAR file where the validator class is located. |
DataFileTypeInfo |
toTransferable(DataFileTypeInfo info)
Transfer the internal state to a transferable object. |
(package private) void |
validate()
Check that the validator and meta data reader classes implement the correct interfaces. |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, initPermissions, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable |
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.DATAFILETYPE
,
getType()
public static final String AFFYMETRIX_CDF
public static final String AFFYMETRIX_CEL
public static final String GENERIC_RAW_DATA
public static final String GENERIC_REPORTER_MAP
public static final String GENERIC_PRINT_MAP
public static final String GENERIC_SPOT_DATA
public static final String GENERIC_EXTRAVALUE_DATA
public static final String BASEFILE_SERIAL
public static final String BASEFILE_MATRIX
public static final String BFS_METADATA
public static final String MEV_TDMS
public static final int MAX_EXTENSION_LENGTH
setExtension(String)
,
Constant Field Valuespublic static final int MAX_CLASSNAME_LENGTH
setValidatorClass(String)
,
setMetadataReaderClass(String)
,
Constant Field Valuespublic static final int MAX_JARPATH_LENGTH
setValidatorJarPath(String)
,
setMetadataReaderJarPath(String)
,
Constant Field Valuespublic static final int MAX_EXTERNAL_ID_LENGTH
setExternalId(String)
,
Constant Field ValuesConstructor Detail |
---|
DataFileType(DataFileTypeData data)
data
- the data.Method Detail |
---|
public static DataFileType getNew(DbControl dc, String externalId, Item itemType)
dc
- The DbControl to use for database accessexternalId
- The external ID of the new type, must be
unique for all file typesitemType
- The type of item that files of this type can
be attached to. The item must implement the FileStoreEnabled
interface
public static DataFileType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
DataFileType
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 load
DataFileType
item
ItemNotFoundException
- If an item with the specified ID is not found
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission to the items
BaseException
- If there is another errorpublic static DataFileType getByExternalId(DbControl dc, String externalId) throws ItemNotFoundException, PermissionDeniedException, BaseException
DataFileType
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 load
DataFileType
item.
ItemNotFoundException
- If an item with the specified ID is not found
PermissionDeniedException
- If the logged in user doesn't have
read permission for the item
BaseException
- If there is another errorpublic static ItemQuery<DataFileType> getQuery() throws BaseException
DataFileType
items.
ItemQuery
object
BaseException
- If getting the query fails.public static ItemQuery<DataFileType> getQuery(FileStoreEnabled item)
DataFileType
:s
that can be used on a given item. This method will check the
FileStoreEnabled.getPlatform()
and FileStoreEnabled.getVariant()
values and restrict the query to only return items that can be used for
that platform. If the item isn't attached to any platform or variant
all data file types for the Identifiable.getType()
are returned.
item
- The item to get data file types for, or null
to return all data file types
ItemQuery
objectpublic static ItemQuery<DataFileType> getQuery(Platform platform, PlatformVariant variant, Item itemType, FileType genericType)
DataFileType
:s that can be used
on specific platform/variant for a given item and/or generic file type.
All parameters are optional. If all are null the result is the same
as getQuery()
.
platform
- The platform, or null to not restrict by platform (unless
a variant is given)variant
- The platform variant, or null to not restrict by variantitemType
- The type of item it should be possible to
attach file to, or null to not restrict by itemgenericType
- The generic file type, or null to not restrict
by file type
public Item getType()
Identifiable
Item
enumeration.
getType
in interface Identifiable
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 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 boolean isUsed() throws BaseException
isUsed
in class BasicItem<DataFileTypeData>
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
FileSetMember
:s using this file type
PlatformFileType
:s using this file type
getUsingItems
in class BasicItem<DataFileTypeData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
void validate() throws InvalidDataException, BaseException
validate
in class BasicItem<DataFileTypeData>
BaseException
- If there is an error
InvalidDataException
Validatable
,
Core API overview - Data validation,
Coding rules and guidelines for item classespublic DataFileTypeInfo toTransferable(DataFileTypeInfo info)
ToTransferable
toTransferable
in interface ToTransferable<DataFileTypeInfo>
info
- The transferable object to use
public String getExternalId()
private void setExternalId(String externalId) throws PermissionDeniedException, InvalidDataException, BaseException
PermissionDeniedException
InvalidDataException
BaseException
public FileType getGenericType()
FileType
itempublic void setGenericType(FileType genericType)
genericType
- The generic type
PermissionDeniedException
- If the logged in user doesn't
have write permissionpublic String getExtension()
public void setExtension(String extension)
extension
- The extension or null
PermissionDeniedException
- If the logged in user doesn't
have write permission
StringTooLongException
- If the string is longer that MAX_EXTENSION_LENGTH
.private void setItemType(Item itemType)
public Item getItemType()
FileStoreEnabled
interface.
Item
objectpublic String getValidatorClass()
DataFileValidator
interface.
public void setValidatorClass(String validatorClass)
DataFileValidator
interface.
validatorClass
- The name of the class or null to disable validation
PermissionDeniedException
- If the logged in user doesn't
have write permission
StringTooLongException
- If the string is longer that MAX_CLASSNAME_LENGTH
.public String getValidatorJarPath()
public void setValidatorJarPath(String validatorJarPath)
validatorJarPath
- The path to the JAR file or null if the validator is in the class path
PermissionDeniedException
- If the logged in user doesn't
have write permission
StringTooLongException
- If the string is longer that MAX_JARPATH_LENGTH
.public DataFileValidator getValidator()
DataFileValidator
class specified
by getValidatorClass()
.
BaseException
- If an instance of the class can't be createdpublic String getMetadataReaderClass()
DataFileMetadataReader
interface.
public void setMetadataReaderClass(String metadataReaderClass)
DataFileMetadataReader
interface.
metadataReaderClass
- The name of the class or null to disable validation
PermissionDeniedException
- If the logged in user doesn't
have write permission
StringTooLongException
- If the string is longer that MAX_CLASSNAME_LENGTH
.public String getMetadataReaderJarPath()
public void setMetadataReaderJarPath(String metadataReaderJarPath)
metadataReaderJarPath
- The path to the JAR file or null if the reader is in the class path
PermissionDeniedException
- If the logged in user doesn't
have write permission
StringTooLongException
- If the string is longer that MAX_JARPATH_LENGTH
.public DataFileMetadataReader getMetadataReader()
DataFileMetadataReader
class specified
by getMetadataReaderClass()
.
BaseException
- If an instance of the class can't be createdpublic ItemQuery<PlatformFileType> getPlatforms()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |