Package ome.services.blitz.repo
Class ManagedImportProcessI
- java.lang.Object
-
- ome.services.blitz.impl.AbstractAmdServant
-
- ome.services.blitz.impl.AbstractCloseableAmdServant
-
- ome.services.blitz.repo.ManagedImportProcessI
-
- All Implemented Interfaces:
ProcessContainer.Process
,ServiceFactoryAware
,_ServiceInterfaceOperations
,_StatefulServiceInterfaceOperations
,_ImportProcessOperations
,CloseableServant
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class ManagedImportProcessI extends AbstractCloseableAmdServant implements _ImportProcessOperations, ServiceFactoryAware, ProcessContainer.Process
Represents a single import within a defined-session all running server-side.- Since:
- 5.0.0
-
-
Constructor Summary
Constructors Constructor Description ManagedImportProcessI(ManagedRepositoryI repo, Fileset fs, ImportLocation location, ImportSettings settings, Ice.Current __current, java.lang.String rootToken)
Create and register a servant for servicing the import process within a managed repository.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeCalled(int idx)
Fileset
getFileset()
long
getGroup()
HandlePrx
getHandle(Ice.Current ignore)
Reacquire the handle which was returned byverifyUpload
.ImportSettings
getImportSettings(Ice.Current __current)
ImportProcessPrx
getProxy()
RawFileStorePrx
getUploader(int i, Ice.Current current)
Step 1: Returns a RawFileStore that can be used to upload one of the used files.long
getUploadOffset(int idx, Ice.Current ignore)
In case an upload must be resumed, this provides the location of the last successful upload.void
ping()
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)
protected void
registerCallback(RawFileStorePrx prx, int idx)
protected ImportProcessPrx
registerProxy(Ice.Current ignore)
Adds this instance to the current session so that clients can communicate with it.void
setOffset(int idx, long offset)
void
setServiceFactory(ServiceFactoryI sf)
void
shutdown()
HandlePrx
verifyUpload(java.util.List<java.lang.String> hashes, Ice.Current __current)
Step 2: Passes a set of client-side calculated hashes to the server for verifying that all of the files were correctly uploaded.-
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
-
ManagedImportProcessI
public ManagedImportProcessI(ManagedRepositoryI repo, Fileset fs, ImportLocation location, ImportSettings settings, Ice.Current __current, java.lang.String rootToken) throws ServerError
Create and register a servant for servicing the import process within a managed repository.- Throws:
ServerError
-
-
Method Detail
-
setServiceFactory
public void setServiceFactory(ServiceFactoryI sf) throws ServerError
- Specified by:
setServiceFactory
in interfaceServiceFactoryAware
- Throws:
ServerError
-
registerProxy
protected ImportProcessPrx registerProxy(Ice.Current ignore) throws ServerError
Adds this instance to the current session so that clients can communicate with it. Once we move to opening a new session for this import, care must be taken to guarantee that these instances don't leak: i.e. who's responsible for closing them and removing them from the adapter.- Throws:
ServerError
-
getProxy
public ImportProcessPrx getProxy()
- Specified by:
getProxy
in interfaceProcessContainer.Process
-
getFileset
public Fileset getFileset()
- Specified by:
getFileset
in interfaceProcessContainer.Process
-
getImportSettings
public ImportSettings getImportSettings(Ice.Current __current)
- Specified by:
getImportSettings
in interface_ImportProcessOperations
-
getGroup
public long getGroup()
- Specified by:
getGroup
in interfaceProcessContainer.Process
-
ping
public void ping()
- Specified by:
ping
in interfaceProcessContainer.Process
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceProcessContainer.Process
-
getUploader
public RawFileStorePrx getUploader(int i, Ice.Current current) throws ServerError
Description copied from interface:_ImportProcessOperations
Step 1: Returns a RawFileStore that can be used to upload one of the used files. The index is the same as the used file listed inImportLocation
.omero.api.RawFileStore.close
should be called once all data has been transferred. If the file must be re-written, callgetUploader
with the same index again. Once all uploads have been completed,verifyUpload
should be called to initiate background processing- Specified by:
getUploader
in interface_ImportProcessOperations
current
- The Current object for the invocation.- Throws:
ServerError
-
registerCallback
protected void registerCallback(RawFileStorePrx prx, int idx)
-
verifyUpload
public HandlePrx verifyUpload(java.util.List<java.lang.String> hashes, Ice.Current __current) throws ServerError
Description copied from interface:_ImportProcessOperations
Step 2: Passes a set of client-side calculated hashes to the server for verifying that all of the files were correctly uploaded. If this passes then aHandle
proxy is returned, which completes all the necessary import steps. A successful import will return anImportResponse
. Otherwise, someERR
will be returned.- Specified by:
verifyUpload
in interface_ImportProcessOperations
__current
- The Current object for the invocation.- Throws:
ServerError
-
getUploadOffset
public long getUploadOffset(int idx, Ice.Current ignore) throws ServerError
Description copied from interface:_ImportProcessOperations
In case an upload must be resumed, this provides the location of the last successful upload.- Specified by:
getUploadOffset
in interface_ImportProcessOperations
ignore
- The Current object for the invocation.- Throws:
ServerError
-
getHandle
public HandlePrx getHandle(Ice.Current ignore)
Description copied from interface:_ImportProcessOperations
Reacquire the handle which was returned byverifyUpload
. This is useful in case a new client is re-attaching to a running import. From theHandle
instance, the originalImportRequest
can also be found.- Specified by:
getHandle
in interface_ImportProcessOperations
- Parameters:
ignore
- The Current object for the invocation.
-
setOffset
public void setOffset(int idx, long offset)
-
closeCalled
public void closeCalled(int idx)
-
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
-
-