Package omero.cmd.fs
Class OriginalMetadataRequestI
- java.lang.Object
-
- Ice.ObjectImpl
-
- omero.cmd.Request
-
- omero.cmd.OriginalMetadataRequest
-
- omero.cmd.fs.OriginalMetadataRequestI
-
- All Implemented Interfaces:
Ice.Object,java.io.Serializable,java.lang.Cloneable,ome.services.util.ReadOnlyStatus.IsAware,IRequest
public class OriginalMetadataRequestI extends OriginalMetadataRequest implements IRequest, ome.services.util.ReadOnlyStatus.IsAware
Original metadata loader, handling both pre-FS and post-FS data.- Since:
- 5.0.0
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class omero.cmd.OriginalMetadataRequest
__ids, imageId
-
-
Constructor Summary
Constructors Constructor Description OriginalMetadataRequestI(ome.io.nio.PixelsService pixelsService)
-
Method Summary
All Methods Static 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.protected RLongfirstIdOrNull(java.lang.String query)UseIQuery.projection(String, Parameters)to load the first long which matches the given query.java.util.Map<java.lang.String,java.lang.String>getCallContext()Returns the desired call context for this request.ResponsegetResponse()Returns the current response value.voidinit(Helper helper)Method called within the transaction boundaries before any processing occurs.booleanisReadOnly(ome.services.util.ReadOnlyStatus readOnly)protected voidloadFileAnnotation()Only called ifloadFileset()finds noFileset.protected voidloadFileset()Searches for aFilesetattached to thisImage, and if present, uses Bio-Formats to parse the metadata into theOriginalMetadataResponseinstance.static voidmain(java.lang.String[] args)protected voidparseOriginalMetadataTxt(java.io.File file)Read the given INI-style file and populate the maps with the properties from the corresponding sections.java.lang.Objectstep(int step)Single uncancellable action which will be performed by this IRequest.protected java.util.Map<java.lang.String,RType>wrap(java.util.Hashtable<java.lang.String,java.lang.Object> table)-
Methods inherited from class omero.cmd.OriginalMetadataRequest
__readImpl, __writeImpl, clone, ice_factory, ice_id, ice_id, ice_ids, ice_ids, ice_isA, ice_isA, ice_staticId
-
-
-
-
Method Detail
-
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.
-
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
-
loadFileset
protected void loadFileset()
Searches for aFilesetattached to thisImage, and if present, uses Bio-Formats to parse the metadata into theOriginalMetadataResponseinstance. If noFilesetis present, then there may be aFileAnnotationpresent which has a static version of the metadata.
-
loadFileAnnotation
protected void loadFileAnnotation()
Only called ifloadFileset()finds noFileset. If anyFileAnnotationinstances with the appropriate namespace and name are found, the first one is taken and parsed into theOriginalMetadataResponse.
-
firstIdOrNull
protected RLong firstIdOrNull(java.lang.String query)
UseIQuery.projection(String, Parameters)to load the first long which matches the given query. This means that the first return value in the select statement should likely be the id of an object.
-
wrap
protected java.util.Map<java.lang.String,RType> wrap(java.util.Hashtable<java.lang.String,java.lang.Object> table)
-
parseOriginalMetadataTxt
protected void parseOriginalMetadataTxt(java.io.File file)
Read the given INI-style file and populate the maps with the properties from the corresponding sections.- Parameters:
file- the file to read
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
isReadOnly
public boolean isReadOnly(ome.services.util.ReadOnlyStatus readOnly)
- Specified by:
isReadOnlyin interfaceome.services.util.ReadOnlyStatus.IsAware
-
-