public class FeatureBatcher extends BasicBatcher<FeatureData>
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)
Modifier and Type | Field and Description |
---|---|
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 |
debugEnabled, logParam
debugSqlEnabled, logSql
Constructor and Description |
---|
FeatureBatcher(DbControl dc,
ArrayDesign arrayDesign) |
Modifier and Type | Method and Description |
---|---|
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
|
checkPermission, delete, flush, flushDelete, flushInsert, flushUpdate, getPermissions, getPropertyValue, getTotalInsertCount, hasPermission, onBeforeCommit, setPropertyValue
analyzeTable, close, getBatchSize, getDbControl, getSessionControl, isClosed, setBatchSize, setDbControl, updateLastAccess
private final ArrayDesign arrayDesign
private final ArrayDesignData arrayDesignData
private final FeatureIdentificationMethod fiMethod
private int currentPosition
FeatureBatcher(DbControl dc, ArrayDesign arrayDesign) throws BaseException
BaseException
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 toBaseException
- If there is an errorDatabaseException
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 validateInvalidDataException
- If the data object is invalidpublic void insert(FeatureData data) throws BaseException
insert
in class BasicBatcher<FeatureData>
data
- Data object to be insertedInvalidDataException
- If the data is null or it doesn't validate
against the BasicBatcher.validate(BatchableData)
methodPermissionDeniedException
- If the logged in user doesn't
have create permissionBaseException
- 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 updatedInvalidDataException
- If the data is null or it doesn't validate
against the BasicBatcher.validate(BatchableData)
methodPermissionDeniedException
- If the logged in user doesn't
have write permissionBaseException
- 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 deletedPermissionDeniedException
- If the logged in user doesn't
have delete permissionBaseException
- 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 subclassBaseException
- 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