Class AbstractAutoSeekingCLI<T extends Auditable>

  • Type Parameters:
    T - the type of entity being seeked
    All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.EnvironmentAware, CLI
    Direct Known Subclasses:
    ArrayDesignSequenceManipulatingCli, ExpressionExperimentManipulatingCLI

    public abstract class AbstractAutoSeekingCLI<T extends Auditable>
    extends AbstractAuthenticatedCLI
    Provide auto-seeking capabilities to a CLI.

    This allows CLIs to process entities that lack certain AuditEvent or that haven't been updated since a certain date.

    • Constructor Detail

      • AbstractAutoSeekingCLI

        protected AbstractAutoSeekingCLI​(Class<T> entityClass)
    • Method Detail

      • addAutoOption

        protected void addAutoOption​(org.apache.commons.cli.Options options)
        Add the -auto option.

        The auto option value can be retrieved with isAutoSeek().

      • addLimitingDateOption

        protected void addLimitingDateOption​(org.apache.commons.cli.Options options)
        Add the -mdate option.

        The limiting date can be retrieved with getLimitingDate().

      • addForceOption

        protected void addForceOption​(org.apache.commons.cli.Options options)
      • addForceOption

        protected void addForceOption​(org.apache.commons.cli.Options options,
                                      String description)
      • isAutoSeek

        protected boolean isAutoSeek()
        Indicate if auto-seek is enabled.
      • getAutoSeekEventType

        protected Class<? extends AuditEventType> getAutoSeekEventType()
        Indicate the event to be used for auto-seeking.
      • getLimitingDate

        @Nullable
        protected Date getLimitingDate()
        Obtain the limiting date (i.e. starting date at which entities should be processed).
      • isForce

        protected boolean isForce()
        Check if forcing is enabled.
      • setForce

        protected void setForce()
        Enable the forcing mode.
      • addSuccessObject

        protected final void addSuccessObject​(T successObject,
                                              String message)
      • addSuccessObject

        protected final void addSuccessObject​(T successObject)
      • addWarningObject

        protected final void addWarningObject​(@Nullable
                                              T warningObject,
                                              String message)
      • addWarningObject

        protected final void addWarningObject​(@Nullable
                                              T warningObject,
                                              String message,
                                              Throwable throwable)
      • addErrorObject

        protected final void addErrorObject​(@Nullable
                                            T errorObject,
                                            String message)
      • addErrorObject

        protected final void addErrorObject​(@Nullable
                                            T errorObject,
                                            Exception exception)
      • toBatchObject

        protected abstract Serializable toBatchObject​(@Nullable
                                                      T object)
        Convert the given object to a serializable object for batch processing.
      • noNeedToRun

        protected boolean noNeedToRun​(T auditable,
                                      @Nullable
                                      Class<? extends AuditEventType> eventClass)
        Check if the given auditable can be skipped.
        Parameters:
        auditable - auditable
        eventClass - can be null
        Returns:
        boolean