Package omero.gateway.facility
Class TablesFacility
- java.lang.Object
-
- omero.gateway.facility.Facility
-
- omero.gateway.facility.TablesFacility
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_ROWS_TO_FETCH
Maximum number of rows to fetch if not specified otherwisestatic java.lang.String
TABLES_MIMETYPE
The mimetype of an omero tables file
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TableData
addTable(SecurityContext ctx, DataObject target, java.lang.String name, java.lang.String ns, TableData data)
Adds a new table with the provided dataTableData
addTable(SecurityContext ctx, DataObject target, java.lang.String name, TableData data)
Adds a new table with the provided datajava.util.Collection<FileAnnotationData>
getAvailableTables(SecurityContext ctx, DataObject parent)
Get all available tables for a the specified objectTableData
getTable(SecurityContext ctx, long fileId)
Load the data from a table (Note: limited toDEFAULT_MAX_ROWS_TO_FETCH
number of rows)TableData
getTable(SecurityContext ctx, long fileId, long... rows)
Load data from a tableTableData
getTable(SecurityContext ctx, long fileId, long rowFrom, long rowTo, int... columns)
Load data from a tableTableData
getTable(SecurityContext ctx, long fileId, long rowFrom, long rowTo, long... columns)
Load data from a tableTableData
getTable(SecurityContext ctx, long fileId, java.util.List<java.lang.Long> rows)
Load data from a tableTableData
getTableInfo(SecurityContext ctx, long fileId)
Get basic information about a table.long[]
query(SecurityContext ctx, long fileId, java.lang.String condition)
Perform a query on the tablelong[]
query(SecurityContext ctx, long fileId, java.lang.String condition, long start, long stop, long step)
Perform a query on the tablevoid
updateTable(SecurityContext ctx, TableData data)
Deprecated.This method is not reliable and might be removed/replaced in future.-
Methods inherited from class omero.gateway.facility.Facility
addPropertyChangeListener, clear, firePropertyChanged, firePropertyChanged, getFacility, logDebug, logError, logInfo, logWarn, removePropertyChangeListener
-
-
-
-
Field Detail
-
TABLES_MIMETYPE
public static final java.lang.String TABLES_MIMETYPE
The mimetype of an omero tables file- See Also:
- Constant Field Values
-
DEFAULT_MAX_ROWS_TO_FETCH
public static final int DEFAULT_MAX_ROWS_TO_FETCH
Maximum number of rows to fetch if not specified otherwise- See Also:
- Constant Field Values
-
-
Method Detail
-
addTable
public TableData addTable(SecurityContext ctx, DataObject target, java.lang.String name, TableData data) throws DSOutOfServiceException, DSAccessException
Adds a new table with the provided data- Parameters:
ctx
- TheSecurityContext
target
- The object to attach the table toname
- A name for the table (can benull
)data
- The data- Returns:
- The
TableData
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inDSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
addTable
public TableData addTable(SecurityContext ctx, DataObject target, java.lang.String name, java.lang.String ns, TableData data) throws DSOutOfServiceException, DSAccessException
Adds a new table with the provided data- Parameters:
ctx
- TheSecurityContext
target
- The object to attach the table toname
- A name for the table (can benull
)ns
- An optional namespace for the file annotationdata
- The data- Returns:
- The
TableData
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inDSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
getTableInfo
public TableData getTableInfo(SecurityContext ctx, long fileId) throws DSOutOfServiceException, DSAccessException
Get basic information about a table.- Parameters:
ctx
- TheSecurityContext
fileId
- The id of theOriginalFile
which stores the table- Returns:
- An 'empty'
TableData
object without the actual table data loaded; which only contains information about the columns and the size of the table. - Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inDSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
getTable
public TableData getTable(SecurityContext ctx, long fileId) throws DSOutOfServiceException, DSAccessException
Load the data from a table (Note: limited toDEFAULT_MAX_ROWS_TO_FETCH
number of rows)- Parameters:
ctx
- TheSecurityContext
fileId
- The id of theOriginalFile
which stores the table- Returns:
- The data which the table contains
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inDSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
getTable
public TableData getTable(SecurityContext ctx, long fileId, long rowFrom, long rowTo, int... columns) throws DSOutOfServiceException, DSAccessException
Load data from a table- Parameters:
ctx
- TheSecurityContext
fileId
- The id of theOriginalFile
which stores the tablerowFrom
- The start row (inclusive)rowTo
- The end row (inclusive) (can be-1
in which caseDEFAULT_MAX_ROWS_TO_FETCH
rows will be fetched)columns
- The columns to take into account (can be left unspecified, in which case all columns will used)- Returns:
- The specified data
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inDSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
query
public long[] query(SecurityContext ctx, long fileId, java.lang.String condition) throws DSOutOfServiceException, DSAccessException
Perform a query on the table- Parameters:
ctx
- TheSecurityContext
fileId
- The id of theOriginalFile
which stores the tablecondition
- The query string- Returns:
- A list of row indices matching the condition
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inDSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
query
public long[] query(SecurityContext ctx, long fileId, java.lang.String condition, long start, long stop, long step) throws DSOutOfServiceException, DSAccessException
Perform a query on the table- Parameters:
ctx
- TheSecurityContext
fileId
- The id of theOriginalFile
which stores the tablecondition
- The query stringstart
- The index of the first row to consider (optional, default: 0)stop
- The index of the last+1 row to consider (optional, default: number of rows of the table)step
- The stepping interval between the start and stop rows to consider (optional, default: no stepping)- Returns:
- A list of row indices matching the condition
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inDSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
getTable
public TableData getTable(SecurityContext ctx, long fileId, java.util.List<java.lang.Long> rows) throws DSOutOfServiceException, DSAccessException
Load data from a table- Parameters:
ctx
- TheSecurityContext
fileId
- The id of theOriginalFile
which stores the tablerows
- The rows to get- Returns:
- The specified data
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inDSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
getTable
public TableData getTable(SecurityContext ctx, long fileId, long... rows) throws DSOutOfServiceException, DSAccessException
Load data from a table- Parameters:
ctx
- TheSecurityContext
fileId
- The id of theOriginalFile
which stores the tablerows
- The rows to get- Returns:
- The specified data
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inDSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
getTable
public TableData getTable(SecurityContext ctx, long fileId, long rowFrom, long rowTo, long... columns) throws DSOutOfServiceException, DSAccessException
Load data from a table- Parameters:
ctx
- TheSecurityContext
fileId
- The id of theOriginalFile
which stores the tablerowFrom
- The start row (inclusive)rowTo
- The end row (inclusive) (can be-1
in which caseDEFAULT_MAX_ROWS_TO_FETCH
rows will be fetched)columns
- The columns to take into account (can be left unspecified, in which case all columns will used)- Returns:
- The specified data
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inDSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
getAvailableTables
public java.util.Collection<FileAnnotationData> getAvailableTables(SecurityContext ctx, DataObject parent) throws DSOutOfServiceException, DSAccessException
Get all available tables for a the specified object- Parameters:
ctx
- TheSecurityContext
parent
- TheDataObject
- Returns:
- See above
- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inDSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
updateTable
@Deprecated public void updateTable(SecurityContext ctx, TableData data) throws DSOutOfServiceException, DSAccessException
Deprecated.This method is not reliable and might be removed/replaced in future.Saves the (modified)TableData
back to the server. Note: - Addition/Removal of columns/rows is not supported, only modification of the values. - The size of Double/Float/Long arrays can't be changed!- Parameters:
ctx
- TheSecurityContext
data
- TheTableData
to save- Throws:
DSOutOfServiceException
- If the connection is broken, or not logged inDSAccessException
- If an error occurred while trying to retrieve data from OMERO service.
-
-