Package omero.cmd.fs

Class 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
    • 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
      void buildResponse​(int step, java.lang.Object object)
      Post-transaction chance to map from the return value of IRequest.step(int) to a Response object.
      void finish()
      Method within the transaction boundaries after all processing has occurred.
      protected RLong firstIdOrNull​(java.lang.String query)
      Use IQuery.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.
      Response getResponse()
      Returns the current response value.
      void init​(Helper helper)
      Method called within the transaction boundaries before any processing occurs.
      boolean isReadOnly​(ome.services.util.ReadOnlyStatus readOnly)  
      protected void loadFileAnnotation()
      Only called if loadFileset() finds no Fileset.
      protected void loadFileset()
      Searches for a Fileset attached to this Image, and if present, uses Bio-Formats to parse the metadata into the OriginalMetadataResponse instance.
      static void main​(java.lang.String[] args)  
      protected void parseOriginalMetadataTxt​(java.io.File file)
      Read the given INI-style file and populate the maps with the properties from the corresponding sections.
      java.lang.Object step​(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)
      Use IceMapper to convert from Object instances in the given Hashtable to RType instances.
      • Methods inherited from class Ice.ObjectImpl

        ___ice_id, ___ice_ids, ___ice_isA, ___ice_ping, __checkMode, __dispatch, __read, __read, __readImpl, __write, __write, __writeImpl, ice_dispatch, ice_dispatch, ice_operationAttributes, ice_ping, ice_ping, ice_postUnmarshal, ice_preMarshal
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OriginalMetadataRequestI

        public OriginalMetadataRequestI​(ome.io.nio.PixelsService pixelsService)
    • Method Detail

      • getCallContext

        public java.util.Map<java.lang.String,​java.lang.String> getCallContext()
        Description copied from interface: IRequest
        Returns 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 static Map as desired.
        Specified by:
        getCallContext in interface IRequest
        Returns:
        the call context for this request
      • init

        public void init​(Helper helper)
        Description copied from interface: IRequest
        Method called within the transaction boundaries before any processing occurs. Implementations must properly initialize the "step" field of the Status object by calling Helper.setSteps(int). This count will define how many times the IRequest.step(int) method will be called. The Helper instance passed in contains those resources needed by IRequests to interact with data and should be stored for later use.
        Specified by:
        init in interface IRequest
        Parameters:
        helper - the helper for this request
      • step

        public java.lang.Object step​(int step)
        Description copied from interface: IRequest
        Single 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 to IRequest.buildResponse(int, Object) for conversion and storage.
        Specified by:
        step in interface IRequest
        Parameters:
        step - the step number
        Returns:
        an object to be used in building the response
      • finish

        public void finish()
                    throws HandleI.Cancel
        Description copied from interface: IRequest
        Method within the transaction boundaries after all processing has occurred. A thrown HandleI.Cancel will still rollback the current transaction.
        Specified by:
        finish in interface IRequest
        Throws:
        HandleI.Cancel - if this request is cancelled
      • buildResponse

        public void buildResponse​(int step,
                                  java.lang.Object object)
        Description copied from interface: IRequest
        Post-transaction chance to map from the return value of IRequest.step(int) to a Response object.
        Specified by:
        buildResponse in interface IRequest
        Parameters:
        step - the step number
        object - an object to be used in building the response
      • getResponse

        public Response getResponse()
        Description copied from interface: IRequest
        Returns 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:
        getResponse in interface IRequest
        Returns:
        the response to this request
      • loadFileset

        protected void loadFileset()
        Searches for a Fileset attached to this Image, and if present, uses Bio-Formats to parse the metadata into the OriginalMetadataResponse instance. If no Fileset is present, then there may be a FileAnnotation present which has a static version of the metadata.
      • loadFileAnnotation

        protected void loadFileAnnotation()
        Only called if loadFileset() finds no Fileset. If any FileAnnotation instances with the appropriate namespace and name are found, the first one is taken and parsed into the OriginalMetadataResponse.
      • firstIdOrNull

        protected RLong firstIdOrNull​(java.lang.String query)
        Use IQuery.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)
        Use IceMapper to convert from Object instances in the given Hashtable to RType instances. This may throw an exception on unknown types.
      • 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:
        isReadOnly in interface ome.services.util.ReadOnlyStatus.IsAware