Package ome.services.blitz.repo
Class ManagedImportRequestI
- java.lang.Object
-
- Ice.ObjectImpl
-
- omero.cmd.Request
-
- omero.grid.ImportRequest
-
- ome.services.blitz.repo.ManagedImportRequestI
-
- All Implemented Interfaces:
Ice.Object,java.io.Serializable,java.lang.Cloneable,IRequest
public class ManagedImportRequestI extends ImportRequest implements IRequest
Wrapper aroundFilesetJobLinkinstances which need to be handled on the server-side. This will primarily provide the step-location required byHandleby calling back to theManagedImportProcessIobject.- Since:
- 5.0.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ManagedImportRequestI(Registry reg, ome.io.nio.TileSizes sizes, RepositoryDao dao, OMEROWrapper wrapper, java.lang.String token)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildResponse(int step, java.lang.Object object)Post-transaction chance to map from the return value ofIRequest.step(int)to aResponseobject.voidfinish()Method within the transaction boundaries after all processing has occurred.java.lang.ObjectgenerateThumbnails(ThumbnailGenerationJob tgj)java.util.Map<java.lang.String,java.lang.String>getCallContext()Returns the desired call context for this request.ResponsegetResponse()Returns the current response value.java.util.Map<java.lang.String,java.util.List<IObject>>importMetadata(MetadataImportJob mij)Uses theOMEROMetadataStoreClientto save all metadata for the current image provided.java.lang.Objectindex(IndexingJob ij)voidinit(Helper helper)Method called within the transaction boundaries before any processing occurs.java.security.MessageDigestparseData(java.lang.String fileName, int series, ImportSize size)Parse the binary data to generate min/max values and allow an md to be calculated.java.lang.ObjectpixelData(PixelDataJob pdj)protected voidregisterKeepAlive()If thesetResources(Resources)has been called with a non-null value, then create anResources.Entrywhich will ping theServiceFactoryPrxinstance periodically to keep the import from timing out.java.lang.Objectscript(ScriptJob sj)voidsetCallContext(java.util.Map<java.lang.String,java.lang.String> callContext)voidsetResources(Resources resources)Late injection to not break the constructorjava.lang.Objectstep(int step)Single uncancellable action which will be performed by this IRequest.-
Methods inherited from class omero.grid.ImportRequest
__readImpl, __writeImpl, clone, ice_factory, ice_id, ice_id, ice_ids, ice_ids, ice_isA, ice_isA, ice_staticId
-
-
-
-
Field Detail
-
handle
public HandlePrx handle
Set by ManagedImportProcessI when verifyUpload has been called.
-
-
Constructor Detail
-
ManagedImportRequestI
public ManagedImportRequestI(Registry reg, ome.io.nio.TileSizes sizes, RepositoryDao dao, OMEROWrapper wrapper, java.lang.String token)
-
-
Method Detail
-
setResources
public void setResources(Resources resources)
Late injection to not break the constructor
-
setCallContext
public void setCallContext(java.util.Map<java.lang.String,java.lang.String> callContext)
- Parameters:
callContext- the call context to set
-
getCallContext
public java.util.Map<java.lang.String,java.lang.String> getCallContext()
Description copied from interface:IRequestReturns the desired call context for this request. Some request implementations will require "omero.group":"-1" for example and will hard-code that value. Others may permit users to pass in the desired values which will be merged into the staticMapas desired.- Specified by:
getCallContextin interfaceIRequest- Returns:
- the call context for this request
-
init
public void init(Helper helper)
Description copied from interface:IRequestMethod called within the transaction boundaries before any processing occurs. Implementations must properly initialize the "step" field of theStatusobject by callingHelper.setSteps(int). This count will define how many times theIRequest.step(int)method will be called. TheHelperinstance passed in contains those resources needed by IRequests to interact with data and should be stored for later use.
-
registerKeepAlive
protected void registerKeepAlive()
If thesetResources(Resources)has been called with a non-null value, then create anResources.Entrywhich will ping theServiceFactoryPrxinstance periodically to keep the import from timing out. This is especially important for autoClose imports since no other client is likely to keep them alive. If the ping fails, then theResources.Entryreturns null which will remove the instance for theResourcesobject. Otherwise, duringcleanup()remove will be called explicitly.
-
step
public java.lang.Object step(int step)
Description copied from interface:IRequestSingle uncancellable action which will be performed by this IRequest. The return value can be an ome.model object that is attached to the current thread and transaction. After processing and detachment from the transaction, the object will be passed toIRequest.buildResponse(int, Object)for conversion and storage.
-
finish
public void finish() throws HandleI.CancelDescription copied from interface:IRequestMethod within the transaction boundaries after all processing has occurred. A thrownHandleI.Cancelwill still rollback the current transaction.- Specified by:
finishin interfaceIRequest- Throws:
HandleI.Cancel- if this request is cancelled
-
buildResponse
public void buildResponse(int step, java.lang.Object object)Description copied from interface:IRequestPost-transaction chance to map from the return value ofIRequest.step(int)to aResponseobject.- Specified by:
buildResponsein interfaceIRequest- Parameters:
step- the step numberobject- an object to be used in building the response
-
getResponse
public Response getResponse()
Description copied from interface:IRequestReturns the current response value. This method should be protected by synchronization where necessary, and should never raise an exception. It is also guaranteed to be called so that any state cleanup that is necessary can take place here.- Specified by:
getResponsein interfaceIRequest- Returns:
- the response to this request
-
importMetadata
public java.util.Map<java.lang.String,java.util.List<IObject>> importMetadata(MetadataImportJob mij) throws java.lang.Throwable
Uses theOMEROMetadataStoreClientto save all metadata for the current image provided.- Parameters:
mij- Object hosting metadata to save.- Returns:
- the newly created
Pixelsid. - Throws:
loci.formats.FormatException- if there is an error parsing metadata.java.io.IOException- if there is an error reading the file.java.lang.Throwable
-
pixelData
public java.lang.Object pixelData(PixelDataJob pdj) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
generateThumbnails
public java.lang.Object generateThumbnails(ThumbnailGenerationJob tgj) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
index
public java.lang.Object index(IndexingJob ij)
-
script
public java.lang.Object script(ScriptJob sj)
-
parseData
public java.security.MessageDigest parseData(java.lang.String fileName, int series, ImportSize size) throws loci.formats.FormatException, java.io.IOException, ServerErrorParse the binary data to generate min/max values and allow an md to be calculated.- Parameters:
series-- Returns:
- The SHA1 message digest for the binary data.
- Throws:
loci.formats.FormatExceptionjava.io.IOExceptionServerError
-
-