Package ome.services.blitz.impl
Class TableCloserI
- java.lang.Object
-
- ome.services.blitz.impl.AbstractAmdServant
-
- ome.services.blitz.impl.AbstractCloseableAmdServant
-
- ome.services.blitz.impl.TableCloserI
-
- All Implemented Interfaces:
_ServiceInterfaceOperations
,_StatefulServiceInterfaceOperations
,_TableOperations
,CloseableServant
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class TableCloserI extends AbstractCloseableAmdServant implements _StatefulServiceInterfaceOperations, _TableOperations
Blitz-specific wrapper for table proxies to facilitate the cleanup of files on session exit.
-
-
Constructor Summary
Constructors Constructor Description TableCloserI(ServiceFactoryI sf, TablePrx tablePrx, Ice.Identity id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addColumn(Column col, Ice.Current __current)
Adds a column and returns the position index of the new column.void
addData(Column[] cols, Ice.Current __current)
void
delete(Ice.Current __current)
java.util.Map<java.lang.String,RType>
getAllMetadata(Ice.Current __current)
Column[]
getHeaders(Ice.Current __current)
Returns empty columns.RType
getMetadata(java.lang.String key, Ice.Current __current)
long
getNumberOfRows(Ice.Current __current)
Return the number of rows of a table.OriginalFile
getOriginalFile(Ice.Current __current)
TablePrx
getProxy()
long[]
getWhereList(java.lang.String condition, java.util.Map<java.lang.String,RType> variables, long start, long stop, long step, Ice.Current __current)
Run a query on a table.void
initialize(Column[] cols, Ice.Current __current)
Initializes the structure based onprotected void
postClose(Ice.Current current)
Should not throw any exceptions which should be detected by clients since it is called in a finally block after the client thread has been released.protected void
preClose(Ice.Current current)
Data
read(long[] colNumbers, long start, long stop, Ice.Current __current)
Read a subset of columns and consecutive rows from a table.Data
readCoordinates(long[] rowNumbers, Ice.Current __current)
Read a set of entire rows in the table.void
setAllMetadata(java.util.Map<java.lang.String,RType> dict, Ice.Current __current)
void
setMetadata(java.lang.String key, RType value, Ice.Current __current)
Data
slice(long[] colNumbers, long[] rowNumbers, Ice.Current __current)
Read a subset of columns and consecutive rows from a table.void
update(Data modifiedData, Ice.Current __current)
Allows the user to modify a Data instance passed back from a query method and have the values modified.-
Methods inherited from class ome.services.blitz.impl.AbstractCloseableAmdServant
close, close_async
-
Methods inherited from class ome.services.blitz.impl.AbstractAmdServant
activate_async, applyHardWiredInterceptors, callInvokerOnMappedArgs, callInvokerOnRawArgs, executorWorkCall, getCurrentEventContext_async, onSetOmeroContext, passivate_async, runnableCall, safeRunnableCall, setApplicationContext, setHolder
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface omero.api._StatefulServiceInterfaceOperations
activate_async, close_async, getCurrentEventContext_async, passivate_async
-
Methods inherited from interface omero.grid._TableOperations
close
-
-
-
-
Constructor Detail
-
TableCloserI
public TableCloserI(ServiceFactoryI sf, TablePrx tablePrx, Ice.Identity id) throws ServerError
- Throws:
ServerError
-
-
Method Detail
-
getProxy
public TablePrx getProxy()
-
preClose
protected void preClose(Ice.Current current) throws java.lang.Throwable
- Specified by:
preClose
in classAbstractCloseableAmdServant
- Throws:
java.lang.Throwable
-
postClose
protected void postClose(Ice.Current current)
Description copied from class:AbstractCloseableAmdServant
Should not throw any exceptions which should be detected by clients since it is called in a finally block after the client thread has been released.- Specified by:
postClose
in classAbstractCloseableAmdServant
-
getOriginalFile
public OriginalFile getOriginalFile(Ice.Current __current) throws ServerError
- Specified by:
getOriginalFile
in interface_TableOperations
- Throws:
ServerError
-
getHeaders
public Column[] getHeaders(Ice.Current __current) throws ServerError
Description copied from interface:_TableOperations
Returns empty columns.- Specified by:
getHeaders
in interface_TableOperations
- Parameters:
__current
- The Current object for the invocation.- Throws:
ServerError
-
getNumberOfRows
public long getNumberOfRows(Ice.Current __current) throws ServerError
Description copied from interface:_TableOperations
Return the number of rows of a table.- Specified by:
getNumberOfRows
in interface_TableOperations
- Parameters:
__current
- The Current object for the invocation.- Throws:
ServerError
-
getWhereList
public long[] getWhereList(java.lang.String condition, java.util.Map<java.lang.String,RType> variables, long start, long stop, long step, Ice.Current __current) throws ServerError
Description copied from interface:_TableOperations
Run a query on a table. The meaning of the start and stop parameters are the same as in the built-in Python slices. Setting start, step and stop to 0 is interpreted as running the query against all rows.- Specified by:
getWhereList
in interface_TableOperations
- Parameters:
condition
- A query string - see the tables query language for more details.variables
- A mapping of strings and variable values to be substituted into condition. This can often be left empty.start
- The start of the range of rows to consider.stop
- The end of the range of rows to consider.step
- The stepping interval of the range of rows to consider. Set to 0 to disable stepping.__current
- The Current object for the invocation.- Returns:
- A list of row indices matching the condition which can be passed as a
parameter of
_TableOperations.readCoordinates(long[], Ice.Current)
or_TableOperations.slice(long[], long[], Ice.Current)
. - Throws:
ServerError
-
readCoordinates
public Data readCoordinates(long[] rowNumbers, Ice.Current __current) throws ServerError
Description copied from interface:_TableOperations
Read a set of entire rows in the table.- Specified by:
readCoordinates
in interface_TableOperations
- Parameters:
rowNumbers
- A list of row indices to be retrieved from the table. The indices may be non-consecutive and must contain at least one element or anApiUsageException
will be thrown.__current
- The Current object for the invocation.- Returns:
- The requested rows as a
Data
object. The results will be returned in the same order as the row indices. - Throws:
ServerError
-
read
public Data read(long[] colNumbers, long start, long stop, Ice.Current __current) throws ServerError
Description copied from interface:_TableOperations
Read a subset of columns and consecutive rows from a table. The meaning of the start and stop parameters are the same as in the built-in Python slices. Setting both start and stop to 0 is interpreted as returning all rows.- Specified by:
read
in interface_TableOperations
- Parameters:
colNumbers
- A list of column indices to be retrieved from the table. The indices may be non-consecutive and must contain at least one element or anApiUsageException
will be thrown.start
- The first element of the range of rows to retrieve. Must be non null.stop
- The stop of the range of rows to retrieve. Must be non null.__current
- The Current object for the invocation.- Returns:
- The requested columns and rows as a
Data
object. - Throws:
ServerError
-
slice
public Data slice(long[] colNumbers, long[] rowNumbers, Ice.Current __current) throws ServerError
Description copied from interface:_TableOperations
Read a subset of columns and consecutive rows from a table.- Specified by:
slice
in interface_TableOperations
- Parameters:
colNumbers
- A list of column indices to be retrieved from the table. The indices may be non-consecutive. If set to empty or null, all columns will be returned.rowNumbers
- A list of row indices to be retrieved from the table. The indices may be non-consecutive. If set empty or null, all rows will be returned.__current
- The Current object for the invocation.- Returns:
- The requested columns and rows as a
Data
object. The results will be returned in the same order as the column and row indices. - Throws:
ServerError
-
addData
public void addData(Column[] cols, Ice.Current __current) throws ServerError
- Specified by:
addData
in interface_TableOperations
- Throws:
ServerError
-
update
public void update(Data modifiedData, Ice.Current __current) throws ServerError
Description copied from interface:_TableOperations
Allows the user to modify a Data instance passed back from a query method and have the values modified. It is critical that theData.lastModification
and theData.rowNumbers
fields are properly set. An exception will be thrown if the data has since been modified.- Specified by:
update
in interface_TableOperations
__current
- The Current object for the invocation.- Throws:
ServerError
-
getAllMetadata
public java.util.Map<java.lang.String,RType> getAllMetadata(Ice.Current __current) throws ServerError
- Specified by:
getAllMetadata
in interface_TableOperations
- Throws:
ServerError
-
getMetadata
public RType getMetadata(java.lang.String key, Ice.Current __current) throws ServerError
- Specified by:
getMetadata
in interface_TableOperations
- Throws:
ServerError
-
setAllMetadata
public void setAllMetadata(java.util.Map<java.lang.String,RType> dict, Ice.Current __current) throws ServerError
- Specified by:
setAllMetadata
in interface_TableOperations
- Throws:
ServerError
-
setMetadata
public void setMetadata(java.lang.String key, RType value, Ice.Current __current) throws ServerError
- Specified by:
setMetadata
in interface_TableOperations
- Throws:
ServerError
-
initialize
public void initialize(Column[] cols, Ice.Current __current) throws ServerError
Description copied from interface:_TableOperations
Initializes the structure based on- Specified by:
initialize
in interface_TableOperations
__current
- The Current object for the invocation.- Throws:
ServerError
-
addColumn
public int addColumn(Column col, Ice.Current __current) throws ServerError
Description copied from interface:_TableOperations
Adds a column and returns the position index of the new column.- Specified by:
addColumn
in interface_TableOperations
__current
- The Current object for the invocation.- Throws:
ServerError
-
delete
public void delete(Ice.Current __current) throws ServerError
- Specified by:
delete
in interface_TableOperations
- Throws:
ServerError
-
-