Class DuplicateI

    • Constructor Summary

      Constructors 
      Constructor Description
      DuplicateI​(ome.security.ACLVoter aclVoter, ome.system.Roles securityRoles, ome.services.graphs.GraphPathBean graphPathBean, ome.security.basic.LightAdminPrivileges adminPrivileges, ome.services.delete.Deletion deletionInstance, java.util.Set<java.lang.Class<? extends ome.model.IObject>> targetClasses, ome.services.graphs.GraphPolicy graphPolicy, com.google.common.collect.SetMultimap<java.lang.String,​java.lang.String> unnullable, org.springframework.context.ApplicationContext applicationContext)
      Construct a new duplicate request; called from GraphRequestFactory.getRequest(Class).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void adjustGraphPolicy​(java.util.function.Function<ome.services.graphs.GraphPolicy,​ome.services.graphs.GraphPolicy> adjuster)
      Transform the currently applicable graph policy for this request by the given function.
      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 copyFieldsTo​(Duplicate request)
      Copy the fields of this request to that of the given request.
      void finish()
      Method within the transaction boundaries after all processing has occurred.
      ome.services.graphs.GraphPolicy.Action getActionForStarting()  
      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.
      java.util.Map<java.lang.String,​java.util.List<java.lang.Long>> getStartFrom​(Response response)
      From the response of the head-skipping request, determine which model objects are the targets of the operation.
      int getStepProvidingCompleteResponse()
      Get the step of this request that suffices for assembling the request's response.
      void init​(Helper helper)
      Method called within the transaction boundaries before any processing occurs.
      boolean isReadOnly​(ome.services.util.ReadOnlyStatus readOnly)  
      void setOriginalFileRepos()
      Use SQL to effect the required OriginalFile.setRepo(String) operations since the property was nulled for persisting the duplicate instances.
      java.lang.Object step​(int step)
      Single uncancellable action which will be performed by this IRequest.
      • 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

      • DuplicateI

        public DuplicateI​(ome.security.ACLVoter aclVoter,
                          ome.system.Roles securityRoles,
                          ome.services.graphs.GraphPathBean graphPathBean,
                          ome.security.basic.LightAdminPrivileges adminPrivileges,
                          ome.services.delete.Deletion deletionInstance,
                          java.util.Set<java.lang.Class<? extends ome.model.IObject>> targetClasses,
                          ome.services.graphs.GraphPolicy graphPolicy,
                          com.google.common.collect.SetMultimap<java.lang.String,​java.lang.String> unnullable,
                          org.springframework.context.ApplicationContext applicationContext)
        Construct a new duplicate request; called from GraphRequestFactory.getRequest(Class).
        Parameters:
        aclVoter - ACL voter for permissions checking
        securityRoles - the security roles
        graphPathBean - the graph path bean to use
        adminPrivileges - the light administrator privileges helper
        deletionInstance - a deletion instance for deleting files
        targetClasses - legal target object classes for duplicate
        graphPolicy - the graph policy to apply for duplicate
        unnullable - properties that, while nullable, may not be nulled by a graph traversal operation
        applicationContext - the OMERO application context from Spring
    • 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
      • setOriginalFileRepos

        public void setOriginalFileRepos()
        Use SQL to effect the required OriginalFile.setRepo(String) operations since the property was nulled for persisting the duplicate instances.
      • step

        public java.lang.Object step​(int step)
                              throws HandleI.Cancel
        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
        Throws:
        HandleI.Cancel - if this request is cancelled
      • finish

        public void finish()
        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
      • 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
      • adjustGraphPolicy

        public void adjustGraphPolicy​(java.util.function.Function<ome.services.graphs.GraphPolicy,​ome.services.graphs.GraphPolicy> adjuster)
        Description copied from interface: WrappableRequest
        Transform the currently applicable graph policy for this request by the given function. Must be called before IRequest.init(omero.cmd.Helper).
        Specified by:
        adjustGraphPolicy in interface WrappableRequest<Duplicate>
        Parameters:
        adjuster - a transformation function for graph policies
      • getStepProvidingCompleteResponse

        public int getStepProvidingCompleteResponse()
        Description copied from interface: WrappableRequest
        Get the step of this request that suffices for assembling the request's response. It is presumed that checking the permissibility of the planned operation occurs afterward.
        Specified by:
        getStepProvidingCompleteResponse in interface WrappableRequest<Duplicate>
        Returns:
        a step number
      • getActionForStarting

        public ome.services.graphs.GraphPolicy.Action getActionForStarting()
        Specified by:
        getActionForStarting in interface WrappableRequest<Duplicate>
        Returns:
        the action associated with nodes qualifying as start objects
      • getStartFrom

        public java.util.Map<java.lang.String,​java.util.List<java.lang.Long>> getStartFrom​(Response response)
        Description copied from interface: WrappableRequest
        From the response of the head-skipping request, determine which model objects are the targets of the operation.
        Specified by:
        getStartFrom in interface WrappableRequest<Duplicate>
        Parameters:
        response - the head-skipping request's response
        Returns:
        the model objects to target
      • isReadOnly

        public boolean isReadOnly​(ome.services.util.ReadOnlyStatus readOnly)
        Specified by:
        isReadOnly in interface ome.services.util.ReadOnlyStatus.IsAware