|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.proteios.core.ItemFactory
public class ItemFactory
Used to create persistent item instances
| Constructor Summary | |
|---|---|
ItemFactory()
Remember to set the DbControl before using the factory |
|
ItemFactory(DbControl dc)
|
|
| Method Summary | ||
|---|---|---|
|
create(Class<D> template,
Object... extraParameters)
Creates an instance of the given template class. |
|
AnnotationType |
createAnnotationType(Type valueType)
Create a new AnnotationType item. |
|
CreationEvent |
createCreationEvent(MeasuredBioMaterial<?> bioMaterial,
MeasuredBioMaterial<?> sourceMaterial,
Float usedQuantity)
Create a new BioMaterialEvent of the Type#OTHER
type. |
|
GelImageAnalysisEvent |
createGelImageAnalysisEvent(MeasuredBioMaterial<?> bioMaterial)
Create a new GelImageAnalysisEvent of the Type#OTHER type. |
|
GelScanEvent |
createGelScanEvent(MeasuredBioMaterial<?> bioMaterial)
Create a new GelScanEvent of the Type#OTHER type. |
|
GlobalDefaultSetting |
createGlobalDefaultSetting(String name,
String value)
Create a new GlobalDefaultSetting item. |
|
Directory |
createHomeDirectory(User user)
Creates and saves a home directory for the supplied user |
|
Job |
createJob(PluginDefinition plugin,
PluginConfiguration config)
TODO this method does two things, create and configures a job to a starting state. |
|
LabeledExtract |
createLabeledExtract(Label label)
Create a new LabeledExtract with label. |
|
Message |
createMessage(User to,
String fromName,
User fromUser,
Job job)
Create a new Message item. |
|
SeparationEvent |
createSeparationEvent(MeasuredBioMaterial<?> bioMaterial,
Float usedQuantity)
Create a new SeparationEvent of the Type#OTHER type. |
|
SeparationMethod<?> |
createSeparationMethod(String externalId)
Create a new SeparationMethod item. |
|
StainingEvent |
createStainingEvent(MeasuredBioMaterial<?> bioMaterial)
Create a new StainingEvent of the Type#OTHER type. |
|
UpdateEvent |
createUpdateEvent(MeasuredBioMaterial<?> bioMaterial)
Create a new UpdateEvent of the Type#OTHER type. |
|
User |
createUser(String login,
String password)
Create a new User item. |
|
|
getById(Class<T> name,
Integer id)
|
|
Directory |
getByPath(Path path)
Get a Directory item when you know the path. |
|
File |
getByPath(Path path,
boolean create)
Get a File item when you know the path. |
|
|
getBySystemId(Class<T> name,
String id)
|
|
DbControl |
getDc()
|
|
void |
setDc(DbControl dc)
We allow outside change of DbControl in use to enable factory reuse |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ItemFactory()
public ItemFactory(DbControl dc)
dc - initial DbControl to use| Method Detail |
|---|
public DbControl getDc()
public void setDc(DbControl dc)
dc -
public <D extends BasicItem<?>> D create(Class<D> template,
Object... extraParameters)
D - template - item class to createextraParameters - optional Object[] array of extra arguments
public Job createJob(PluginDefinition plugin,
PluginConfiguration config)
throws BaseException
Job item.
config - The plugin configuration this job should use or null if the
job is executed by an external program
Job item
BaseException - If there is an error
public User createUser(String login,
String password)
throws BaseException
User item.
login - The login for the user (required)password - The password for the user (required)
User item
BaseException - If there is an error
public CreationEvent createCreationEvent(MeasuredBioMaterial<?> bioMaterial,
MeasuredBioMaterial<?> sourceMaterial,
Float usedQuantity)
throws BaseException
BioMaterialEvent of the Type#OTHER
type. If only a single BioMaterial was used it can be given as parameter
optionally with the used amount of the biomaterial
bioMaterial - The affected biomaterial
BioMaterialEvent item
BaseException - If there is an error
public Directory createHomeDirectory(User user)
throws PermissionDeniedException,
BaseException
user -
PermissionDeniedException
BaseException
public LabeledExtract createLabeledExtract(Label label)
throws BaseException
LabeledExtract with label.
label - The labeling compound used for labeling the extract
LabeledExtract item
BaseException - If there is an error
public AnnotationType createAnnotationType(Type valueType)
throws BaseException
AnnotationType item.
valueType - The type of values to use
AnnotationType item
BaseException - If there is an error
public GelImageAnalysisEvent createGelImageAnalysisEvent(MeasuredBioMaterial<?> bioMaterial)
throws BaseException
GelImageAnalysisEvent of the Type#OTHER type.
bioMaterial - The affected biomaterial
GelImageAnalysisEvent item
BaseException - If there is an error
public GelScanEvent createGelScanEvent(MeasuredBioMaterial<?> bioMaterial)
throws BaseException
GelScanEvent of the Type#OTHER type.
bioMaterial - The affected biomaterial
GelScanEvent item
BaseException - If there is an error
public SeparationEvent createSeparationEvent(MeasuredBioMaterial<?> bioMaterial,
Float usedQuantity)
throws BaseException
SeparationEvent of the Type#OTHER type.
bioMaterial - The affected biomaterial
SeparationEvent item
BaseException - If there is an error
public StainingEvent createStainingEvent(MeasuredBioMaterial<?> bioMaterial)
throws BaseException
StainingEvent of the Type#OTHER type.
bioMaterial - The affected biomaterial
StainingEvent item
BaseException - If there is an error
public UpdateEvent createUpdateEvent(MeasuredBioMaterial<?> bioMaterial)
throws BaseException
UpdateEvent of the Type#OTHER type.
bioMaterial - The affected biomaterial
UpdateEvent item
BaseException - If there is an error
public SeparationMethod<?> createSeparationMethod(String externalId)
throws BaseException
SeparationMethod item.
externalId - The external id of the new item
SeparationMethod item
BaseException - If there is an error
public GlobalDefaultSetting createGlobalDefaultSetting(String name,
String value)
throws BaseException
GlobalDefaultSetting item.
name - The name of the settingvalue - The value of the setting
ClientDefaultSetting item
BaseException - If there is an error
public Message createMessage(User to,
String fromName,
User fromUser,
Job job)
throws BaseException
Message item.
to - the user the message shuold be sent tofromName - the name of the sender of the messagefromUser - the user sending the messagejob - the job this message is about
Message item
BaseException - If there is an error
public <T extends BasicItem<?>> T getById(Class<T> name,
Integer id)
public File getByPath(Path path,
boolean create)
throws ItemNotFoundException,
PermissionDeniedException,
BaseException
File item when you know the path. Use the create
parameter to specify if a new file should be create if it doesn't exists.
The directory part of the path must still be an existing path, otherwise
an ItemNotFoundException is thrown.
path - The path to the file to loadcreate - TRUE if a new file should be created if one doesn't eixts,
FALSE to throw an exception (DbControl.saveItem must always be
called)
File item
ItemNotFoundException - If an item with the specified path is not
found and create is FALSE
PermissionDeniedException - If the logged in user doesn't have
Permission.READ permission to the item
BaseException - If there is another error
public <T extends BasicItem<?>> T getBySystemId(Class<T> name,
String id)
public Directory getByPath(Path path)
throws ItemNotFoundException,
PermissionDeniedException,
BaseException
Directory item when you know the path.
path - The path to the directory to load
Directory item
ItemNotFoundException - If an item with the specified path is not
found
PermissionDeniedException - If the logged in user doesn't have
Permission.READ permission to the item
BaseException - If there is another error
|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||