Package fr.igred.omero
Class GenericObjectWrapper<T extends DataObject>
- java.lang.Object
-
- fr.igred.omero.GenericObjectWrapper<T>
-
- Type Parameters:
T- Subclass ofDataObject
- Direct Known Subclasses:
ChannelWrapper,ExperimenterWrapper,GenericAnnotationWrapper,GenericRepositoryObjectWrapper,GenericShapeWrapper,GroupWrapper,PixelsWrapper,ROIWrapper
public abstract class GenericObjectWrapper<T extends DataObject> extends Object
Generic class containing a DataObject (or a subclass) object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGenericObjectWrapper.SortById<U extends GenericObjectWrapper<?>>Class used to sort wrappers.
-
Constructor Summary
Constructors Modifier Constructor Description protectedGenericObjectWrapper(T object)Constructor of the class GenericObjectWrapper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanAnnotate()Returnstrueif the object can be annotatedfalseotherwise, depending on permissions level.booleancanChgrp()Returnstrueif the object can be moved by the user currently logged in,falseotherwise, depending on permissions level.booleancanChown()Returnstrueif the object can be given by the user currently logged in,falseotherwise, depending on permissions level.booleancanDelete()Returnstrueif the object can be deleted by the user currently logged in,falseotherwise, depending on permissions level.booleancanEdit()Returnstrueif the object can be edited by the user currently logged infalseotherwise, depending on permissions level.booleancanLink()Returnstrueif the object can be linked e.g.protected static voiddelete(Client client, IObject object)Deletes an object from OMERO.TimestampgetCreated()Gets the object creation dateLonggetGroupId()Gets the group IDlonggetId()Gets the object idExperimenterWrappergetOwner()Gets the owner IDvoidsaveAndUpdate(Client client)Saves and updates object.StringtoString()Overridden to return the name of the class and the object id.
-
-
-
Field Detail
-
data
protected T extends DataObject data
-
-
Constructor Detail
-
GenericObjectWrapper
protected GenericObjectWrapper(T object)
Constructor of the class GenericObjectWrapper.- Parameters:
object- The object contained in the GenericObjectWrapper.
-
-
Method Detail
-
getId
public long getId()
Gets the object id- Returns:
- id.
-
getCreated
public Timestamp getCreated()
Gets the object creation date- Returns:
- creation date.
-
getOwner
public ExperimenterWrapper getOwner()
Gets the owner ID- Returns:
- owner id.
-
getGroupId
public Long getGroupId()
Gets the group ID- Returns:
- group id.
-
toString
public String toString()
Overridden to return the name of the class and the object id.- Overrides:
toStringin classObject- See Also:
Object.toString()
-
saveAndUpdate
public void saveAndUpdate(Client client) throws ExecutionException, ServiceException, AccessException
Saves and updates object.- Parameters:
client- The client handling the connection.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.ExecutionException- A Facility can't be retrieved or instantiated.
-
canAnnotate
public boolean canAnnotate()
Returnstrueif the object can be annotatedfalseotherwise, depending on permissions level.- Returns:
- See above.
-
canEdit
public boolean canEdit()
Returnstrueif the object can be edited by the user currently logged infalseotherwise, depending on permissions level.- Returns:
- See above.
-
canLink
public boolean canLink()
Returnstrueif the object can be linked e.g. image add to dataset, by the user currently logged in,falseotherwise, depending on permissions level.- Returns:
- See above.
-
canDelete
public boolean canDelete()
Returnstrueif the object can be deleted by the user currently logged in,falseotherwise, depending on permissions level.- Returns:
- See above.
-
canChgrp
public boolean canChgrp()
Returnstrueif the object can be moved by the user currently logged in,falseotherwise, depending on permissions level.- Returns:
- See above.
-
canChown
public boolean canChown()
Returnstrueif the object can be given by the user currently logged in,falseotherwise, depending on permissions level.- Returns:
- See above.
-
delete
protected static void delete(Client client, IObject object) throws ServiceException, AccessException, ExecutionException, OMEROServerError, InterruptedException
Deletes an object from OMERO.- Parameters:
client- The client handling the connection.object- The OMERO object.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.ExecutionException- A Facility can't be retrieved or instantiated.OMEROServerError- If the thread was interrupted.InterruptedException- If block(long) does not return.
-
-