Package ome.services.blitz.impl
Class RawFileStoreI
- java.lang.Object
-
- ome.services.blitz.impl.AbstractAmdServant
-
- ome.services.blitz.impl.AbstractCloseableAmdServant
-
- ome.services.blitz.impl.RawFileStoreI
-
- All Implemented Interfaces:
ServiceFactoryAware
,_RawFileStoreOperations
,_ServiceInterfaceOperations
,_StatefulServiceInterfaceOperations
,CloseableServant
,TieAware
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
RepoRawFileStoreI
public class RawFileStoreI extends AbstractCloseableAmdServant implements _RawFileStoreOperations, ServiceFactoryAware, TieAware
Implementation of the RawFileStore service.- Since:
- 3.0-Beta4
- See Also:
RawFileStore
-
-
Constructor Summary
Constructors Constructor Description RawFileStoreI(ome.api.RawFileStore service, BlitzExecutor be)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
__redirect(long fileId, _RawFileStoreTie rfsTie, Ice.Current current)
void
exists_async(AMD_RawFileStore_exists __cb, Ice.Current __current)
Checks to see if a raw file exists with the file ID that the service was initialized with.void
getFileId_async(AMD_RawFileStore_getFileId __cb, Ice.Current __current)
Returns the current file id or null if none has been set.ServiceFactoryI
getServiceFactory()
protected 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)
void
read_async(AMD_RawFileStore_read __cb, long position, int length, Ice.Current __current)
Readslength
bytes of data at theposition
from the raw file into an array of bytes.void
save_async(AMD_RawFileStore_save __cb, Ice.Current __current)
Saves theOriginalFile
associated with the service if it has been modified.void
setFileId_async(AMD_RawFileStore_setFileId __cb, long fileId, Ice.Current __current)
This method manages the state of the service.void
setServiceFactory(ServiceFactoryI sf)
void
setTie(Ice.TieBase tie)
void
size_async(AMD_RawFileStore_size __cb, Ice.Current __current)
Returns the size of the file on disk (not as stored in the database since that value will only be updated onsave
.void
truncate_async(AMD_RawFileStore_truncate __cb, long length, Ice.Current __current)
Limits the size of a file to the given length.void
write_async(AMD_RawFileStore_write __cb, byte[] buf, long position, int length, Ice.Current __current)
Writeslength
bytes of data from the specifiedbuf
byte array starting at atposition
to the raw file.-
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
-
-
-
-
Constructor Detail
-
RawFileStoreI
public RawFileStoreI(ome.api.RawFileStore service, BlitzExecutor be)
-
-
Method Detail
-
setServiceFactory
public void setServiceFactory(ServiceFactoryI sf) throws ServerError
- Specified by:
setServiceFactory
in interfaceServiceFactoryAware
- Throws:
ServerError
-
getServiceFactory
public ServiceFactoryI getServiceFactory() throws ServerError
- Throws:
ServerError
-
setTie
public void setTie(Ice.TieBase tie) throws ServerError
- Specified by:
setTie
in interfaceTieAware
- Throws:
ServerError
-
exists_async
public void exists_async(AMD_RawFileStore_exists __cb, Ice.Current __current) throws ServerError
Description copied from interface:_RawFileStoreOperations
Checks to see if a raw file exists with the file ID that the service was initialized with.- Specified by:
exists_async
in interface_RawFileStoreOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
read_async
public void read_async(AMD_RawFileStore_read __cb, long position, int length, Ice.Current __current) throws ServerError
Description copied from interface:_RawFileStoreOperations
Readslength
bytes of data at theposition
from the raw file into an array of bytes.- Specified by:
read_async
in interface_RawFileStoreOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
getFileId_async
public void getFileId_async(AMD_RawFileStore_getFileId __cb, Ice.Current __current) throws ServerError
Description copied from interface:_RawFileStoreOperations
Returns the current file id or null if none has been set.- Specified by:
getFileId_async
in interface_RawFileStoreOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
setFileId_async
public void setFileId_async(AMD_RawFileStore_setFileId __cb, long fileId, Ice.Current __current) throws ServerError
Description copied from interface:_RawFileStoreOperations
This method manages the state of the service. This method will throw aSecurityViolation
if for the current user context either the file is not readable or aomero.constants.permissions.BINARYACCESS
restriction is in place.- Specified by:
setFileId_async
in interface_RawFileStoreOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
size_async
public void size_async(AMD_RawFileStore_size __cb, Ice.Current __current) throws ServerError
Description copied from interface:_RawFileStoreOperations
Returns the size of the file on disk (not as stored in the database since that value will only be updated onsave
. If the file has not yet been written to, and therefore does not exist, aResourceError
will be thrown.- Specified by:
size_async
in interface_RawFileStoreOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
truncate_async
public void truncate_async(AMD_RawFileStore_truncate __cb, long length, Ice.Current __current) throws ServerError
Description copied from interface:_RawFileStoreOperations
Limits the size of a file to the given length. If the file is already shorter than length, no action is taken in which case false is returned.- Specified by:
truncate_async
in interface_RawFileStoreOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
write_async
public void write_async(AMD_RawFileStore_write __cb, byte[] buf, long position, int length, Ice.Current __current) throws ServerError
Description copied from interface:_RawFileStoreOperations
Writeslength
bytes of data from the specifiedbuf
byte array starting at atposition
to the raw file.- Specified by:
write_async
in interface_RawFileStoreOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
save_async
public void save_async(AMD_RawFileStore_save __cb, Ice.Current __current) throws ServerError
Description copied from interface:_RawFileStoreOperations
Saves theOriginalFile
associated with the service if it has been modified. The returned valued should replace all instances of theOriginalFile
in the client. If save has not been called,RawFileStore
instances will save theOriginalFile
object associated with it onclose
. See also ticket 1651 and ticket 2161.- Specified by:
save_async
in interface_RawFileStoreOperations
- Parameters:
__cb
- The callback object for the operation.__current
- The Current object for the invocation.- Throws:
ServerError
-
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
-
__redirect
public boolean __redirect(long fileId, _RawFileStoreTie rfsTie, Ice.Current current) throws ServerError
- Throws:
ServerError
-
-