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 voidcloseCalled(int idx)FilesetgetFileset()longgetGroup()HandlePrxgetHandle(Ice.Current ignore)Reacquire the handle which was returned byverifyUpload.ImportSettingsgetImportSettings(Ice.Current __current)ImportProcessPrxgetProxy()RawFileStorePrxgetUploader(int i, Ice.Current current)Step 1: Returns a RawFileStore that can be used to upload one of the used files.longgetUploadOffset(int idx, Ice.Current ignore)In case an upload must be resumed, this provides the location of the last successful upload.voidping()protected voidpostClose(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 voidpreClose(Ice.Current current)protected voidregisterCallback(RawFileStorePrx prx, int idx)protected ImportProcessPrxregisterProxy(Ice.Current ignore)Adds this instance to the current session so that clients can communicate with it.voidsetOffset(int idx, long offset)voidsetServiceFactory(ServiceFactoryI sf)voidshutdown()HandlePrxverifyUpload(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:
setServiceFactoryin 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:
getProxyin interfaceProcessContainer.Process
-
getFileset
public Fileset getFileset()
- Specified by:
getFilesetin interfaceProcessContainer.Process
-
getImportSettings
public ImportSettings getImportSettings(Ice.Current __current)
- Specified by:
getImportSettingsin interface_ImportProcessOperations
-
getGroup
public long getGroup()
- Specified by:
getGroupin interfaceProcessContainer.Process
-
ping
public void ping()
- Specified by:
pingin interfaceProcessContainer.Process
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceProcessContainer.Process
-
getUploader
public RawFileStorePrx getUploader(int i, Ice.Current current) throws ServerError
Description copied from interface:_ImportProcessOperationsStep 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.closeshould be called once all data has been transferred. If the file must be re-written, callgetUploaderwith the same index again. Once all uploads have been completed,verifyUploadshould be called to initiate background processing- Specified by:
getUploaderin interface_ImportProcessOperationscurrent- 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:_ImportProcessOperationsStep 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 aHandleproxy is returned, which completes all the necessary import steps. A successful import will return anImportResponse. Otherwise, someERRwill be returned.- Specified by:
verifyUploadin interface_ImportProcessOperations__current- The Current object for the invocation.- Throws:
ServerError
-
getUploadOffset
public long getUploadOffset(int idx, Ice.Current ignore) throws ServerErrorDescription copied from interface:_ImportProcessOperationsIn case an upload must be resumed, this provides the location of the last successful upload.- Specified by:
getUploadOffsetin interface_ImportProcessOperationsignore- The Current object for the invocation.- Throws:
ServerError
-
getHandle
public HandlePrx getHandle(Ice.Current ignore)
Description copied from interface:_ImportProcessOperationsReacquire the handle which was returned byverifyUpload. This is useful in case a new client is re-attaching to a running import. From theHandleinstance, the originalImportRequestcan also be found.- Specified by:
getHandlein 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:
preClosein classAbstractCloseableAmdServant- Throws:
java.lang.Throwable
-
postClose
protected void postClose(Ice.Current current)
Description copied from class:AbstractCloseableAmdServantShould 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:
postClosein classAbstractCloseableAmdServant
-
-