Package ubic.gemma.cli.util
Class AbstractAutoSeekingCLI<T extends Auditable>
java.lang.Object
ubic.gemma.cli.util.AbstractCLI
ubic.gemma.cli.util.AbstractAuthenticatedCLI
ubic.gemma.cli.util.AbstractAutoSeekingCLI<T>
- 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
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ubic.gemma.cli.util.CLI
CLI.CommandGroup -
Field Summary
FieldsFields inherited from class ubic.gemma.cli.util.AbstractCLI
ABORTED, FAILURE, FAILURE_FROM_ERROR_OBJECTS, log, SUCCESS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAutoOption(org.apache.commons.cli.Options options) Add the-autooption.protected voidaddAutoOption(org.apache.commons.cli.Options options, Class<? extends AuditEventType> autoSeekEventType) Add the-autooption for a specificAuditEventType.protected final voidaddErrorObject(T errorObject, Exception exception) protected final voidaddErrorObject(T errorObject, String message) protected final voidaddErrorObject(T errorObject, String message, Throwable throwable) protected voidaddForceOption(org.apache.commons.cli.Options options) protected voidaddForceOption(org.apache.commons.cli.Options options, String description) protected voidaddLimitingDateOption(org.apache.commons.cli.Options options) Add the-mdateoption.protected final voidaddSuccessObject(T successObject) protected final voidaddSuccessObject(T successObject, String message) protected final voidaddWarningObject(T warningObject, String message) protected final voidaddWarningObject(T warningObject, String message, Throwable throwable) protected Class<? extends AuditEventType> Indicate the event to be used for auto-seeking.protected DateObtain the limiting date (i.e.protected booleanIndicate if auto-seek is enabled.protected booleanisForce()Check if forcing is enabled.protected booleannoNeedToRun(T auditable, Class<? extends AuditEventType> eventClass) Check if the given auditable can be skipped.protected voidprocessOptions(org.apache.commons.cli.CommandLine commandLine) Process command line options.protected voidsetForce()Enable the forcing mode.protected abstract SerializabletoBatchObject(T object) Convert the given object to a serializable object for batch processing.Methods inherited from class ubic.gemma.cli.util.AbstractAuthenticatedCLI
afterPropertiesSet, doAuthenticatedWork, doWork, setAuthenticateAnonymously, setEnvironment, setRequireLoginMethods inherited from class ubic.gemma.cli.util.AbstractCLI
abort, addBatchOption, addErrorObject, addErrorObject, addErrorObject, addSuccessObject, addSuccessObject, addThreadsOption, addWarningObject, addWarningObject, allowPositionalArguments, awaitBatchExecutorService, buildOptions, executeCommand, getApplicationContext, getBatchTaskExecutor, getBatchTaskProgressReporter, getCliContext, getCommandAliases, getCommandGroup, getCommandName, getHelpFooter, getNumThreads, getOptions, getShortDesc, getUsage, promptConfirmationOrAbort, setAllowPositionalArguments, setApplicationContext, setEstimatedMaxTasks, setReportFrequencyMillis
-
Field Details
-
FORCE_OPTION
- See Also:
-
-
Constructor Details
-
AbstractAutoSeekingCLI
-
-
Method Details
-
addAutoOption
protected void addAutoOption(org.apache.commons.cli.Options options) Add the-autooption.The auto option value can be retrieved with
isAutoSeek(). -
addAutoOption
protected void addAutoOption(org.apache.commons.cli.Options options, Class<? extends AuditEventType> autoSeekEventType) Add the-autooption for a specificAuditEventType.The event type can be retrieved with
getAutoSeekEventType(). -
addLimitingDateOption
protected void addLimitingDateOption(org.apache.commons.cli.Options options) Add the-mdateoption.The limiting date can be retrieved with
getLimitingDate(). -
addForceOption
protected void addForceOption(org.apache.commons.cli.Options options) -
addForceOption
-
isAutoSeek
protected boolean isAutoSeek()Indicate if auto-seek is enabled. -
getAutoSeekEventType
Indicate the event to be used for auto-seeking. -
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. -
processOptions
@OverridingMethodsMustInvokeSuper protected void processOptions(org.apache.commons.cli.CommandLine commandLine) throws org.apache.commons.cli.ParseException Description copied from class:AbstractCLIProcess command line options.Implement this to provide processing of options. It is called after
AbstractCLI.buildOptions(Options)and right beforeAbstractCLI.doWork().- Overrides:
processOptionsin classAbstractCLI- Throws:
org.apache.commons.cli.ParseException- in case of unrecoverable failure (i.e. missing option or invalid value), an exception can be raised and will result in an exit code ofAbstractCLI.FAILURE.
-
addSuccessObject
-
addSuccessObject
-
addWarningObject
-
addWarningObject
-
addErrorObject
-
addErrorObject
-
addErrorObject
-
toBatchObject
Convert the given object to a serializable object for batch processing. -
noNeedToRun
Check if the given auditable can be skipped.- Parameters:
auditable- auditableeventClass- can be null- Returns:
- boolean
-