com.filenet.api.engine

Interface SweepActionHandler



  • public interface SweepActionHandler
    An interface to be implemented by a custom sweep handler. A custom sweep handler runs on the server and implements the behavior associated with a custom sweep object. Custom sweep handlers are a feature of the sweep service that allows it to be extended to include user-defined behavior.

    A custom sweep handler is invoked by a custom sweep object -- either a CmCustomSweepJob, CmCustomSweepPolicy, or CmCustomQueueSweep. After the sweep retrieves instances of a target class, like Document or Annotation, the sweep passes the instances to the custom sweep handler. The handler processes the instances according to the behavior defined by its implementer. For example, a CmCustomSweepJob could sweep for all documents of a specified class and pass the retrieved instances to the custom SweepActionHandler implementation. The implementation could then change the class of the documents.

    Important: While a SweepActionHandler implementation can alter or delete objects returned by CmCustomSweepJob or CmCustomSweepPolicy, it must not attempt to alter queue objects returned by CmCustomQueueSweep. The sweep framework is responsible for selecting, leasing, updating, and deleting queue objects. The SweepActionHandler must not perform operations on queue objects that might conflict with the sweep framework. Doing so can result in database deadlocks, timeouts, or slow performance.

    When implementing a sweep handler, consider the following points:

    • A sweep handler runs asynchronously.
    • You can implement a sweep handler as a Java or JavaScript component. For the Content Platform Engine to find a Java sweep handler, the Java class that implements it must be checked in as a CodeModule object.
    See Also:
    Custom Sweeps, Action Handlers
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface and Description
      static interface  SweepActionHandler.SweepItem
      A subinterface for getting an instance of a class targeted by a custom sweep (CmCustomQueueJob, CmCustomSweepPolicy, or CmCustomQueueSweep).
    • Method Detail

      • onSweep

        void onSweep(CmSweep sweepObject,
                     SweepActionHandler.SweepItem[] sweepItems)
        Invoked when a custom sweep job or queue sweep passes instances of a target class to the custom sweep handler.
        Parameters:
        sweepObject - The custom sweep (CmCustomSweepJob or CmCustomQueueSweep) that invoked this method. Note that this custom sweep object that's passed to this method does not necessarily reflect the current state of counter properties (examined, processed, and failed counts).
        sweepItems - An array of SweepItem objects that contains instances of the target class retrieved by the sweep service.
      • onPolicySweep

        void onPolicySweep(CmSweep sweepObject,
                           CmSweepPolicy sweepPolicy,
                           SweepActionHandler.SweepItem[] sweepItems)
        Invoked when a custom sweep policy passes instances of a target class to the custom sweep handler.
        Parameters:
        sweepObject - The policy controlled sweep (CmPolicyControlledSweep) that invoked this method. Note that this policy controlled sweep that's passed to this method does not necessarily reflect the current state of counter properties (examined, processed, and failed counts).
        sweepPolicy - The custom sweep policy (CmCustomSweepPolicy) associated with the policy controlled sweep that invoked this method. Note that the custom sweep policy that's passed to this method does not necessarily the current state of counter properties (examined, processed, and failed counts).
        sweepItems - An array of SweepItem objects that contains instances of the target class retrieved by the sweep service.
      • getRequiredProperties

        java.lang.String[] getRequiredProperties()
        Returns an array of names specifying the properties to be automatically fetched for processing by the handler. These are properties from the target class instances passed to the handler.

        Specify only the properties that are required by the handler, and the server will return only those properties and a set of system properties. Limiting the set of properties to only what's required by the handler allows you to create a covering database index on just those properties, and the sweep service will more efficiently retrieve objects from the database.

        If you return an empty array, then all properties are fetched. If the handler attempts to access an unfetched property, a API_PROPERTY_NOT_IN_CACHE exception is thrown.

        The method is called automatically when the handler is invoked by a custom sweep job or sweep policy. It is not called when the handler is invoked by a custom queue sweep.

© Copyright IBM Corporation 2006, 2019. All rights reserved.