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 intDEFAULT_MAX_ROWS_TO_FETCHMaximum number of rows to fetch if not specified otherwisestatic java.lang.StringTABLES_MIMETYPEThe mimetype of an omero tables file
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TableDataaddTable(SecurityContext ctx, DataObject target, java.lang.String name, java.lang.String ns, TableData data)Adds a new table with the provided dataTableDataaddTable(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 objectTableDatagetTable(SecurityContext ctx, long fileId)Load the data from a table (Note: limited toDEFAULT_MAX_ROWS_TO_FETCHnumber of rows)TableDatagetTable(SecurityContext ctx, long fileId, long... rows)Load data from a tableTableDatagetTable(SecurityContext ctx, long fileId, long rowFrom, long rowTo, int... columns)Load data from a tableTableDatagetTable(SecurityContext ctx, long fileId, long rowFrom, long rowTo, long... columns)Load data from a tableTableDatagetTable(SecurityContext ctx, long fileId, java.util.List<java.lang.Long> rows)Load data from a tableTableDatagetTableInfo(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 tablevoidupdateTable(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- TheSecurityContexttarget- 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- TheSecurityContexttarget- 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- TheSecurityContextfileId- The id of theOriginalFilewhich stores the table- Returns:
- An 'empty'
TableDataobject 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_FETCHnumber of rows)- Parameters:
ctx- TheSecurityContextfileId- The id of theOriginalFilewhich 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- TheSecurityContextfileId- The id of theOriginalFilewhich stores the tablerowFrom- The start row (inclusive)rowTo- The end row (inclusive) (can be-1in which caseDEFAULT_MAX_ROWS_TO_FETCHrows 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- TheSecurityContextfileId- The id of theOriginalFilewhich 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- TheSecurityContextfileId- The id of theOriginalFilewhich 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- TheSecurityContextfileId- The id of theOriginalFilewhich 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- TheSecurityContextfileId- The id of theOriginalFilewhich 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- TheSecurityContextfileId- The id of theOriginalFilewhich stores the tablerowFrom- The start row (inclusive)rowTo- The end row (inclusive) (can be-1in which caseDEFAULT_MAX_ROWS_TO_FETCHrows 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- TheSecurityContextparent- 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)TableDataback 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- TheSecurityContextdata- TheTableDatato save- Throws:
DSOutOfServiceException- If the connection is broken, or not logged inDSAccessException- If an error occurred while trying to retrieve data from OMERO service.
-
-