|
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.AbstractBatcher net.sf.basedb.core.BasicBatcher<FeatureData> net.sf.basedb.core.FeatureBatcher
public class FeatureBatcher
Batcher class for Features or AffyFeatures. A single instance can be used
for features belonging to a single ArrayDesign
.
Create new FeatureData
objects with either
newFeature(ArrayDesignBlock, ReporterData)
or
newFeature(ArrayDesignBlock, Well)
. Use the latter method if the array
desing is connected to plates.
Depending on the FeatureIdentificationMethod
used by the array design,
you must set different properties on the FeatureData
object.
FeatureData.setRow(int)
and FeatureData.setColumn(int)
FeatureData.setPosition(int)
FeatureData.setExternalId(String)
Field Summary | |
---|---|
private ArrayDesign |
arrayDesign
The array design this batcher adds features to. |
private ArrayDesignData |
arrayDesignData
Just a copy of the data object for the array design. |
private int |
currentPosition
Keeps track of the position number. |
private Set<Object> |
featureIds
Holds identification of already inserted features. |
private FeatureIdentificationMethod |
fiMethod
|
Fields inherited from class net.sf.basedb.core.BasicBatcher |
---|
debugEnabled, logParam |
Fields inherited from class net.sf.basedb.core.AbstractBatcher |
---|
debugSqlEnabled, logSql |
Constructor Summary | |
---|---|
FeatureBatcher(DbControl dc,
ArrayDesign arrayDesign)
|
Method Summary | |
---|---|
void |
delete(int id)
Always throws a PermissionDeniedException , since a feature cannot
be modifed once it has been created. |
(package private) void |
deleteAll()
Delete all features belonging to this array design. |
ArrayDesign |
getArrayDesign()
Get the array design this batcher is used for. |
(package private) static FeatureBatcher |
getNew(DbControl dc,
ArrayDesign arrayDesign)
Create a new batcher for regular features. |
(package private) PluginPermission |
getPluginPermissions()
|
Item |
getType()
Get the type of item supported by the batcher. |
(package private) void |
initPermissions(int granted,
int denied)
Grant read permission if the logged in user has read permission to the array design. |
void |
insert(FeatureData data)
Set the position number and add the feature to the insert queue. |
FeatureData |
newFeature(ArrayDesignBlock adb,
ReporterData reporter)
Create a new feature. |
FeatureData |
newFeature(ArrayDesignBlock adb,
Well well)
Create a new feature. |
(package private) void |
onBeforeClose()
Set the hasFeature flag on the array design if features has been added. |
void |
update(FeatureData data)
Always throws a PermissionDeniedException , since a feature cannot
be modifed once it has been created. |
void |
validate(FeatureData data)
Validate all properties for the feature object: The data object is not null An array design block has been specfied The postion number is > 0 The external id is not null or too long The feature identification is unique The data object belongs to the correct array design The reporter match the well's reporter if a well has been specified |
Methods inherited from class net.sf.basedb.core.BasicBatcher |
---|
checkPermission, delete, flush, flushDelete, flushInsert, flushUpdate, getPermissions, getPropertyValue, getTotalInsertCount, hasPermission, onBeforeCommit, setPropertyValue |
Methods inherited from class net.sf.basedb.core.AbstractBatcher |
---|
analyzeTable, close, getBatchSize, getDbControl, getSessionControl, isClosed, setBatchSize, setDbControl, updateLastAccess |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final ArrayDesign arrayDesign
private final ArrayDesignData arrayDesignData
private final FeatureIdentificationMethod fiMethod
private Set<Object> featureIds
private int currentPosition
Constructor Detail |
---|
FeatureBatcher(DbControl dc, ArrayDesign arrayDesign) throws BaseException
BaseException
Method Detail |
---|
static FeatureBatcher getNew(DbControl dc, ArrayDesign arrayDesign) throws DatabaseException, BaseException
dc
- The DbControl to use for database access and
permission checkingarrayDesign
- The array design this batcher should
add features to
BaseException
- If there is an error
DatabaseException
ArrayDesign.getFeatureBatcher(FeatureIdentificationMethod, Job)
public Item getType()
BasicBatcher
Item
enumeration.
getType
in class BasicBatcher<FeatureData>
Item
public void validate(FeatureData data) throws InvalidDataException
validate
in class BasicBatcher<FeatureData>
data
- Data object to validate
InvalidDataException
- If the data object is invalidpublic void insert(FeatureData data) throws BaseException
insert
in class BasicBatcher<FeatureData>
data
- Data object to be inserted
InvalidDataException
- If the data is null or it doesn't validate
against the BasicBatcher.validate(BatchableData)
method
PermissionDeniedException
- If the logged in user doesn't
have create permission
BaseException
- If there is another errorpublic void update(FeatureData data) throws BaseException
PermissionDeniedException
, since a feature cannot
be modifed once it has been created.
update
in class BasicBatcher<FeatureData>
data
- Data object to be updated
InvalidDataException
- If the data is null or it doesn't validate
against the BasicBatcher.validate(BatchableData)
method
PermissionDeniedException
- If the logged in user doesn't
have write permission
BaseException
- If there is another errorpublic void delete(int id) throws BaseException
PermissionDeniedException
, since a feature cannot
be modifed once it has been created.
delete
in class BasicBatcher<FeatureData>
id
- Id of the object to be deleted
PermissionDeniedException
- If the logged in user doesn't
have delete permission
BaseException
- If there is another errordeleteAll()
void initPermissions(int granted, int denied) throws BaseException
initPermissions
in class BasicBatcher<FeatureData>
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclass
BaseException
- If the permissions couldn't be initialisedPluginPermission getPluginPermissions()
getPluginPermissions
in class BasicBatcher<FeatureData>
void onBeforeClose() throws BaseException
onBeforeClose
in class BasicBatcher<FeatureData>
BaseException
public ArrayDesign getArrayDesign()
ArrayDesign
public FeatureData newFeature(ArrayDesignBlock adb, Well well) throws BaseException
adb
- The array design of the feature.well
- The well of the feature. Null is not allowed. The plate of the well must
have a position on the ArrayDesign of the current FeatureBatcher.
BaseException
- If there is an errorpublic FeatureData newFeature(ArrayDesignBlock adb, ReporterData reporter) throws BaseException
adb
- reporter
-
BaseException
- If there is an errorvoid deleteAll() throws BaseException
BaseException
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |